Skip to content

Commit

Permalink
ec2_vpc_nat_gateway - catch extra error code for invalid elastic IP Id (
Browse files Browse the repository at this point in the history
#2418)

SUMMARY

Closes #1872

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_vpc_nat_gateway

Reviewed-by: Alina Buzachis
Reviewed-by: GomathiselviS <[email protected]>
  • Loading branch information
abikouo authored Dec 11, 2024
1 parent da0027d commit b9a5127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- module_utils/ec2 - catch error code ``InvalidElasticIpID.NotFound`` on function ``create_nat_gateway()``, sometimes the ``allocate_address`` API calls will return the ID for a new elastic IP resource before it can be consistently referenced (https://github.com/ansible-collections/amazon.aws/issues/1872).
2 changes: 1 addition & 1 deletion plugins/module_utils/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def delete_nat_gateway(client, nat_gateway_id: str) -> bool:


@EC2NatGatewayErrorHandler.common_error_handler("create nat gateway")
@AWSRetry.jittered_backoff()
@AWSRetry.jittered_backoff(catch_extra_error_codes=["InvalidElasticIpID.NotFound"])
def create_nat_gateway(
client, **params: Dict[str, Union[str, bool, int, EC2TagSpecifications, List[str]]]
) -> Dict[str, Any]:
Expand Down

0 comments on commit b9a5127

Please sign in to comment.