NetworkManager / Client / create_vpc_attachment

create_vpc_attachment

NetworkManager.Client.create_vpc_attachment(**kwargs)

Creates a VPC attachment on an edge location of a core network.

See also: AWS API Documentation

Request Syntax

response = client.create_vpc_attachment(
    CoreNetworkId='string',
    VpcArn='string',
    SubnetArns=[
        'string',
    ],
    Options={
        'Ipv6Support': True|False,
        'ApplianceModeSupport': True|False,
        'DnsSupport': True|False,
        'SecurityGroupReferencingSupport': True|False
    },
    RoutingPolicyLabel='string',
    NatGatewaySupport='ENABLE'|'DISABLE',
    NatGatewayRules=[
        {
            'RuleNumber': 123,
            'MatchSourceCidr': 'string',
            'NatCidr': 'string'
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ClientToken='string'
)
Parameters:
  • CoreNetworkId (string) –

    [REQUIRED]

    The ID of a core network for the VPC attachment.

  • VpcArn (string) –

    [REQUIRED]

    The ARN of the VPC.

  • SubnetArns (list) –

    [REQUIRED]

    The subnet ARN of the VPC attachment.

    • (string) –

  • Options (dict) –

    Options for the VPC attachment.

    • Ipv6Support (boolean) –

      Indicates whether IPv6 is supported.

    • ApplianceModeSupport (boolean) –

      Indicates whether appliance mode is supported. If enabled, traffic flow between a source and destination use the same Availability Zone for the VPC attachment for the lifetime of that flow. The default value is false.

    • DnsSupport (boolean) –

      Indicates whether DNS is supported.

    • SecurityGroupReferencingSupport (boolean) –

      Indicates whether security group referencing is enabled for this VPC attachment. The default is true. However, at the core network policy-level the default is set to false.

  • RoutingPolicyLabel (string) – The routing policy label to apply to the VPC attachment for traffic routing decisions.

  • NatGatewaySupport (string) – Specifies whether to enable NAT gateway support on the VPC 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.

  • NatGatewayRules (list) –

    The NAT rules for the VPC attachment, up to 50 rules.

    • (dict) –

      Describes a NAT rule to configure on an attachment. Source addresses in the source CIDR block of traffic from the attachment are translated to the same host addresses in the NAT CIDR block. Traffic to an address in the NAT CIDR block is translated back to the matching address in the source CIDR block.

      • RuleNumber (integer) – [REQUIRED]

        The rule number, from 1 to 32766. Each rule number must be unique for the attachment.

      • MatchSourceCidr (string) – [REQUIRED]

        The IPv4 CIDR block to match against the source address of traffic from the attachment. The CIDR block can’t overlap with the multicast range (224.0.0.0/4).

      • NatCidr (string) – [REQUIRED]

        The IPv4 CIDR block to translate matching source addresses to. The prefix length must be the same as the prefix length of MatchSourceCidr. The CIDR block must be within a private (RFC 1918) or shared address space (RFC 6598) range. The CIDR blocks of the NAT rules of an attachment can’t overlap with each other.

  • Tags (list) –

    The key-value tags associated with the request.

    • (dict) –

      Describes a tag.

      • Key (string) –

        The tag key.

        Constraints: Maximum length of 128 characters.

      • Value (string) –

        The tag value.

        Constraints: Maximum length of 256 characters.

  • ClientToken (string) –

    The client token associated with the request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'VpcAttachment': {
        'Attachment': {
            'CoreNetworkId': 'string',
            'CoreNetworkArn': 'string',
            'AttachmentId': 'string',
            'OwnerAccountId': 'string',
            'AttachmentType': 'CONNECT'|'SITE_TO_SITE_VPN'|'VPC'|'DIRECT_CONNECT_GATEWAY'|'TRANSIT_GATEWAY_ROUTE_TABLE',
            'State': 'REJECTED'|'PENDING_ATTACHMENT_ACCEPTANCE'|'CREATING'|'FAILED'|'AVAILABLE'|'UPDATING'|'PENDING_NETWORK_UPDATE'|'PENDING_TAG_ACCEPTANCE'|'DELETING',
            'EdgeLocation': 'string',
            'EdgeLocations': [
                'string',
            ],
            'ResourceArn': 'string',
            'AttachmentPolicyRuleNumber': 123,
            'SegmentName': 'string',
            'NetworkFunctionGroupName': 'string',
            'NatGatewaySupport': 'ENABLED'|'ENABLING'|'DISABLED'|'DISABLING'|'PENDING_ATTACHMENT_ACCEPTANCE',
            'NatSystemRouteSupport': True|False,
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'ProposedSegmentChange': {
                'Tags': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'AttachmentPolicyRuleNumber': 123,
                'SegmentName': 'string'
            },
            'ProposedNetworkFunctionGroupChange': {
                'Tags': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'AttachmentPolicyRuleNumber': 123,
                'NetworkFunctionGroupName': 'string'
            },
            'CreatedAt': datetime(2015, 1, 1),
            'UpdatedAt': datetime(2015, 1, 1),
            'LastModificationErrors': [
                {
                    'Code': 'VPC_NOT_FOUND'|'SUBNET_NOT_FOUND'|'SUBNET_DUPLICATED_IN_AVAILABILITY_ZONE'|'SUBNET_NO_FREE_ADDRESSES'|'SUBNET_UNSUPPORTED_AVAILABILITY_ZONE'|'SUBNET_NO_IPV6_CIDRS'|'SECURITY_GROUP_REFERENCING_UNSUPPORTED_AVAILABILITY_ZONE'|'VPN_CONNECTION_NOT_FOUND'|'MAXIMUM_NO_ENCAP_LIMIT_EXCEEDED'|'DIRECT_CONNECT_GATEWAY_NOT_FOUND'|'DIRECT_CONNECT_GATEWAY_EXISTING_ATTACHMENTS'|'DIRECT_CONNECT_GATEWAY_NO_PRIVATE_VIF'|'VPN_EXISTING_ASSOCIATIONS'|'VPN_STATIC_ROUTES_NAT_UNSUPPORTED'|'VPC_UNSUPPORTED_FEATURES'|'DIRECT_CONNECT_GATEWAY_TOPOLOGY_RESTRICTIONS'|'CREATION_FAILED'|'UPDATE_FAILED'|'DELETION_FAILED',
                    'Message': 'string',
                    'ResourceArn': 'string',
                    'RequestId': 'string'
                },
            ]
        },
        'SubnetArns': [
            'string',
        ],
        'Options': {
            'Ipv6Support': True|False,
            'ApplianceModeSupport': True|False,
            'DnsSupport': True|False,
            'SecurityGroupReferencingSupport': True|False
        }
    }
}

Response Structure

  • (dict) –

    • VpcAttachment (dict) –

      Provides details about the VPC attachment.

      • Attachment (dict) –

        Provides details about the VPC attachment.

        • CoreNetworkId (string) –

          The ID of a core network.

        • CoreNetworkArn (string) –

          The ARN of a core network.

        • AttachmentId (string) –

          The ID of the attachment.

        • OwnerAccountId (string) –

          The ID of the attachment account owner.

        • AttachmentType (string) –

          The type of attachment.

        • State (string) –

          The state of the attachment.

        • EdgeLocation (string) –

          The Region where the edge is located. This is returned for all attachment types except a Direct Connect gateway attachment, which instead returns EdgeLocations.

        • EdgeLocations (list) –

          The edge locations that the Direct Connect gateway is associated with. This is returned only for Direct Connect gateway attachments. All other attachment types retrun EdgeLocation.

          • (string) –

        • ResourceArn (string) –

          The attachment resource ARN.

        • AttachmentPolicyRuleNumber (integer) –

          The policy rule number associated with the attachment.

        • SegmentName (string) –

          The name of the segment attachment.

        • NetworkFunctionGroupName (string) –

          The name of the network function group.

        • NatGatewaySupport (string) –

          The state of NAT gateway support on the attachment. This is returned only to the core network owner for attachment types that support NAT.

        • NatSystemRouteSupport (boolean) –

          Indicates whether the core network installs system routes for the NAT CIDR blocks of the attachment’s NAT rules. This is returned only to the core network owner for attachment types that support NAT.

        • Tags (list) –

          The tags associated with the attachment.

          • (dict) –

            Describes a tag.

            • Key (string) –

              The tag key.

              Constraints: Maximum length of 128 characters.

            • Value (string) –

              The tag value.

              Constraints: Maximum length of 256 characters.

        • ProposedSegmentChange (dict) –

          The attachment to move from one segment to another.

          • Tags (list) –

            The list of key-value tags that changed for the segment.

            • (dict) –

              Describes a tag.

              • Key (string) –

                The tag key.

                Constraints: Maximum length of 128 characters.

              • Value (string) –

                The tag value.

                Constraints: Maximum length of 256 characters.

          • AttachmentPolicyRuleNumber (integer) –

            The rule number in the policy document that applies to this change.

          • SegmentName (string) –

            The name of the segment to change.

        • ProposedNetworkFunctionGroupChange (dict) –

          Describes a proposed change to a network function group associated with the attachment.

          • Tags (list) –

            The list of proposed changes to the key-value tags associated with the network function group.

            • (dict) –

              Describes a tag.

              • Key (string) –

                The tag key.

                Constraints: Maximum length of 128 characters.

              • Value (string) –

                The tag value.

                Constraints: Maximum length of 256 characters.

          • AttachmentPolicyRuleNumber (integer) –

            The proposed new attachment policy rule number for the network function group.

          • NetworkFunctionGroupName (string) –

            The proposed name change for the network function group name.

        • CreatedAt (datetime) –

          The timestamp when the attachment was created.

        • UpdatedAt (datetime) –

          The timestamp when the attachment was last updated.

        • LastModificationErrors (list) –

          Describes the error associated with the attachment request.

          • (dict) –

            Describes the error associated with an attachment request.

            • Code (string) –

              The error code for the attachment request.

            • Message (string) –

              The message associated with the error code.

            • ResourceArn (string) –

              The ARN of the requested attachment resource.

            • RequestId (string) –

              The ID of the attachment request.

      • SubnetArns (list) –

        The subnet ARNs.

        • (string) –

      • Options (dict) –

        Provides details about the VPC attachment.

        • Ipv6Support (boolean) –

          Indicates whether IPv6 is supported.

        • ApplianceModeSupport (boolean) –

          Indicates whether appliance mode is supported. If enabled, traffic flow between a source and destination use the same Availability Zone for the VPC attachment for the lifetime of that flow. The default value is false.

        • DnsSupport (boolean) –

          Indicates whether DNS is supported.

        • SecurityGroupReferencingSupport (boolean) –

          Indicates whether security group referencing is enabled for this VPC attachment. The default is true. However, at the core network policy-level the default is set to false.

Exceptions