Skip to content

Commit

Permalink
Add eks_nodegroup waiters (#975)
Browse files Browse the repository at this point in the history
Add eks_nodegroup waiters

SUMMARY
Add waiters for eks_nodegroup module to manage deleted and created states.
PR eks_nodegroup: ansible-collections/community.aws#1415
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
waiter.py

Reviewed-by: Alina Buzachis <None>
  • Loading branch information
tjarra authored Sep 6, 2022
1 parent 3fed62e commit 93f8ce1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/975-waiters-eks_nodegroup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- module_utils/waiters - Add waiters to manage eks_nodegroup module (https://github.com/ansible-collections/community.aws/pull/1415).
48 changes: 48 additions & 0 deletions plugins/module_utils/waiters.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,42 @@
"expected": "ResourceNotFoundException"
}
]
},
"NodegroupActive": {
"delay": 20,
"maxAttempts": 60,
"operation": "DescribeNodegroup",
"acceptors": [
{
"state": "success",
"matcher": "path",
"argument": "nodegroup.status",
"expected": "ACTIVE"
},
{
"state": "retry",
"matcher": "error",
"expected": "ResourceNotFoundException"
}
]
},
"NodegroupDeleted": {
"delay": 20,
"maxAttempts": 60,
"operation": "DescribeNodegroup",
"acceptors": [
{
"state": "retry",
"matcher": "path",
"argument": "nodegroup.status == 'DELETING'",
"expected": True
},
{
"state": "success",
"matcher": "error",
"expected": "ResourceNotFoundException"
}
]
}
}
}
Expand Down Expand Up @@ -1108,6 +1144,18 @@ def route53_model(name):
core_waiter.NormalizedOperationMethod(
eks.describe_fargate_profile
)),
('EKS', 'nodegroup_active'): lambda eks: core_waiter.Waiter(
'nodegroup_active',
eks_model('NodegroupActive'),
core_waiter.NormalizedOperationMethod(
eks.describe_nodegroup
)),
('EKS', 'nodegroup_deleted'): lambda eks: core_waiter.Waiter(
'nodegroup_deleted',
eks_model('NodegroupDeleted'),
core_waiter.NormalizedOperationMethod(
eks.describe_nodegroup
)),
('ElasticLoadBalancing', 'any_instance_in_service'): lambda elb: core_waiter.Waiter(
'any_instance_in_service',
elb_model('AnyInstanceInService'),
Expand Down

0 comments on commit 93f8ce1

Please sign in to comment.