Skip to content

create_site_to_site_vpn_attachment async

create_site_to_site_vpn_attachment(
    core_network_id: CoreNetworkId,
    vpn_connection_arn: VpnConnectionArn,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    routing_policy_label: Optional[ConstrainedString] = None,
    nat_gateway_support: Optional[NatGatewaySupportValue] = None,
    nat_system_route_support: Optional[BoxedBoolean] = None,
    nat_gateway_rules: Optional[NatRuleRequestList] = None,
    tags: Optional[TagList] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateSiteToSiteVpnAttachmentResponse

Creates an Amazon Web Services site-to-site VPN attachment on an edge location of a core network.

Parameters:

  • core_network_id (CoreNetworkId) –

    The ID of a core network where you're creating a site-to-site VPN attachment.

  • vpn_connection_arn (VpnConnectionArn) –

    The ARN identifying the VPN attachment.

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

    The routing policy label to apply to the Site-to-Site VPN attachment for traffic routing decisions.

  • nat_gateway_support (Optional[NatGatewaySupportValue], default: None ) –

    Specifies whether to enable NAT gateway support on the Site-to-Site VPN attachment. To enable NAT gateway support, you must also specify at least one NAT rule. If you don't specify a value, NAT gateway support is disabled. Only the core network owner can configure NAT on an attachment.

  • nat_system_route_support (Optional[BoxedBoolean], default: None ) –

    Specifies whether the core network installs system routes for the NAT CIDR blocks of the attachment's NAT rules. System routes have a route type of SYSTEM. NAT is applied to traffic whether or not this option is enabled. The default is true for VPN connections that use BGP and false for VPN connections that use static routing. If the VPN connection uses static routing, you must specify false or omit this parameter.

  • nat_gateway_rules (Optional[NatRuleRequestList], default: None ) –

    The NAT rules for the Site-to-Site VPN attachment, up to 50 rules.

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

    The 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_site_to_site_vpn_attachment(
    self,
    core_network_id: "capo_networkmanager.types.core_network_id.CoreNetworkId",
    vpn_connection_arn: "capo_networkmanager.types.vpn_connection_arn.VpnConnectionArn",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    routing_policy_label: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    nat_gateway_support: Optional[
        "capo_networkmanager.types.nat_gateway_support_value.NatGatewaySupportValue"
    ] = None,
    nat_system_route_support: Optional[
        "capo_networkmanager.types.boxed_boolean.BoxedBoolean"
    ] = None,
    nat_gateway_rules: Optional[
        "capo_networkmanager.types.nat_rule_request_list.NatRuleRequestList"
    ] = None,
    tags: Optional["capo_networkmanager.types.tag_list.TagList"] = None,
    client_token: Optional[
        "capo_networkmanager.types.client_token.ClientToken"
    ] = None,
) -> "capo_networkmanager.types.create_site_to_site_vpn_attachment_response.CreateSiteToSiteVpnAttachmentResponse":
    """<p>Creates an Amazon Web Services site-to-site VPN attachment on an edge location of a core network.</p>

    Args:
        core_network_id: <p>The ID of a core network where you're creating a site-to-site VPN attachment.</p>
        vpn_connection_arn: <p>The ARN identifying the VPN attachment.</p>
        routing_policy_label: <p>The routing policy label to apply to the Site-to-Site VPN attachment for traffic routing decisions.</p>
        nat_gateway_support: <p>Specifies whether to enable NAT gateway support on the Site-to-Site VPN attachment. To enable NAT gateway support, you must also specify at least one NAT rule. If you don't specify a value, NAT gateway support is disabled. Only the core network owner can configure NAT on an attachment.</p>
        nat_system_route_support: <p>Specifies whether the core network installs system routes for the NAT CIDR blocks of the attachment's NAT rules. System routes have a route type of <code>SYSTEM</code>. NAT is applied to traffic whether or not this option is enabled. The default is <code>true</code> for VPN connections that use BGP and <code>false</code> for VPN connections that use static routing. If the VPN connection uses static routing, you must specify <code>false</code> or omit this parameter.</p>
        nat_gateway_rules: <p>The NAT rules for the Site-to-Site VPN attachment, up to 50 rules.</p>
        tags: <p>The 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_site_to_site_vpn_attachment_request.CreateSiteToSiteVpnAttachmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.create_site_to_site_vpn_attachment_response.CreateSiteToSiteVpnAttachmentResponse"
    ]:
        import capo_networkmanager._operations.network_manager.create_site_to_site_vpn_attachment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSiteToSiteVpnAttachment")
    )
    input_: capo_networkmanager.types.create_site_to_site_vpn_attachment_request.CreateSiteToSiteVpnAttachmentRequest = {
        "core_network_id": core_network_id,
        "vpn_connection_arn": vpn_connection_arn,
    }
    if routing_policy_label is not None:
        input_["routing_policy_label"] = routing_policy_label
    if nat_gateway_support is not None:
        input_["nat_gateway_support"] = nat_gateway_support
    if nat_system_route_support is not None:
        input_["nat_system_route_support"] = nat_system_route_support
    if nat_gateway_rules is not None:
        input_["nat_gateway_rules"] = nat_gateway_rules
    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