Skip to content

Commit

Permalink
added filter so that only source snapshots in a "completed" status ar…
Browse files Browse the repository at this point in the history
…e targeted for replication
  • Loading branch information
akaczorek committed Mar 9, 2016
1 parent 89ff61d commit 5134e83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lambda/replicate-snapshots/replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def __init__(self):
self.ec2_dest = boto3.resource('ec2', region_name=self.AWS_DEST_REGION)

def get_source_snapshots(self):
filters = [{'Name':'tag-key', 'Values': [self.REPLICATE_TAG]}]
filters = [
{'Name':'tag-key', 'Values': [self.REPLICATE_TAG]},
{'Name': 'status', 'Values': ['completed']}]
snapshots = self.ec2_source.snapshots.filter(Filters=filters)
return snapshots

Expand Down

0 comments on commit 5134e83

Please sign in to comment.