Closed kristianfzr closed 2 years ago
associate_public_ip_address = true -> false # forces replacement
It means, you're changing associate_public_ip_address
in your configuration, and AWS wants to recreate this instance. This is expected behavior.
@antonbabenko Thats really the case! But what stands out to me is: I deploy it initially with that statement to false
after that with the EIP it gets associated with the instance after it has been deployed.. So it looks like the instance thinks it has no public IP address and when I re-apply/plan it catches the EIP attached and sets the it to false
as it probably exists in the state file. My question will be if a set the value to true
will that create a public_ip
and on top add a EIP with the terraform EIP resource?
I don't remember how it works internally, but the public IP of an instance and EIP are two different things in AWS.
Also, I just searched terraform AWS provider repo issues and found there were some similar: https://github.com/hashicorp/terraform-provider-aws/issues/8425
Search query: https://github.com/hashicorp/terraform-provider-aws/issues?q=is%3Aissue+associate_public_ip_address+aws_instance+is%3Aopen
I will close this one because this is not a problem with the module itself.
Please ask on https://discuss.hashicorp.com where much more people are.
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.
Description
Hi there,
I am facing an issue when I deploy an instance and after that I try to plan it or add output(or even with no changes plan it), it tries to replace the instance and create a new one. I wanted to know is this normal and is it AWS related or there is something I am missing, it could be related to the ssh module, but its intended to create an SSH key for you and nothing else.
Versions
Module version = "~> 3.0"
Terraform v0.14.3
Reproduction Code [Required]
Steps to reproduce the behavior:
terraform init
after thatterraform plan/apply
Expected behavior
After it being deployed once to not want to re-create it.
Actual behavior
Wants to re-create the instance even without changes to it.
Terminal Output Screenshot(s)
Additional context