Skip to content

Commit 4effb2a

Browse files
authored
Change variable "privileged" type to bool (#71)
The variable "privileged" is currently type string, which is a holdover from Terraform v0.11/HCL v1. This variable is broken in TF 0.12; it causes an error because the AWS provider was expected a bool `true` but got a string `"true"` instead.
1 parent 5b3a630 commit 4effb2a

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Available targets:
138138
| log_configuration | Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html | object | `null` | no |
139139
| mount_points | Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume` | object | `null` | no |
140140
| port_mappings | The port mappings to configure for the container. This is a list of maps. Each map should contain "containerPort", "hostPort", and "protocol", where "protocol" is one of "tcp" or "udp". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort | object | `<list>` | no |
141-
| privileged | When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. Due to how Terraform type casts booleans in json it is required to double quote this value | string | `null` | no |
141+
| privileged | When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. | bool | `null` | no |
142142
| readonly_root_filesystem | Determines whether a container is given read-only access to its root filesystem. Due to how Terraform type casts booleans in json it is required to double quote this value | bool | `false` | no |
143143
| repository_credentials | Container repository credentials; required when using a private repo. This map currently supports a single key; "credentialsParameter", which should be the ARN of a Secrets Manager's secret holding the credentials | map(string) | `null` | no |
144144
| secrets | The secrets to pass to the container. This is a list of maps | object | `null` | no |

Diff for: docs/terraform.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
| log_configuration | Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html | object | `null` | no |
2323
| mount_points | Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume` | object | `null` | no |
2424
| port_mappings | The port mappings to configure for the container. This is a list of maps. Each map should contain "containerPort", "hostPort", and "protocol", where "protocol" is one of "tcp" or "udp". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort | object | `<list>` | no |
25-
| privileged | When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. Due to how Terraform type casts booleans in json it is required to double quote this value | string | `null` | no |
25+
| privileged | When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. | bool | `null` | no |
2626
| readonly_root_filesystem | Determines whether a container is given read-only access to its root filesystem. Due to how Terraform type casts booleans in json it is required to double quote this value | bool | `false` | no |
2727
| repository_credentials | Container repository credentials; required when using a private repo. This map currently supports a single key; "credentialsParameter", which should be the ARN of a Secrets Manager's secret holding the credentials | map(string) | `null` | no |
2828
| secrets | The secrets to pass to the container. This is a list of maps | object | `null` | no |

Diff for: examples/complete/fixtures.us-east-2.tfvars

+2
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ log_configuration = {
4848
}
4949
secretOptions = null
5050
}
51+
52+
privileged = false

Diff for: examples/complete/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ module "container" {
1414
environment = var.environment
1515
port_mappings = var.port_mappings
1616
log_configuration = var.log_configuration
17+
privileged = var.privileged
1718
}

Diff for: examples/complete/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ variable "log_configuration" {
6868
})
6969
description = "Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html"
7070
}
71+
72+
variable "privileged" {
73+
type = bool
74+
description = "When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type."
75+
}

Diff for: variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ variable "stop_timeout" {
246246
}
247247

248248
variable "privileged" {
249-
type = string
250-
description = "When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. Due to how Terraform type casts booleans in json it is required to double quote this value"
249+
type = bool
250+
description = "When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type."
251251
default = null
252252
}
253253

0 commit comments

Comments
 (0)