terraform-aws-modules / terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws
Apache License 2.0
758 stars 1.88k forks source link

updating associate_public_ip_address should not cause ec2_instance to be replaced #357

Closed shichengripple001 closed 1 year ago

shichengripple001 commented 1 year ago

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

Is your request related to a problem? Please describe.

When I associate_public_ip_address, i got: module.xxxxx_ec2_instance.module.xxxxx_ec2_instance[1].aws_instance.this[0] must be replaced

Describe the solution you'd like.

The network interface should be detached, in stead of replacing the instance

Describe alternatives you've considered.

Additional context

bryantbiggs commented 1 year ago

this is not due to the module - its due to the API https://github.com/hashicorp/terraform-provider-aws/blob/91e5b0735e748360b790469a77d8dfb7d4943e98/internal/service/ec2/ec2_instance.go#L77

github-actions[bot] commented 1 year ago

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.