Skip to content

Commit

Permalink
Add EKS Fargate Profile waiters (ansible-collections#651)
Browse files Browse the repository at this point in the history
Add EKS Fargate Profile waiters

SUMMARY
Add waiters for eks fargate profile to manage deleted and created states.
A PR will be done in community.aws to add a new module to manage the eks_fargate_profile resource that uses these waiters.
New module PR: ansible-collections/community.aws#942
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
waiter.py

Reviewed-by: Jill R <None>
  • Loading branch information
tjarra authored Feb 22, 2022
1 parent 395b730 commit 35c27b8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions plugins/module_utils/waiters.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,42 @@
"expected": "ResourceNotFoundException"
}
]
},
"FargateProfileActive": {
"delay": 20,
"maxAttempts": 30,
"operation": "DescribeFargateProfile",
"acceptors": [
{
"state": "success",
"matcher": "path",
"argument": "fargateProfile.status",
"expected": "ACTIVE"
},
{
"state": "retry",
"matcher": "error",
"expected": "ResourceNotFoundException"
}
]
},
"FargateProfileDeleted": {
"delay": 20,
"maxAttempts": 30,
"operation": "DescribeFargateProfile",
"acceptors": [
{
"state": "retry",
"matcher": "path",
"argument": "fargateProfile.status == 'DELETING'",
"expected": True
},
{
"state": "success",
"matcher": "error",
"expected": "ResourceNotFoundException"
}
]
}
}
}
Expand Down Expand Up @@ -873,6 +909,18 @@ def route53_model(name):
core_waiter.NormalizedOperationMethod(
eks.describe_cluster
)),
('EKS', 'fargate_profile_active'): lambda eks: core_waiter.Waiter(
'fargate_profile_active',
eks_model('FargateProfileActive'),
core_waiter.NormalizedOperationMethod(
eks.describe_fargate_profile
)),
('EKS', 'fargate_profile_deleted'): lambda eks: core_waiter.Waiter(
'fargate_profile_deleted',
eks_model('FargateProfileDeleted'),
core_waiter.NormalizedOperationMethod(
eks.describe_fargate_profile
)),
('ElasticLoadBalancing', 'any_instance_in_service'): lambda elb: core_waiter.Waiter(
'any_instance_in_service',
elb_model('AnyInstanceInService'),
Expand Down

0 comments on commit 35c27b8

Please sign in to comment.