Skip to content

add_notification_channel

add_notification_channel(
    config: NotificationChannelConfig,
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
) -> AddNotificationChannelResponse

Adds a notification channel to DevOps Guru. A notification channel is used to notify you about important DevOps Guru events, such as when an insight is generated.

If you use an Amazon SNS topic in another account, you must attach a policy to it that grants DevOps Guru permission to send it notifications. DevOps Guru adds the required policy on your behalf to send notifications using Amazon SNS in your account. DevOps Guru only supports standard SNS topics. For more information, see Permissions for Amazon SNS topics.

If you use an Amazon SNS topic that is encrypted by an Amazon Web Services Key Management Service customer-managed key (CMK), then you must add permissions to the CMK. For more information, see Permissions for Amazon Web Services KMS–encrypted Amazon SNS topics.

Parameters:

  • config (NotificationChannelConfig) –

    A NotificationChannelConfig object that specifies what type of notification channel to add. The one supported notification channel is Amazon Simple Notification Service (Amazon SNS).

Raises:

Source code in docs_src/capo_devops_guru/_services/dev_ops_guru.py
def add_notification_channel(
    self,
    config: "capo_devops_guru.types.notification_channel_config.NotificationChannelConfig",
    *,
    config_overrides: Optional[DevOpsGuruClientConfig] = None,
) -> "capo_devops_guru.types.add_notification_channel_response.AddNotificationChannelResponse":
    """<p> Adds a notification channel to DevOps Guru. A notification channel is used to notify you about important DevOps Guru events, such as when an insight is generated. </p> <p>If you use an Amazon SNS topic in another account, you must attach a policy to it that grants DevOps Guru permission to send it notifications. DevOps Guru adds the required policy on your behalf to send notifications using Amazon SNS in your account. DevOps Guru only supports standard SNS topics. For more information, see <a href="https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html">Permissions for Amazon SNS topics</a>.</p> <p>If you use an Amazon SNS topic that is encrypted by an Amazon Web Services Key Management Service customer-managed key (CMK), then you must add permissions to the CMK. For more information, see <a href="https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html">Permissions for Amazon Web Services KMS–encrypted Amazon SNS topics</a>.</p>

    Args:
        config: <p> A <code>NotificationChannelConfig</code> object that specifies what type of notification channel to add. The one supported notification channel is Amazon Simple Notification Service (Amazon SNS). </p>

    Raises:
        capo_devops_guru.errors.access_denied_exception.AccessDeniedException: <p> You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access Management</a> in the <i>IAM User Guide</i>. </p>
        capo_devops_guru.errors.conflict_exception.ConflictException: <p> An exception that is thrown when a conflict occurs. </p>
        capo_devops_guru.errors.internal_server_exception.InternalServerException: <p>An internal failure in an Amazon service occurred.</p>
        capo_devops_guru.errors.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource could not be found</p>
        capo_devops_guru.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request contains a value that exceeds a maximum quota.</p>
        capo_devops_guru.errors.throttling_exception.ThrottlingException: <p>The request was denied due to a request throttling.</p>
        capo_devops_guru.errors.validation_exception.ValidationException: <p> Contains information about data passed in to a field during a request that is not valid. </p>
        capo_devops_guru.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_devops_guru.types.add_notification_channel_request.AddNotificationChannelRequest]",
    ) -> OperationResponse[
        "capo_devops_guru.types.add_notification_channel_response.AddNotificationChannelResponse"
    ]:
        import capo_devops_guru._operations.capstone_control_plane_service.add_notification_channel

        output, http_response = (
            capo_devops_guru._operations.capstone_control_plane_service.add_notification_channel.add_notification_channel(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddNotificationChannel")
    )
    input_: capo_devops_guru.types.add_notification_channel_request.AddNotificationChannelRequest = {
        "config": config
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output