Skip to content

create_transit_gateway_route_table_attachment async

create_transit_gateway_route_table_attachment(
    peering_id: PeeringId,
    transit_gateway_route_table_arn: TransitGatewayRouteTableArn,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    routing_policy_label: Optional[ConstrainedString] = None,
    tags: Optional[TagList] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateTransitGatewayRouteTableAttachmentResponse

Creates a transit gateway route table attachment.

Parameters:

  • peering_id (PeeringId) –

    The ID of the peer for the

  • transit_gateway_route_table_arn (TransitGatewayRouteTableArn) –

    The ARN of the transit gateway route table for the attachment request. For example, "TransitGatewayRouteTableArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway-route-table/tgw-rtb-9876543210123456".

  • routing_policy_label (Optional[ConstrainedString], default: None ) –

    The routing policy label to apply to the Transit Gateway route table attachment for traffic routing decisions.

  • tags (Optional[TagList], default: None ) –

    The list of key-value tags associated with the request.

  • client_token (Optional[ClientToken], default: None ) –

    The client token associated with the request.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def create_transit_gateway_route_table_attachment(
    self,
    peering_id: "capo_networkmanager.types.peering_id.PeeringId",
    transit_gateway_route_table_arn: "capo_networkmanager.types.transit_gateway_route_table_arn.TransitGatewayRouteTableArn",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    routing_policy_label: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    tags: Optional["capo_networkmanager.types.tag_list.TagList"] = None,
    client_token: Optional[
        "capo_networkmanager.types.client_token.ClientToken"
    ] = None,
) -> "capo_networkmanager.types.create_transit_gateway_route_table_attachment_response.CreateTransitGatewayRouteTableAttachmentResponse":
    """<p>Creates a transit gateway route table attachment.</p>

    Args:
        peering_id: <p>The ID of the peer for the </p>
        transit_gateway_route_table_arn: <p>The ARN of the transit gateway route table for the attachment request. For example, <code>"TransitGatewayRouteTableArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway-route-table/tgw-rtb-9876543210123456"</code>.</p>
        routing_policy_label: <p>The routing policy label to apply to the Transit Gateway route table attachment for traffic routing decisions.</p>
        tags: <p>The list of key-value tags associated with the request.</p>
        client_token: <p>The client token associated with the request.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.create_transit_gateway_route_table_attachment_request.CreateTransitGatewayRouteTableAttachmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.create_transit_gateway_route_table_attachment_response.CreateTransitGatewayRouteTableAttachmentResponse"
    ]:
        import capo_networkmanager._operations.network_manager.create_transit_gateway_route_table_attachment

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.create_transit_gateway_route_table_attachment.async_create_transit_gateway_route_table_attachment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateTransitGatewayRouteTableAttachment"),
    )
    input_: capo_networkmanager.types.create_transit_gateway_route_table_attachment_request.CreateTransitGatewayRouteTableAttachmentRequest = {
        "peering_id": peering_id,
        "transit_gateway_route_table_arn": transit_gateway_route_table_arn,
    }
    if routing_policy_label is not None:
        input_["routing_policy_label"] = routing_policy_label
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output