Skip to content

modify_event_subscription async

modify_event_subscription(
    subscription_name: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    sns_topic_arn: Optional[String] = None,
    source_type: Optional[String] = None,
    event_categories: Optional[EventCategoriesList] = None,
    enabled: Optional[BooleanOptional] = None,
) -> ModifyEventSubscriptionResponse

Modifies an existing DMS event notification subscription.

Parameters:

  • subscription_name (String) –

    The name of the DMS event notification subscription to be modified.

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

    The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

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

    The type of DMS resource that generates the events you want to subscribe to.

    Valid values: replication-instance | replication-task

  • event_categories (Optional[EventCategoriesList], default: None ) –

    A list of event categories for a source type that you want to subscribe to. Use the DescribeEventCategories action to see a list of event categories.

  • enabled (Optional[BooleanOptional], default: None ) –

    A Boolean value; set to true to activate the subscription.

Raises:

Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def modify_event_subscription(
    self,
    subscription_name: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    sns_topic_arn: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    source_type: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    event_categories: Optional[
        "capo_database_migration_service.types.event_categories_list.EventCategoriesList"
    ] = None,
    enabled: Optional[
        "capo_database_migration_service.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_database_migration_service.types.modify_event_subscription_response.ModifyEventSubscriptionResponse":
    """<p>Modifies an existing DMS event notification subscription. </p>

    Args:
        subscription_name: <p>The name of the DMS event notification subscription to be modified.</p>
        sns_topic_arn: <p> The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
        source_type: <p> The type of DMS resource that generates the events you want to subscribe to. </p> <p>Valid values: replication-instance | replication-task</p>
        event_categories: <p> A list of event categories for a source type that you want to subscribe to. Use the <code>DescribeEventCategories</code> action to see a list of event categories. </p>
        enabled: <p> A Boolean value; set to <b>true</b> to activate the subscription. </p>

    Raises:
        capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
        capo_database_migration_service.errors.kms_access_denied_fault.KMSAccessDeniedFault: <p>The ciphertext references a key that doesn't exist or that the DMS account doesn't have access to.</p>
        capo_database_migration_service.errors.kms_disabled_fault.KMSDisabledFault: <p>The specified KMS key isn't enabled.</p>
        capo_database_migration_service.errors.kms_invalid_state_fault.KMSInvalidStateFault: <p>The state of the specified KMS resource isn't valid for this request.</p>
        capo_database_migration_service.errors.kms_not_found_fault.KMSNotFoundFault: <p>The specified KMS entity or resource can't be found.</p>
        capo_database_migration_service.errors.kms_throttling_fault.KMSThrottlingFault: <p>This request triggered KMS request throttling.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.resource_quota_exceeded_fault.ResourceQuotaExceededFault: <p>The quota for this resource quota has been exceeded.</p>
        capo_database_migration_service.errors.sns_invalid_topic_fault.SNSInvalidTopicFault: <p>The SNS topic is invalid.</p>
        capo_database_migration_service.errors.sns_no_authorization_fault.SNSNoAuthorizationFault: <p>You are not authorized for the SNS subscription.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.modify_event_subscription_message.ModifyEventSubscriptionMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.modify_event_subscription_response.ModifyEventSubscriptionResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.modify_event_subscription

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.modify_event_subscription.async_modify_event_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyEventSubscription")
    )
    input_: capo_database_migration_service.types.modify_event_subscription_message.ModifyEventSubscriptionMessage = {
        "subscription_name": subscription_name
    }
    if sns_topic_arn is not None:
        input_["sns_topic_arn"] = sns_topic_arn
    if source_type is not None:
        input_["source_type"] = source_type
    if event_categories is not None:
        input_["event_categories"] = event_categories
    if enabled is not None:
        input_["enabled"] = enabled

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