terraform-aws-ec2-instance
terraform-aws-ec2-instance copied to clipboard
Support for aws_volume_attachment
Is your request related to a new offering from AWS?
Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.
- Yes β : earliest reference was found in version 1.7.0
Is your request related to a problem? Please describe.
I'm creating an immutable server that stores large volume of data. For that, I create an EC2 instance with ephemeral storage 8Gb, and a permanent storage 100Gb. I would like to define the EC2 instance to use aws_volume_attachment
Describe the solution you'd like.
When using Terragrunt, I would like to specify the following:
terraform {
source = "tfr:///terraform-aws-modules/ec2-instance/aws//?version=4.0.0"
}
...
dependency "storage" {
config_path = "PATH_TO_EBS_STORAGE"
}
inputs = {
ami = ...
instance_type = ...
ebs_volume_attachment = [
{
device_name ="/dev/xvdb"
volume_id = dependency.storage.outputs.id
}
]
...
}
...
Describe alternatives you've considered.
Currently I've copied and paste this repo code that defines an aws_instance
resource to main.tf
and and variables.tf
files, with some modifications.
Additional context
I would be happy to contribute with this change if you think this could help others
Hello,
Did you have a look at this ? => https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/blob/master/examples/volume-attachment/main.tf
Hope this helps.
Bests.
@schniber Thanks for the reply. Yes, I had seen that. That example shows how to create an EC2 instance, volume, and volume_attachment
. My proposal is that the definition of the volume_attachment
resource could be done by the ec2
module directly. In Terraform, it's not a big deal to do as in the example. In Terragrunt, however, it would make the code simpler.
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.