Skip to content

create_vpc_endpoint_connection_notification async

create_vpc_endpoint_connection_notification(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    service_id: Optional[VpcEndpointServiceId] = None,
    vpc_endpoint_id: Optional[VpcEndpointId] = None,
    connection_notification_arn: Optional[String] = None,
    connection_events: Optional[ValueStringList] = None,
    client_token: Optional[String] = None,
) -> CreateVpcEndpointConnectionNotificationResult

Creates a connection notification for a specified VPC endpoint or VPC endpoint service. A connection notification notifies you of specific endpoint events. You must create an SNS topic to receive notifications. For more information, see Creating an Amazon SNS topic in the Amazon SNS Developer Guide.

You can create a connection notification for interface endpoints only.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • service_id (Optional[VpcEndpointServiceId], default: None ) –

    The ID of the endpoint service.

  • vpc_endpoint_id (Optional[VpcEndpointId], default: None ) –

    The ID of the endpoint.

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

    The ARN of the SNS topic for the notifications.

  • connection_events (Optional[ValueStringList], default: None ) –

    The endpoint events for which to receive notifications. Valid values are Accept, Connect, Delete, and Reject.

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_vpc_endpoint_connection_notification(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    service_id: Optional[
        "capo_ec2.types.vpc_endpoint_service_id.VpcEndpointServiceId"
    ] = None,
    vpc_endpoint_id: Optional[
        "capo_ec2.types.vpc_endpoint_id.VpcEndpointId"
    ] = None,
    connection_notification_arn: Optional["capo_ec2.types.string.String"] = None,
    connection_events: Optional[
        "capo_ec2.types.value_string_list.ValueStringList"
    ] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.create_vpc_endpoint_connection_notification_result.CreateVpcEndpointConnectionNotificationResult":
    """<p>Creates a connection notification for a specified VPC endpoint or VPC endpoint service. A connection notification notifies you of specific endpoint events. You must create an SNS topic to receive notifications. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html">Creating an Amazon SNS topic</a> in the <i>Amazon SNS Developer Guide</i>.</p> <p>You can create a connection notification for interface endpoints only.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        service_id: <p>The ID of the endpoint service.</p>
        vpc_endpoint_id: <p>The ID of the endpoint.</p>
        connection_notification_arn: <p>The ARN of the SNS topic for the notifications.</p>
        connection_events: <p>The endpoint events for which to receive notifications. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>, and <code>Reject</code>.</p>
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.create_vpc_endpoint_connection_notification_request.CreateVpcEndpointConnectionNotificationRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_vpc_endpoint_connection_notification_result.CreateVpcEndpointConnectionNotificationResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_vpc_endpoint_connection_notification

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.create_vpc_endpoint_connection_notification.async_create_vpc_endpoint_connection_notification(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateVpcEndpointConnectionNotification"),
    )
    input_: capo_ec2.types.create_vpc_endpoint_connection_notification_request.CreateVpcEndpointConnectionNotificationRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if service_id is not None:
        input_["service_id"] = service_id
    if vpc_endpoint_id is not None:
        input_["vpc_endpoint_id"] = vpc_endpoint_id
    if connection_notification_arn is not None:
        input_["connection_notification_arn"] = connection_notification_arn
    if connection_events is not None:
        input_["connection_events"] = connection_events
    if client_token is not None:
        input_["client_token"] = client_token

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