Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Increase Default Root Device from AWS Launch Template #4774

Closed
asafpelegcodes opened this issue Jun 7, 2018 · 7 comments · Fixed by #5632
Closed

Unable to Increase Default Root Device from AWS Launch Template #4774

asafpelegcodes opened this issue Jun 7, 2018 · 7 comments · Fixed by #5632
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@asafpelegcodes
Copy link

Terraform v0.11.7
+ provider.aws v1.22.0

I'm testing out creating Launch Templates with aws_launch_template and I'm unable to reproduce a result that I achieved manually through the GUI. Using the GUI I was able to override the default block device for the AMI listed below (see describe image) and give it a larger volume. The GUI shows "Default" for this (see image).

screen shot 2018-06-07 at 10 44 39 am

However, when I try & recreate the same thing with terraform it doesn't seem to be possible because even if I omit delete_on_termination & encrypted terraform provides default values for this. When I create a spot request I get errors from the console saying the encrypted flag cannot be specified since device /dev/xvda has a snapshot specified.

aws ec2 describe-images --image-ids ami-04351e12

Here is the sample terraform config I am working with.

resource "aws_launch_template" "ecs-cluster-default" {
...

  block_device_mappings {
    device_name = "/dev/xvda"
    ebs {
      volume_size = 10
      volume_type = "gp2"
      delete_on_termination = "true"
      encrypted = "false"
    }
  }

  image_id = "ami-04351e12"
}

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Expected Behavior

I should be able to omit encrypted & delete_on_termination from the block/ebs block and terraform will omit the values to the API and AWS will use Defaults for these blocks.

Actual Behavior

Terraform forces the value when it's omitted to a default value it has stored internally resulting in being unable to overwrite the root device.

@radeksimko radeksimko added bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jun 13, 2018
@cosmopetrich
Copy link

This appears to be a duplicate of #4553.

@asafpelegcodes
Copy link
Author

I agree looks similar

@bflad
Copy link
Contributor

bflad commented Aug 21, 2018

Bug fix pull request submitted: #5632

@bflad bflad added this to the v1.34.0 milestone Aug 30, 2018
@bflad
Copy link
Contributor

bflad commented Aug 30, 2018

The fix for this has been merged into master and will release with version 1.34.0 of the AWS provider, likely later today.

@bflad
Copy link
Contributor

bflad commented Aug 30, 2018

This has been released in version 1.34.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@asafpelegcodes
Copy link
Author

@bflad thanks!

@ghost
Copy link

ghost commented Apr 3, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
4 participants