-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support encrypted
option
#6
Comments
@tehmaspc The following works for me:
|
@2solt - awesome! But I'm looking for the main root volume being encrypted as well. I'll update the issue to be more clear. Thanks man! |
@tehmaspc , it looks like Terraform doesn't support encrypting the root volume at a resource level (https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_instance.go#L390).
|
The way I have done this before is to use aws_ami_copy. Sample below
Could this be added to the module? |
@robglarsen what exactly do you want to have in the module? Your solution is good, but to my mind, it should not be a part of this module. |
Not sure I guess you could have a setting to do this, or if you didn't want it in the module then just something in the docs on how to achieve an encrypted AMI ? |
I like the idea to document it in a readme file very much. Could you send a PR? |
Of course PR #34 |
Same need here, we'd like to have root device encrypted, which is supported in AWS, but terraform doesn't let us handle it. Thanks |
Also need it on terraform side |
Need this too. But (jet) Amazon does not support launching new Instances from unencrypted AMIs encrypted with an CMK :( Update: Images with EC2 BillingProduct codes cannot be copied to another AWS account, so this workaround does not work for Windows AMIs :( |
Definitely important. |
+1 |
Important one. +1 |
+1 |
+1 |
1 similar comment
+1 |
@robglarsen , could you provide a example of how to use above to launch a EC2 and set the subnet/etc/tags? here is how i currently was launching EC2's, (fails when the root is encrypted) resource "aws_instance" "example" { user_data = <<-EOF } |
+1 for me as well |
+1 for me too! |
+1 for me |
The problem with aws_ami_copy scenario is the fact that you can't copy images from the marketplace. It errors out with:
I was trying to use the Centos Image from the marketplace and even though the ami from marketplace doesn't cost anything, you can't copy it to your account and make it encrypted. |
@nunofernandes i copy images from marketplace just fine. I assume CentOS requires an agreement before hand? |
@FernandoMiguel Yes, CentOS requires an agreement and it was "signed" :). I'm able to launch instances from that image (without boot volume encryption). It's this (in eu-west-1):
|
i'll try to create a snapshot of it to see if it works |
@nunofernandes |
yep sounds like not all images can be copied |
+1 for this as well, with the ability to do so from marketplace images |
+1 for ability to specify key to encrypt volumes. Various security policies require unique (non-shared) keys (not owned / created automagically by AWS).
|
+1 |
This new feature could (untested so far) also help: https://aws.amazon.com/about-aws/whats-new/2019/05/with-a-single-setting-you-can-encrypt-all-new-amazon-ebs-volumes/ It defines a policy (by region) that all new EBS volumes are encrypted by default.. |
As of version 2.23.0 of the aws provider the aws_instance resource now supports encrypted and kms_key_id as arguments to the root_block_device configuration block. Additionally, kms_key_id has been added as an argument to ebs_block_device configuration block as it already supported encrypted previously. |
Thanks to @walbalooshi and the rest! v2.7.0 has been released with support for root and EBS volumes encryption. Note that this will only work in Terraform 0.12 and Terraform AWS provider starting from version 2.23.0 (see relevant changelog). |
…erraform-aws-modules#124) * Add encrypted and kms_key_id arguments to the ebs_* and root_* block device configuration blocks This commit resolves terraform-aws-modules#6 * Updated example to include volume encryption settings
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. |
Need support for root EBS Encrypted devices: https://www.terraform.io/docs/providers/aws/r/instance.html#encrypted
The text was updated successfully, but these errors were encountered: