diff options
Diffstat (limited to 'boto/ec2/blockdevicemapping.py')
-rw-r--r-- | boto/ec2/blockdevicemapping.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/boto/ec2/blockdevicemapping.py b/boto/ec2/blockdevicemapping.py index 65ffbb1d..2f4e1faf 100644 --- a/boto/ec2/blockdevicemapping.py +++ b/boto/ec2/blockdevicemapping.py @@ -38,7 +38,8 @@ class BlockDeviceType(object): delete_on_termination=False, size=None, volume_type=None, - iops=None): + iops=None, + encrypted=None): self.connection = connection self.ephemeral_name = ephemeral_name self.no_device = no_device @@ -50,6 +51,7 @@ class BlockDeviceType(object): self.size = size self.volume_type = volume_type self.iops = iops + self.encrypted = encrypted def startElement(self, name, attrs, connection): pass @@ -76,6 +78,8 @@ class BlockDeviceType(object): self.volume_type = value elif lname == 'iops': self.iops = int(value) + elif lname == 'encrypted': + self.encrypted = (value == 'true') else: setattr(self, name, value) @@ -150,4 +154,12 @@ class BlockDeviceMapping(dict): params['%s.Ebs.VolumeType' % pre] = block_dev.volume_type if block_dev.iops is not None: params['%s.Ebs.Iops' % pre] = block_dev.iops + # The encrypted flag (even if False) cannot be specified for the root EBS + # volume. + if block_dev.encrypted is not None: + if block_dev.encrypted: + params['%s.Ebs.Encrypted' % pre] = 'true' + else: + params['%s.Ebs.Encrypted' % pre] = 'false' + i += 1 |