Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip_destroy variable to aws_ecs_task_definition in module.ecs_alb_service_task #295

Open
wes-nimblerx opened this issue Jan 13, 2025 · 0 comments

Comments

@wes-nimblerx
Copy link

Describe the Feature

Adding this variable is dependent on the below feature request
cloudposse/terraform-aws-ecs-alb-service-task#258

This is a workaround to prevent the below error from happening about 1 in 10 apply

Terraform will perform the following actions:
  # aws_ecs_task_definition.service must be replaced
  # module.ecs_web.module.ecs_alb_service_task.aws_ecs_service.default[0] will be updated in-place
  # module.ecs_web.module.ecs_alb_service_task.aws_ecs_task_definition.default[0] must be replaced
Plan: 2 to add, 1 to change, 2 to destroy.
Changes to Outputs:
module.ecs_web.module.ecs_alb_service_task.aws_ecs_task_definition.default[0]: Destroying... [id=team-infra-worker]
aws_ecs_task_definition.service: Destroying... [id=team-infra-worker]
aws_ecs_task_definition.service: Destruction complete after 1s
module.ecs_web.module.ecs_alb_service_task.aws_ecs_task_definition.default[0]: Destruction complete after 1s
aws_ecs_task_definition.service: Creating...
module.ecs_web.module.ecs_alb_service_task.aws_ecs_task_definition.default[0]: Creating...
aws_ecs_task_definition.service: Creation complete after 0s [id=team-infra-worker]
│ Warning: Argument is deprecated
│ 
│   with module.ecs_web.module.ecs_codepipeline.aws_s3_bucket.default,
│   on .terraform/modules/ecs_web.ecs_codepipeline/main.tf line 16, in resource "aws_s3_bucket" "default":
│   16:   acl           = "private"
│ 
│ Use the aws_s3_bucket_acl resource instead
│ Error: creating ECS Task Definition (team-infra-worker): operation error ECS: RegisterTaskDefinition, https response error StatusCode: 400, RequestID: XXXXXXX, ClientException: Too many concurrent attempts to create a new revision of the specified family.
│ 
│   with module.ecs_web.module.ecs_alb_service_task.aws_ecs_task_definition.default[0],
│   on .terraform/modules/ecs_web.ecs_alb_service_task/main.tf line 39, in resource "aws_ecs_task_definition" "default":
│   39: resource "aws_ecs_task_definition" "default" {
│ 
Error: Process completed with exit code 1.

Expected Behavior

skip_destroy = true will prevent the destroy from happening and further reduce the chance of too many concurrent attempts│

Use Case

This is a workaround to prevent the below error from happening about 1 in 10 apply

Error: creating ECS Task Definition (team-infra-worker): operation error ECS: RegisterTaskDefinition, https response error StatusCode: 400, RequestID: XXXXXXX, ClientException: Too many concurrent attempts to create a new revision of the specified family.
│

Describe Ideal Solution

Fix the terraform code to reliably handle a destroy and immediate create of a new task definition every time

Alternatives Considered

This is a workaround to prevent the below error from happening about 1 in 10 apply

Error: creating ECS Task Definition (team-infra-worker): operation error ECS: RegisterTaskDefinition, https response error StatusCode: 400, RequestID: XXXXXXX, ClientException: Too many concurrent attempts to create a new revision of the specified family.
│

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant