-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Encrypted flag cannot be specified since device /dev/sda1 has a snapshot specified #4553
Encrypted flag cannot be specified since device /dev/sda1 has a snapshot specified #4553
Comments
I'm getting the same thing along with #4570 |
Same thing. You guys are faster at submitting the bug report :) |
I have it unset in the console and I still got the error Failed to create Auto Scaling group Either an issue with AWS or something in the background I'm not seeing... |
The issue is, when creating a launch template from AWS there is an option "Do not include in template" for encrypted flag, but when creating launch template with terraform there is no way to set this option. It defaults to "false". |
Facing the same issue. Removing the |
Same problem here. I tried:
but I get the same results. No problem with not root devices. |
AWS does not allow setting encryption values on ebs block devices created from a snapshot. This patch lists block devices created from snapshots from the image and skips the encryption flag on those devices. [Fixes hashicorp#4553]
Anyone has a work around until this is merged? |
@yardensachs We kept using good old AWS https://www.terraform.io/docs/providers/aws/r/launch_configuration.html |
I tried patching the provider myself to see what was happening. I attached the patch: dont_send_encrypted.txt However, even when not setting the "encrypted" flag, it still is getting set. I wonder if it has to do with the aws golang SDK. I should note that if I create the resource manually, import it into my state, terraform doesn't see any changes with the encrypted flag missing. If I then modify the volume_size, it detects that as the only change, but the new launch template version has "encrypted" set to "no". |
I ran into the same issue and the following workaround process did the trick :
You will see that terraform does not complain about the encryption flag difference on your already created template. Please note that evreytime you update the launch template with terraform, the same manual trick will be needed in the aws console. |
@bflad @terraformbot @tf-release-bot Facing the same issue. Removing the block_device_mappings argument fixed it (but I can no longer tweak the root volume size). Hope this issue can be fixed ASAP |
I'm facing exactly the same issue. Generated LaunchTemplateData field contains Encrypted field in BlockDeviceMappings/EBS section even if encrypted param wasn't added and snapshot_id was. It makes launch templates provisioned by terraform unusable. terraform 0.11.7 Please advise if there is an option to downgrade provider.aws version, I wasn't able to find any notes on when the bug was introduced, but I suppose there should be version w/o bug since documentation of terraform clearly describe that ecrypted param cannot be used along with snapshot_id param. |
Same here. Also same: Removing the block_device_mappings argument fixed it (but I can no longer tweak the root volume size). |
Hit the same problem today with the workaround mentioned above; editing the launch template in AWS Console then continue with Terraform. |
This must get fixed, in order to use |
I ran into this issue and came across this when searching for the error code BUT I was using AWS CLI; not Terraform. So this issue is really an issue with AWS API itself; in AWS CLI I was able to resolved it by removing the encrypted field altogether. In Terraform it would probably require some code change so that it does not always set encrypted field by default. |
I have had to go back to launch configurations which is not desired, but unfortunately necessary. this is a pretty big deal and is hampering our usage of launch templates. any prioritization for fixing this would be greatly appreciated. |
Ok so I found a way to complete this automatically, although its very hacky. I figured out the issue here is because terraform auto defaults the encryption if you dont pass an option in, which it shouldnt. if you use the aws cli to create a new template version, and overwrite the ebs volume options with no encryption passed in, the correct option will be put into the template and will allow you to spin up instance. So to solve this automatically, I added a local-exec to my launch template that will run the aws command, update the ebs volume with the same name and not pass in the encryption method, and now it works.
The sleep 10 was to fix an issues with the id interpolation that I think I found with this resource type. You could probably just remove the ebs block inside the terraform template and just use the aws cli to update the created template with the block if you wanted. |
Bug fix pull request submitted: #5632 |
…corp/terraform-provider-aws#4553 to be fixed & then do a cleaner implementation. To make this work, I have to do: terraform apply -target aws_iam_instance_profile.instance_profile -var-file inputs modules/vault-cluster/ terraform apply -var-file inputs modules/vault-cluster/
The fix for this has been merged into master and will release with version 1.34.0 of the AWS provider, likely later today. |
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. |
Terraform v0.11.8
Still seeing this issue after setting encrypted=true in the launch template. |
provider.aws v1.38.0 |
PR submitted: hashicorp/terraform-aws-vault#97 |
Seems above PR has been hold for a while. When can we get it merged? We are in terraform 0.12.x now. Hope the fix can work in 0.12 directly. |
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! |
This issue was originally opened by @jayudhandha as hashicorp/terraform#18059. It was migrated here as a result of the provider split. The original body of the issue is below.
Hi,
I am migrating my Autoscaling groups to use launch_template instead of launch_configuration. (To support T2 Unlimited)
Below is my code snippet.
While running
terraform apply
I am getting below error.May be any parameter is missing but i am not sure which one.
As per error, It looks that encrypted parameter is specified. But i haven't passed that. Then why this error is coming?
Thanks in advance!
The text was updated successfully, but these errors were encountered: