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

Use `aws_ebs_volume` and `aws_volume_attachment` instead of dynamic `ebs_block_device` volume #263

Closed kennedy closed 2 years ago

kennedy commented 2 years ago

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

Potentially resolves the following:

214

261

terraform-provider-aws#21806

Currently, using the aws_instance.ebs_block_device argument to add volumes would override/destroy the pre-configured EBS volumes from the AMI.

Describe the solution you'd like.

Since the documentation even says:

Currently, changes to the ebs_block_device configuration of existing resources cannot be automatically detected by Terraform.

Instead of declaring the EBS blocks dynamically in the aws_instance resource, we ought to add EBS blocks safely with aws_ebs_volume and aws_volume_attachment.

Describe alternatives you've considered.

Additional context

There is a case for adjusting the AMI size after ec2 creation, but I believe that would only work for the root device, not the extra EBS.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 2 years ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 2 years 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.