From 40f35ca8f0c0b7e5e75e6459c3a22a0050cac122 Mon Sep 17 00:00:00 2001 From: tjarra Date: Tue, 1 Feb 2022 18:40:59 -0300 Subject: [PATCH 1/2] Add EKS Fargate Profile waiters --- plugins/module_utils/waiters.py | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/plugins/module_utils/waiters.py b/plugins/module_utils/waiters.py index 1d4c3b64af1..8be90525905 100644 --- a/plugins/module_utils/waiters.py +++ b/plugins/module_utils/waiters.py @@ -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" + } + ] } } } @@ -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'), From ac78e19c14316c94629e39f1f787402252f7ffab Mon Sep 17 00:00:00 2001 From: tjarra Date: Wed, 2 Feb 2022 15:28:42 -0300 Subject: [PATCH 2/2] adjusted indentation --- plugins/module_utils/waiters.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/module_utils/waiters.py b/plugins/module_utils/waiters.py index 8be90525905..a5c0add9531 100644 --- a/plugins/module_utils/waiters.py +++ b/plugins/module_utils/waiters.py @@ -497,7 +497,7 @@ { "state": "retry", "matcher": "error", - "expected" : "ResourceNotFoundException" + "expected": "ResourceNotFoundException" } ] }, @@ -515,7 +515,7 @@ { "state": "success", "matcher": "error", - "expected" : "ResourceNotFoundException" + "expected": "ResourceNotFoundException" } ] } @@ -910,16 +910,16 @@ def route53_model(name): 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 + '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 + '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',