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
  • Loading branch information
abikouo committed Dec 9, 2024
1 parent a2e2740 commit 38b0eb3
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 38b0eb3

Please sign in to comment.