Skip to content

create_vpc_endpoint_association async

create_vpc_endpoint_association(
    firewall_arn: ResourceArn,
    vpc_id: VpcId,
    subnet_mapping: SubnetMapping,
    *,
    config_overrides: Optional[AsyncNetworkFirewallClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[TagList] = None,
) -> CreateVpcEndpointAssociationResponse

Creates a firewall endpoint for an Network Firewall firewall. This type of firewall endpoint is independent of the firewall endpoints that you specify in the Firewall itself, and you define it in addition to those endpoints after the firewall has been created. You can define a VPC endpoint association using a different VPC than the one you used in the firewall specifications.

Parameters:

  • firewall_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the firewall.

  • vpc_id (VpcId) –

    The unique identifier of the VPC where you want to create a firewall endpoint.

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

    A description of the VPC endpoint association.

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

    The key:value pairs to associate with the resource.

Raises:

  • InsufficientCapacityException –

    Amazon Web Services doesn't currently have enough available capacity to fulfill your request. Try your request later.

  • InternalServerError –

    Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request.

  • InvalidOperationException –

    The operation failed because it's not valid. For example, you might have tried to delete a rule group or firewall policy that's in use.

  • InvalidRequestException –

    The operation failed because of a problem with your request. Examples include:

    • You specified an unsupported parameter name or value.

    • You tried to update a property with a value that isn't among the available types.

    • Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.

  • LimitExceededException –

    Unable to perform the operation because doing so would violate a limit setting.

  • ResourceNotFoundException –

    Unable to locate a resource using the parameters that you provided.

  • ThrottlingException –

    Unable to process the request due to throttling limitations.

  • UnknownServiceError –

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

Source code in docs_src/capo_network_firewall/_services/async_network_firewall.py
async def create_vpc_endpoint_association(
    self,
    firewall_arn: "capo_network_firewall.types.resource_arn.ResourceArn",
    vpc_id: "capo_network_firewall.types.vpc_id.VpcId",
    subnet_mapping: "capo_network_firewall.types.subnet_mapping.SubnetMapping",
    *,
    config_overrides: Optional[AsyncNetworkFirewallClientConfig] = None,
    description: Optional[
        "capo_network_firewall.types.description.Description"
    ] = None,
    tags: Optional["capo_network_firewall.types.tag_list.TagList"] = None,
) -> "capo_network_firewall.types.create_vpc_endpoint_association_response.CreateVpcEndpointAssociationResponse":
    """<p>Creates a firewall endpoint for an Network Firewall firewall. This type of firewall endpoint is independent of the firewall endpoints that you specify in the <code>Firewall</code> itself, and you define it in addition to those endpoints after the firewall has been created. You can define a VPC endpoint association using a different VPC than the one you used in the firewall specifications. </p>

    Args:
        firewall_arn: <p>The Amazon Resource Name (ARN) of the firewall.</p>
        vpc_id: <p>The unique identifier of the VPC where you want to create a firewall endpoint. </p>
        description: <p>A description of the VPC endpoint association. </p>
        tags: <p>The key:value pairs to associate with the resource.</p>

    Raises:
        capo_network_firewall.errors.insufficient_capacity_exception.InsufficientCapacityException: <p>Amazon Web Services doesn't currently have enough available capacity to fulfill your request. Try your request later. </p>
        capo_network_firewall.errors.internal_server_error.InternalServerError: <p>Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request. </p>
        capo_network_firewall.errors.invalid_operation_exception.InvalidOperationException: <p>The operation failed because it's not valid. For example, you might have tried to delete a rule group or firewall policy that's in use.</p>
        capo_network_firewall.errors.invalid_request_exception.InvalidRequestException: <p>The operation failed because of a problem with your request. Examples include: </p> <ul> <li> <p>You specified an unsupported parameter name or value.</p> </li> <li> <p>You tried to update a property with a value that isn't among the available types.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.</p> </li> </ul>
        capo_network_firewall.errors.limit_exceeded_exception.LimitExceededException: <p>Unable to perform the operation because doing so would violate a limit setting. </p>
        capo_network_firewall.errors.resource_not_found_exception.ResourceNotFoundException: <p>Unable to locate a resource using the parameters that you provided.</p>
        capo_network_firewall.errors.throttling_exception.ThrottlingException: <p>Unable to process the request due to throttling limitations.</p>
        capo_network_firewall.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_network_firewall.types.create_vpc_endpoint_association_request.CreateVpcEndpointAssociationRequest]",
    ) -> AsyncOperationResponse[
        "capo_network_firewall.types.create_vpc_endpoint_association_response.CreateVpcEndpointAssociationResponse"
    ]:
        import capo_network_firewall._operations.network_firewall_20201112.create_vpc_endpoint_association

        (
            output,
            http_response,
        ) = await capo_network_firewall._operations.network_firewall_20201112.create_vpc_endpoint_association.async_create_vpc_endpoint_association(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVpcEndpointAssociation")
    )
    input_: capo_network_firewall.types.create_vpc_endpoint_association_request.CreateVpcEndpointAssociationRequest = {
        "firewall_arn": firewall_arn,
        "vpc_id": vpc_id,
        "subnet_mapping": subnet_mapping,
    }
    if description is not None:
        input_["description"] = description
    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