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

Invalid Parameter for Block device with Snapshot ID -- Terraform v0.5.0 #1862

Closed
randylyon opened this issue May 8, 2015 · 11 comments · Fixed by #2120
Closed

Invalid Parameter for Block device with Snapshot ID -- Terraform v0.5.0 #1862

randylyon opened this issue May 8, 2015 · 11 comments · Fixed by #2120

Comments

@randylyon
Copy link

Receiving this error when using Terraform 0.5.0 with a block device specifying a snapshot. I get this error if I add encryption = false or don't have encryption defined at all.

  • Error launching source instance: InvalidParameter: Parameter encrypted is invalid. You cannot specify the encrypted flag if specifying a snapshot id in a block device mapping.

Instance defined as:

resource "aws_instance" "test" {
    ami = "${var.instance_ami}"
    instance_type = "t2.medium"
    key_name = "REDACTED"
    availability_zone = "us-east-1a"
    user_data = "${file(\"userData.txt\")}"
    tags {
        Name = "test"
    }
    associate_public_ip_address = true
    security_groups = ["Web-Application-Default"]
    ebs_block_device {
      device_name  = "/dev/sdf"
      volume_size = 10
      volume_type = "gp2"
      delete_on_termination = true
      snapshot_id = "REDACTED"
    }
    root_block_device {
      delete_on_termination = true
      volume_size = 20
      volume_type = "gp2"
    }
}
@phinze
Copy link
Contributor

phinze commented May 8, 2015

Thanks for the report!

You'd think that the API would be cool with encrypted: false wouldn't you? But nope, it needs nil. 😐

We'll get this fixed up.

@egarbi
Copy link
Contributor

egarbi commented May 15, 2015

+1 for this one, it happened me today when I was trying to build a new "graphite" instance.

@amaczuga
Copy link

+1, occurs to me too. worked around by continuing apply with v0.4.2... (a disgusting way to do things)

@wkielas
Copy link

wkielas commented May 22, 2015

+1 from me, this effectively prevents from modifying root EBS volumes on instances

@netors
Copy link

netors commented May 24, 2015

+1 this happens to me if I try to use a snapshot of an encrypted volume

@phinze phinze self-assigned this May 26, 2015
@sathiyas
Copy link
Contributor

+1 from me, this effectively prevents from modifying root EBS volumes on instances

@catsby
Copy link
Contributor

catsby commented May 28, 2015

Patch for this in #2120

@catsby
Copy link
Contributor

catsby commented May 28, 2015

If anyone can build master and try #2120 out that would help me merge with confidence 😄

I took @randylyon config and was able to get through as expected, but other validation is always welcome

@armen
Copy link

armen commented May 29, 2015

I was going to send a patch for this and interestingly my patch is exactly same as yours, so I do confirm this works.

@phinze phinze removed their assignment May 29, 2015
@catsby
Copy link
Contributor

catsby commented May 29, 2015

Closed by merging #2120 , let me know if this comes up again

@ghost
Copy link

ghost commented May 2, 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 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.

@ghost ghost locked and limited conversation to collaborators May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants