Skip to content

Commit

Permalink
Modify upon review
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Oct 14, 2024
1 parent e514e64 commit 3554094
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions plugins/module_utils/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ def _is_missing(cls):

@EC2TransitGatewayVPCAttachmentErrorHandler.common_error_handler("describe transit gateway attachments")
@AWSRetry.jittered_backoff()
def describe_vpc_attachments(
def describe_transit_gateway_vpc_attachments(
client, **params: Dict[str, Union[List[str], bool, List[Dict[str, Union[str, List[str]]]]]]
) -> List:
paginator = client.get_paginator("describe_transit_gateway_vpc_attachments")
Expand All @@ -1393,29 +1393,27 @@ def describe_vpc_attachments(

@EC2TransitGatewayVPCAttachmentErrorHandler.common_error_handler("create transit gateway vpc attachment")
@AWSRetry.jittered_backoff()
def create_vpc_attachment(
def create_transit_gateway_vpc_attachment(
client, **params: Dict[str, Union[List[str], bool, List[Dict[str, Union[str, List[str]]]]]]
) -> Optional[Dict[str, Any]]:
result = client.create_transit_gateway_vpc_attachment(**params)
return result.get("TransitGatewayVpcAttachment", None)
) -> Dict[str, Any]:
return client.create_transit_gateway_vpc_attachment(**params)["TransitGatewayVpcAttachment"]


@EC2TransitGatewayVPCAttachmentErrorHandler.common_error_handler("modify transit gateway vpc attachment")
@AWSRetry.jittered_backoff()
def modify_vpc_attachment(
def modify_transit_gateway_vpc_attachment(
client, **params: Dict[str, Union[List[str], bool, List[Dict[str, Union[str, List[str]]]]]]
) -> Optional[Dict[str, Any]]:
result = client.modify_transit_gateway_vpc_attachment(**params)
return result.get("TransitGatewayVpcAttachment", None)
) -> Dict[str, Any]:
return client.modify_transit_gateway_vpc_attachment(**params)["TransitGatewayVpcAttachment"]


@EC2TransitGatewayVPCAttachmentErrorHandler.deletion_error_handler("delete transit gateway vpc attachment")
@AWSRetry.jittered_backoff()
def delete_vpc_attachment(
client, **params: Dict[str, Union[List[str], bool, List[Dict[str, Union[str, List[str]]]]]]
) -> Optional[Dict[str, Any]]:
result = client.delete_transit_gateway_vpc_attachment(**params)
return result.get("TransitGatewayVpcAttachment", None)
def delete_transit_gateway_vpc_attachment(client, transit_gateway_attachment_id: str) -> bool:
client.delete_transit_gateway_vpc_attachment(TransitGatewayAttachmentId=transit_gateway_attachment_id)[
"TransitGatewayVpcAttachment"
]
return True


def add_ec2_tags(client, module, resource_id, tags_to_set, retry_codes=None):
Expand Down

0 comments on commit 3554094

Please sign in to comment.