Closed kennedy closed 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
This issue was automatically closed because of stale in 10 days
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.
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:
Instead of declaring the EBS blocks dynamically in the
aws_instance
resource, we ought to add EBS blocks safely withaws_ebs_volume
andaws_volume_attachment
.Describe alternatives you've considered.
Add the
aws_ebs_volume
andaws_volume_attachment
outside the module. But there will be a "need apply first" error, becausemodule.*ec2-instance
needs to exist prior for anycount
/for_each
inaws_ebs_volume
andaws_volume_attachment
. We would need to do aapply --target
first, then create the auxiliary EBS attachments. Best way to avoid this graph promise error is to have the module itself handle the attachment.Use
aws_ami_copy
to recreate the AMI with the proper EBS and root size.Add
availability_zone
to the output to facilitated betteraws_ebs_volume
creation. Issue #264, but does not resolve thefor_each
/count
issuesAdditional 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.