Skip to content

Commit 4ae9351

Browse files
committed
feat: Add docker_labels
Allow the user to define a list of Docker labels without providing the entire task definition.
1 parent f22aa23 commit 4ae9351

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
# Build Harness
1313
.build-harness
1414
build-harness/
15+
16+
# Atmos
17+
.atmos

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ module "default_backend_web_app" {
246246
| <a name="input_deployment_minimum_healthy_percent"></a> [deployment\_minimum\_healthy\_percent](#input\_deployment\_minimum\_healthy\_percent) | The lower limit (as a percentage of `desired_count`) of the number of tasks that must remain running and healthy in a service during a deployment | `number` | `100` | no |
247247
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br/>Map of maps. Keys are names of descriptors. Values are maps of the form<br/>`{<br/> format = string<br/> labels = list(string)<br/>}`<br/>(Type is `any` so the map values can later be enhanced to provide additional options.)<br/>`format` is a Terraform format string to be passed to the `format()` function.<br/>`labels` is a list of labels, in order, to pass to `format()` function.<br/>Label values will be normalized before being passed to `format()` so they will be<br/>identical to how they appear in `id`.<br/>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
248248
| <a name="input_desired_count"></a> [desired\_count](#input\_desired\_count) | The desired number of tasks to start with. Set this to 0 if using DAEMON Service type. (FARGATE does not suppoert DAEMON Service type) | `number` | `1` | no |
249+
| <a name="input_docker_labels"></a> [docker\_labels](#input\_docker\_labels) | Map of Docker labels to assign to the container | `map(string)` | `null` | no |
249250
| <a name="input_ecr_enabled"></a> [ecr\_enabled](#input\_ecr\_enabled) | A boolean to enable/disable AWS ECR | `bool` | `true` | no |
250251
| <a name="input_ecr_image_tag_mutability"></a> [ecr\_image\_tag\_mutability](#input\_ecr\_image\_tag\_mutability) | The tag mutability setting for the ecr repository. Must be one of: `MUTABLE` or `IMMUTABLE` | `string` | `"IMMUTABLE"` | no |
251252
| <a name="input_ecr_scan_images_on_push"></a> [ecr\_scan\_images\_on\_push](#input\_ecr\_scan\_images\_on\_push) | Indicates whether images are scanned after being pushed to the repository (true) or not (false) | `bool` | `false` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ module "container_definition" {
8181
container_memory = var.container_memory
8282
container_memory_reservation = var.container_memory_reservation
8383
container_cpu = var.container_cpu
84+
docker_labels = var.docker_labels
8485
start_timeout = var.container_start_timeout
8586
stop_timeout = var.container_stop_timeout
8687
healthcheck = var.healthcheck

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ variable "container_memory" {
9696
default = 512
9797
}
9898

99+
variable "docker_labels" {
100+
type = map(string)
101+
description = "Map of Docker labels to assign to the container"
102+
default = null
103+
}
104+
99105
variable "container_start_timeout" {
100106
type = number
101107
description = "Time duration (in seconds) to wait before giving up on resolving dependencies for a container"

0 commit comments

Comments
 (0)