Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform CLI and Terraform AWS Provider Version
Terraform v0.14.5
Provider version: 3.36.0 and 3.40.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
resource aws_ecs_task_definition service {
container_definitions = <<-JSON
[
{
"name": "${var.service-name}",
"image": "${var.image}",
"essential": true,
"portMappings": [
{
"containerPort": ${var.container_port},
"hostPort": ${var.container_port}
}
],
"environment" : ${jsonencode(local.env_vars)},
"secrets" : ${jsonencode(var.secrets)},
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "${var.awslogs-group}",
"awslogs-region": "${var.awslogs-region}",
"awslogs-stream-prefix": "web"
}
}
%{if var.ulimit != null} ,
"Ulimits": ${jsonencode(var.ulimit)}
%{endif}
}
]
JSON
family = "${var.service-name}-${var.environment}"
task_role_arn = var.task_role_arn
execution_role_arn = var.task_role_arn
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = var.container_cpu
memory = var.container_memory
tags = {
Environment = var.environment
AppName = var.service-name
}
}
Debug Output
Panic Output
Expected Behavior
When adding tags to an AWS Task Definition resource, I expect the tags to be added to the task created based on that task definition as described here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html#tag-resources. That means that the task definition tags should be propagated to the task that is based on it.
Actual Behavior
Tags are not being propagated as expected.
Steps to Reproduce
terraform apply
Important Factoids
References
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.14.5
Provider version: 3.36.0 and 3.40.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
When adding tags to an AWS Task Definition resource, I expect the tags to be added to the task created based on that task definition as described here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html#tag-resources. That means that the task definition tags should be propagated to the task that is based on it.
Actual Behavior
Tags are not being propagated as expected.
Steps to Reproduce
terraform applyImportant Factoids
References