to "aws_instance" configuration, "ebs_block_device" changes have to be skipped during the second run terraform apply/plan
Actual Behavior
When I deploy EC2 instance with additional EBS volume(s) (via aws_ebs_volume + aws_volume_attachment). The second terraform plan/apply adding ebs_block_device configuration for the EBS volumes to the EC2 instance. This fails idempotency for our terraform module.
Relevant Error/Panic Output Snippet
Terraform detected the following changes made outside of Terraform since the last "terraform apply":
# aws_instance.ec2 has changed
~ resource "aws_instance" "ec2" {
***
+ ebs_block_device {
+ delete_on_termination = false
+ device_name = "/dev/sdg"
+ encrypted = true
+ iops = 100
+ throughput = 0
+ volume_id = "vol-***"
+ volume_size = 50
+ volume_type = "io2"
}
***
Run terraform apply for the first time -> all recourses will be created.
Run terraform apply/plan a second time, tf will discover "new resources" and add to instance configuration.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.1-1.5
AWS Provider Version
5.20.0
Affected Resource(s)
aws_instance, aws_ebs_volume, aws_volume_attachment
Expected Behavior
When added field
to "aws_instance" configuration, "ebs_block_device" changes have to be skipped during the second run terraform apply/plan
Actual Behavior
When I deploy EC2 instance with additional EBS volume(s) (via aws_ebs_volume + aws_volume_attachment). The second terraform plan/apply adding ebs_block_device configuration for the EBS volumes to the EC2 instance. This fails idempotency for our terraform module.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Run terraform apply for the first time -> all recourses will be created. Run terraform apply/plan a second time, tf will discover "new resources" and add to instance configuration.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None