turnerlabs / terraform-ecs-fargate

A Terraform template used for provisioning web application stacks on AWS ECS Fargate
Apache License 2.0
425 stars 158 forks source link

Update depends_on to refer to the targetgroup rather than the listener #12

Closed abarfoot closed 6 years ago

abarfoot commented 6 years ago

By moving the dependency from the listener to the target group, users should be able to delete lb-http.tf without needing to update the dependency in ecs.tf.

The dependency is apparently no longer strictly required, because this merged PR https://github.com/terraform-providers/terraform-provider-aws/pull/3535 added retry logic for creating the ecs_service resource.

However, they still recommend a dependency to avoid a failed attempt. From https://github.com/terraform-providers/terraform-provider-aws/issues/3495 :

we'll continue to recommend the usage of depends_on in the aws_ecs_service resource pointing to the aws_lb_target_group, where possible.

Untested.

jritsema commented 6 years ago

Just tested and unfortunately still doesn't work :(

* aws_ecs_service.app: InvalidParameterException: The target group with targetGroupArn arn:aws:elasticloadbalancing:us-east-1:367555685970:targetgroup/depends-on-test-dev/b96ad7836a2fe8e7 does not have an associated load balancer.

Tested with:

Terraform v0.11.8
+ provider.aws v1.33.0

Going to close this for now. We can always re-test/re-open later.