Skip to content

Commit

Permalink
ec2_snapshot - boto3 migration (ansible-collections#356)
Browse files Browse the repository at this point in the history
ec2_snapshot - boto3 migration

Reviewed-by: Mark Chappell
             https://github.com/tremble
  • Loading branch information
tremble authored May 5, 2021
1 parent c9d7890 commit b7087f4
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 123 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/356-ec2_snapshot-boto3-migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
minor_changes:
- ec2_snapshot - migrated to use the boto3 python library (https://github.com/ansible-collections/amazon.aws/pull/356).
breaking_changes:
- ec2_snapshot - support for waiting indefinitely has been dropped, new default is 10 minutes (https://github.com/ansible-collections/amazon.aws/pull/356).
19 changes: 19 additions & 0 deletions plugins/module_utils/waiters.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@
},
]
},
"SnapshotCompleted": {
"delay": 15,
"operation": "DescribeSnapshots",
"maxAttempts": 40,
"acceptors": [
{
"expected": "completed",
"matcher": "pathAll",
"state": "success",
"argument": "Snapshots[].State"
}
]
},
"SubnetAvailable": {
"delay": 15,
"operation": "DescribeSubnets",
Expand Down Expand Up @@ -582,6 +595,12 @@ def route53_model(name):
core_waiter.NormalizedOperationMethod(
ec2.describe_security_groups
)),
('EC2', 'snapshot_completed'): lambda ec2: core_waiter.Waiter(
'snapshot_completed',
ec2_model('SnapshotCompleted'),
core_waiter.NormalizedOperationMethod(
ec2.describe_snapshots
)),
('EC2', 'subnet_available'): lambda ec2: core_waiter.Waiter(
'subnet_available',
ec2_model('SubnetAvailable'),
Expand Down
Loading

0 comments on commit b7087f4

Please sign in to comment.