Skip to content

create_vpc_link

create_vpc_link(
    name: String,
    target_arns: ListOfString,
    *,
    config_overrides: Optional[APIGatewayClientConfig] = None,
    description: Optional[String] = None,
    tags: Optional[MapOfStringToString] = None,
) -> VpcLink

Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.

Parameters:

  • name (String) –

    The name used to label and identify the VPC link.

  • description (Optional[String], default: None ) –

    The description of the VPC link.

  • target_arns (ListOfString) –

    The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.

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

    The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.

Raises:

  • BadRequestException –

    The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

  • ConflictException –

    The request configuration has conflicts. For details, see the accompanying error message.

  • LimitExceededException –

    The request exceeded the rate limit. Retry after the specified time period.

  • TooManyRequestsException –

    The request has reached its throttling limit. Retry after the specified time period.

  • UnauthorizedException –

    The request is denied because the caller has insufficient permissions.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_api_gateway/_services/api_gateway.py
def create_vpc_link(
    self,
    name: "capo_api_gateway.types.string.String",
    target_arns: "capo_api_gateway.types.list_of_string.ListOfString",
    *,
    config_overrides: Optional[APIGatewayClientConfig] = None,
    description: Optional["capo_api_gateway.types.string.String"] = None,
    tags: Optional[
        "capo_api_gateway.types.map_of_string_to_string.MapOfStringToString"
    ] = None,
) -> "capo_api_gateway.types.vpc_link.VpcLink":
    """<p>Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.</p>

    Args:
        name: <p>The name used to label and identify the VPC link.</p>
        description: <p>The description of the VPC link.</p>
        target_arns: <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
        tags: <p>The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>

    Raises:
        capo_api_gateway.errors.bad_request_exception.BadRequestException: <p>The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_api_gateway.errors.conflict_exception.ConflictException: <p>The request configuration has conflicts. For details, see the accompanying error message.</p>
        capo_api_gateway.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded the rate limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.too_many_requests_exception.TooManyRequestsException: <p>The request has reached its throttling limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.unauthorized_exception.UnauthorizedException: <p>The request is denied because the caller has insufficient permissions.</p>
        capo_api_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_api_gateway.types.create_vpc_link_request.CreateVpcLinkRequest]",
    ) -> OperationResponse["capo_api_gateway.types.vpc_link.VpcLink"]:
        import capo_api_gateway._operations.backplane_control_service.create_vpc_link

        output, http_response = (
            capo_api_gateway._operations.backplane_control_service.create_vpc_link.create_vpc_link(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVpcLink")
    )
    input_: capo_api_gateway.types.create_vpc_link_request.CreateVpcLinkRequest = {
        "name": name,
        "target_arns": target_arns,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output