terraform-aws-ecs-alb-service-task
terraform-aws-ecs-alb-service-task copied to clipboard
Changing `task_exec_policy_arns` or `task_policy_arns` cause recreations
Found a bug? Maybe our Slack Community can help.
Describe the Bug
The resource aws_iam_role_policy_attachment uses count logic instead of a for_each which causes deletions and creations of attachments when adding or removing policies.
https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/blob/07cd6ae9a3e79fe7cbc2ade37fb0e2b5f1b67c19/main.tf#L287-L291
https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/blob/07cd6ae9a3e79fe7cbc2ade37fb0e2b5f1b67c19/main.tf#L160-L164
If a for_each is used instead, this will prevent deleting and recreating all the attachments.