Skip to content

create_vpc_link async

create_vpc_link(
    *,
    config_overrides: Optional[AsyncApiGatewayV2ClientConfig] = None,
    name: Optional[StringWithLengthBetween1And128] = None,
    security_group_ids: Optional[SecurityGroupIdList] = None,
    subnet_ids: Optional[SubnetIdList] = None,
    tags: Optional[Tags] = None,
) -> CreateVpcLinkResponse

Creates a VPC link.

Parameters:

Raises:

  • BadRequestException –

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

  • TooManyRequestsException –

    A limit has been exceeded. See the accompanying error message for details.

  • UnknownServiceError –

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

Source code in docs_src/capo_apigatewayv2/_services/async_api_gateway_v2.py
async def create_vpc_link(
    self,
    *,
    config_overrides: Optional[AsyncApiGatewayV2ClientConfig] = None,
    name: Optional[
        "capo_apigatewayv2.types.string_with_length_between1_and128.StringWithLengthBetween1And128"
    ] = None,
    security_group_ids: Optional[
        "capo_apigatewayv2.types.security_group_id_list.SecurityGroupIdList"
    ] = None,
    subnet_ids: Optional[
        "capo_apigatewayv2.types.subnet_id_list.SubnetIdList"
    ] = None,
    tags: Optional["capo_apigatewayv2.types.tags.Tags"] = None,
) -> "capo_apigatewayv2.types.create_vpc_link_response.CreateVpcLinkResponse":
    """<p>Creates a VPC link.</p>

    Args:
        name: <p>The name of the VPC link.</p>
        security_group_ids: <p>A list of security group IDs for the VPC link.</p>
        subnet_ids: <p>A list of subnet IDs to include in the VPC link.</p>
        tags: <p>A list of tags.</p>

    Raises:
        capo_apigatewayv2.errors.bad_request_exception.BadRequestException: <p>The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.too_many_requests_exception.TooManyRequestsException: <p>A limit has been exceeded. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apigatewayv2.types.create_vpc_link_request.CreateVpcLinkRequest]",
    ) -> AsyncOperationResponse[
        "capo_apigatewayv2.types.create_vpc_link_response.CreateVpcLinkResponse"
    ]:
        import capo_apigatewayv2._operations.api_gateway_v2.create_vpc_link

        (
            output,
            http_response,
        ) = await capo_apigatewayv2._operations.api_gateway_v2.create_vpc_link.async_create_vpc_link(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

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