diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 40277a660..16200da9d 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1534,7 +1534,7 @@ class VolumeAttachment(object): class Volume(TaggedEC2Resource): - def __init__(self, ec2_backend, volume_id, size, zone, snapshot_id=None): + def __init__(self, ec2_backend, volume_id, size, zone, snapshot_id=None, encrypted=False): self.id = volume_id self.size = size self.zone = zone @@ -1542,6 +1542,7 @@ class Volume(TaggedEC2Resource): self.attachment = None self.snapshot_id = snapshot_id self.ec2_backend = ec2_backend + self.encrypted = encrypted @classmethod def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name): @@ -1591,6 +1592,9 @@ class Volume(TaggedEC2Resource): if filter_name == 'volume-id': return self.id + if filter_name == 'encrypted': + return str(self.encrypted).lower() + filter_value = super(Volume, self).get_filter_value(filter_name) if filter_value is None: