Releases: DNXLabs/terraform-aws-ecs
Releases · DNXLabs/terraform-aws-ecs
5.5.1
5.5.0
5.4.0
5.3.0
5.2.1
5.2.0
5.1.0
5.0.1
5.0.0
FEATURES
- Adding fargate and fargate_spot support
- Parameter
fargate_onlywill prevent creating EC2 resources: ASG and EFS
Some resources like aws_efs_file_system now have a count parameter on them. An upgrade will cause terraform to recreate those resources because the key in the state file changed to aws_efs_file_system.ecs to aws_efs_file_system.ecs[0].
To prevent this problem, follow the steps:
- Backup your state file:
terraform state pull > terraform-state-bkp1.tfstate - Rename all drifted resources to add the
[0]suffix to it by using the example below. Notice that the resource prefix needs to be changed (from both sides) to reflect your setup:
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_iam_role_policy_attachment.ecs_ecs module.ecs_cluster[\"dev-workers\"].aws_iam_role_policy_attachment.ecs_ecs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_iam_role_policy_attachment.ecs_ssm module.ecs_cluster[\"dev-workers\"].aws_iam_role_policy_attachment.ecs_ssm[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_security_group_rule.nfs_from_ecs_to_efs module.ecs_cluster[\"dev-workers\"].aws_security_group_rule.nfs_from_ecs_to_efs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_security_group.efs module.ecs_cluster[\"dev-workers\"].aws_security_group.efs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_autoscaling_group.ecs module.ecs_cluster[\"dev-workers\"].aws_autoscaling_group.ecs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_launch_template.ecs module.ecs_cluster[\"dev-workers\"].aws_launch_template.ecs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_iam_instance_profile.ecs module.ecs_cluster[\"dev-workers\"].aws_iam_instance_profile.ecs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_ecs_capacity_provider.ecs_capacity_provider module.ecs_cluster[\"dev-workers\"].aws_ecs_capacity_provider.ecs_capacity_provider[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_efs_file_system.ecs module.ecs_cluster[\"dev-workers\"].aws_efs_file_system.ecs[0]
terraform state mv module.ecs_cluster[\"dev-workers\"].aws_iam_role.ecs module.ecs_cluster[\"dev-workers\"].aws_iam_role.ecs[0]
In the example above, the prefix is module.ecs_cluster[\"dev-workers\"], which is the name given to this module in the terraform stack.
4.9.3
ENHANCEMENTS
- Create ECS CodeDeploy IAM Role for Blue/Green Deployment on Cluster level
Additional information:
Previously ECS CodeDeploy IAM Role for Blue/Green Deployment was being created on ECS APP Module, meaning each ECS service was creating the role with exactly same permissions, creating unnecessary duplication.