Skip to content

Commit

Permalink
Add waiters for RDS cluster (#464)
Browse files Browse the repository at this point in the history
Add waiters for RDS cluster

SUMMARY

Add waiters for RDS cluster (cluster_available and cluster_deleted) required by ansible-collections/community.aws#687

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

waiters.py
Depends-On: ansible/ansible-zuul-jobs#1062

Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>
  • Loading branch information
alinabuzachis authored Aug 16, 2021
1 parent c9270e7 commit 4b9f9f7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/464-rds_cluster-waiter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- module_utils/waiter - add RDS cluster ``cluster_available`` waiter (https://github.com/ansible-collections/amazon.aws/pull/464).
- module_utils/waiter - add RDS cluster ``cluster_deleted`` waiter (https://github.com/ansible-collections/amazon.aws/pull/464).
50 changes: 49 additions & 1 deletion plugins/module_utils/waiters.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,43 @@
"expected": "stopped"
},
]
}
},
"DBClusterAvailable": {
"delay": 20,
"maxAttempts": 60,
"operation": "DescribeDBClusters",
"acceptors": [
{
"state": "success",
"matcher": "pathAll",
"argument": "DBClusters[].Status",
"expected": "available"
},
{
"state": "retry",
"matcher": "error",
"expected": "DBClusterNotFoundFault"
}
]
},
"DBClusterDeleted": {
"delay": 20,
"maxAttempts": 60,
"operation": "DescribeDBClusters",
"acceptors": [
{
"state": "success",
"matcher": "pathAll",
"argument": "DBClusters[].Status",
"expected": "stopped"
},
{
"state": "success",
"matcher": "error",
"expected": "DBClusterNotFoundFault"
}
]
},
}
}

Expand Down Expand Up @@ -715,6 +751,18 @@ def route53_model(name):
core_waiter.NormalizedOperationMethod(
rds.describe_db_instances
)),
('RDS', 'cluster_available'): lambda rds: core_waiter.Waiter(
'cluster_available',
rds_model('DBClusterAvailable'),
core_waiter.NormalizedOperationMethod(
rds.describe_db_clusters
)),
('RDS', 'cluster_deleted'): lambda rds: core_waiter.Waiter(
'cluster_deleted',
rds_model('DBClusterDeleted'),
core_waiter.NormalizedOperationMethod(
rds.describe_db_clusters
)),
('Route53', 'resource_record_sets_changed'): lambda route53: core_waiter.Waiter(
'resource_record_sets_changed',
route53_model('ResourceRecordSetsChanged'),
Expand Down

0 comments on commit 4b9f9f7

Please sign in to comment.