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) (#2422)

This is a backport of PR #2418 as merged into main (b9a5127).
SUMMARY

Closes #1872

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_vpc_nat_gateway

Reviewed-by: Bikouo Aubin
  • Loading branch information
patchback[bot] authored Dec 13, 2024
1 parent 90dff60 commit e0ab101
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 e0ab101

Please sign in to comment.