Skip to content

create_public_virtual_interface async

create_public_virtual_interface(
    connection_id: ConnectionId,
    new_public_virtual_interface: NewPublicVirtualInterface,
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
) -> VirtualInterface

Creates a public virtual interface. A virtual interface is the VLAN that transports Direct Connect traffic. A public virtual interface supports sending traffic to public services of Amazon Web Services such as Amazon S3.

When creating an IPv6 public virtual interface (addressFamily is ipv6), leave the customer and amazon address fields blank to use auto-assigned IPv6 space. Custom IPv6 addresses are not supported.

Parameters:

Raises:

Source code in docs_src/capo_direct_connect/_services/async_direct_connect.py
async def create_public_virtual_interface(
    self,
    connection_id: "capo_direct_connect.types.connection_id.ConnectionId",
    new_public_virtual_interface: "capo_direct_connect.types.new_public_virtual_interface.NewPublicVirtualInterface",
    *,
    config_overrides: Optional[AsyncDirectConnectClientConfig] = None,
) -> "capo_direct_connect.types.virtual_interface.VirtualInterface":
    """<p>Creates a public virtual interface. A virtual interface is the VLAN that transports Direct Connect traffic. A public virtual interface supports sending traffic to public services of Amazon Web Services such as Amazon S3.</p> <p>When creating an IPv6 public virtual interface (<code>addressFamily</code> is <code>ipv6</code>), leave the <code>customer</code> and <code>amazon</code> address fields blank to use auto-assigned IPv6 space. Custom IPv6 addresses are not supported.</p>

    Args:
        connection_id: <p>The ID of the connection.</p>
        new_public_virtual_interface: <p>Information about the public virtual interface.</p>

    Raises:
        capo_direct_connect.errors.direct_connect_client_exception.DirectConnectClientException: <p>One or more parameters are not valid.</p>
        capo_direct_connect.errors.direct_connect_server_exception.DirectConnectServerException: <p>A server-side error occurred.</p>
        capo_direct_connect.errors.duplicate_tag_keys_exception.DuplicateTagKeysException: <p>A tag key was specified more than once.</p>
        capo_direct_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The rate limiter limit has been exceeded for the connection. You cannot add more rate limiters to virtual interfaces on this connection.</p>
        capo_direct_connect.errors.too_many_tags_exception.TooManyTagsException: <p>You have reached the limit on the number of tags that can be assigned.</p>
        capo_direct_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_direct_connect.types.create_public_virtual_interface_request.CreatePublicVirtualInterfaceRequest]",
    ) -> AsyncOperationResponse[
        "capo_direct_connect.types.virtual_interface.VirtualInterface"
    ]:
        import capo_direct_connect._operations.overture_service.create_public_virtual_interface

        (
            output,
            http_response,
        ) = await capo_direct_connect._operations.overture_service.create_public_virtual_interface.async_create_public_virtual_interface(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePublicVirtualInterface")
    )
    input_: capo_direct_connect.types.create_public_virtual_interface_request.CreatePublicVirtualInterfaceRequest = {
        "connection_id": connection_id,
        "new_public_virtual_interface": new_public_virtual_interface,
    }

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