terraform-aws-ec2-instance icon indicating copy to clipboard operation
terraform-aws-ec2-instance copied to clipboard

feat: Add direct support for volume attachments

Open tiagomlalves opened this issue 3 years ago β€’ 2 comments

Description

Add ebs_volume_attachments input variable and logic to automatically attach previously created volumes when starting instances.

Motivation and Context

This change simplifies the creation of immutable servers when using Terragrunt with this module enabling the following configuration:

dependency "testdata_storage" {
    config_path = "../../storage/testdata"
}

inputs = {
    ami           = "ami-xxx"
    instance_type = "t3a.micro"

    ebs_volume_attachments = [
        {
            device_name ="/dev/xvdb"
            volume_id = dependency.testdata_storage.outputs.id
        }
    ]

    ...
}

Breaking Changes

no

How Has This Been Tested?

  • [x] I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • [ ] I have tested and validated these changes using one or more of the provided examples/* projects
  • [ ] I have executed pre-commit run -a on my pull request

tiagomlalves avatar Aug 25 '22 11:08 tiagomlalves

Hi, this is just a first attempt showing the changes I proposed in https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/issues/276 Looking forward for feedback about if this is the right approach or not for simplifying Terragrunt configurations.

tiagomlalves avatar Aug 25 '22 11:08 tiagomlalves

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

github-actions[bot] avatar Sep 25 '22 00:09 github-actions[bot]

This PR was automatically closed because of stale in 10 days

github-actions[bot] avatar Oct 05 '22 00:10 github-actions[bot]

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Nov 08 '22 02:11 github-actions[bot]