From 2c90ddd44d73e7fdcfe5f43b67069c7e1c671794 Mon Sep 17 00:00:00 2001 From: Stuart Pittaway Date: Thu, 8 Aug 2019 00:38:17 +0100 Subject: [PATCH] Allow encryption of volumes based off snapshots (#58983) Since May 10, 2019 AWS have allowed encrypted volumes to be created from snapshots. BOTO3 allows this, but the EC2 module does not. This change removes the restriction. https://aws.amazon.com/about-aws/whats-new/2019/05/launch-encrypted-ebs-backed-ec2-instances-from-unencrypted-amis-in-a-single-step/ --- lib/ansible/modules/cloud/amazon/ec2.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index 238209d5eb8..918918b5871 100644 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -800,8 +800,6 @@ def create_block_device(module, ec2, volume): size = volume.get('volume_size', snapshot.volume_size) if int(volume['iops']) > MAX_IOPS_TO_SIZE_RATIO * size: module.fail_json(msg='IOPS must be at most %d times greater than size' % MAX_IOPS_TO_SIZE_RATIO) - if 'encrypted' in volume: - module.fail_json(msg='You can not set encryption when creating a volume from a snapshot') if 'ephemeral' in volume: if 'snapshot' in volume: module.fail_json(msg='Cannot set both ephemeral and snapshot')