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

aws_ecs_service cannot be modified after initial creation to add an IAM Role and/or an ELB #3444

Closed
CpuID opened this issue Oct 8, 2015 · 4 comments

Comments

@CpuID
Copy link
Contributor

CpuID commented Oct 8, 2015

Looks like this is only permitted at initial creation.

STR:

  • Define an aws_ecs_task_definition, assign it to an aws_ecs_service without the iam_role and load_balancer properties
  • Apply
  • Add iam_role and load_balancer as per the docs
  • Plan succeeds
  • Apply succeeds
  • ELB is not added to the Service.

This may be an upstream API limitation also, not just a TF bug (haven't researched). Either way it should either work as expected (updated .tf, update the resource), or error out that it can't be changed after creation, maybe force a new resource or something.

cc @radeksimko

@radeksimko
Copy link
Member

Changing ELB association is apparently a destructive action since there's no way to update it - we'll need to mark all aws_ecs_service.load_balancer.* fields as ForceNew: true.

You could probably make it less destructive by using lifecycle { create_before_destroy = true } on the aws_ecs_service, so that the new association takes place, traffic is served from the new service and old association is removed. For that however we will need to make name optional & generated, otherwise this would fail due to name conflict.

This is also a root cause for #4227

I'm working on a PR which should appear soon and fix this.

@CpuID
Copy link
Contributor Author

CpuID commented Dec 16, 2015

thx :)

radeksimko added a commit to MeredithCorpOSS/terraform that referenced this issue Dec 17, 2015
radeksimko added a commit to MeredithCorpOSS/terraform that referenced this issue Dec 17, 2015
radeksimko added a commit to MeredithCorpOSS/terraform that referenced this issue Dec 17, 2015
@radeksimko
Copy link
Member

See #4366

radeksimko added a commit to MeredithCorpOSS/terraform that referenced this issue Dec 22, 2015
@ghost
Copy link

ghost commented Apr 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants