From c0418a91cfcf7edafaaf6680314d534a9d0cb96e Mon Sep 17 00:00:00 2001 From: walrus Date: Thu, 11 Dec 2014 17:26:35 -0800 Subject: [PATCH] Recognize `encrypted` keyword for ec2 volumes - added for both `create_volume()` and `create_attach_volumes()` - requires EC2 API version `2014-10-01` - announcment: - https://aws.amazon.com/about-aws/whats-new/2014/05/21/Amazon-EBS-encryption-now-available/ --- salt/cloud/clouds/ec2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index df462a4fe5..1a6520c15e 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -2302,6 +2302,8 @@ def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): volume_dict['type'] = volume['type'] if 'iops' in volume: volume_dict['iops'] = volume['iops'] + if 'encrypted' in volume: + volume_dict['encrypted'] = volume['encrypted'] if 'volume_id' not in volume_dict: created_volume = create_volume(volume_dict, call='function', wait_to_finish=wait_to_finish) @@ -3336,6 +3338,9 @@ def create_volume(kwargs=None, call=None, wait_to_finish=False): if 'iops' in kwargs and kwargs.get('type', 'standard') == 'io1': params['Iops'] = kwargs['iops'] + if 'encrypted' in kwargs: + params['Encrypted'] = kwargs['encrypted'] + log.debug(params) data = aws.query(params,