SlackChannelConfigurationProps

class aws_cdk.aws_chatbot.SlackChannelConfigurationProps(*, slack_channel_configuration_name, slack_channel_id, slack_workspace_id, guardrail_policies=None, logging_level=None, log_retention=None, log_retention_retry_options=None, log_retention_role=None, notification_topics=None, role=None, user_role_required=None)

Bases: object

Properties for a new Slack channel configuration.

Parameters:
  • slack_channel_configuration_name (str) – The name of Slack channel configuration.

  • slack_channel_id (str) – The ID of the Slack channel. To get the ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.

  • slack_workspace_id (str) – The ID of the Slack workspace authorized with AWS Chatbot. To get the workspace ID, you must perform the initial authorization flow with Slack in the AWS Chatbot console. Then you can copy and paste the workspace ID from the console. For more details, see steps 1-4 in Setting Up AWS Chatbot with Slack in the AWS Chatbot User Guide.

  • guardrail_policies (Optional[Sequence[IManagedPolicy]]) – A list of IAM managed policies that are applied as channel guardrails. Default: - The AWS managed ‘AdministratorAccess’ policy is applied as a default if this is not set.

  • logging_level (Optional[LoggingLevel]) – Specifies the logging level for this configuration. This property affects the log entries pushed to Amazon CloudWatch Logs. Default: LoggingLevel.NONE

  • log_retention (Optional[RetentionDays]) – The number of days log events are kept in CloudWatch Logs. When updating this property, unsetting it doesn’t remove the log retention policy. To remove the retention policy, set the value to INFINITE. Default: logs.RetentionDays.INFINITE

  • log_retention_retry_options (Union[LogRetentionRetryOptions, Dict[str, Any], None]) – When log retention is specified, a custom resource attempts to create the CloudWatch log group. These options control the retry policy when interacting with CloudWatch APIs. Default: - Default AWS SDK retry options.

  • log_retention_role (Optional[IRole]) – The IAM role for the Lambda function associated with the custom resource that sets the retention policy. Default: - A new role is created.

  • notification_topics (Optional[Sequence[ITopic]]) – The SNS topics that deliver notifications to AWS Chatbot. Default: None

  • role (Optional[IRole]) – The permission role of Slack channel configuration. Default: - A role will be created.

  • user_role_required (Optional[bool]) – Enables use of a user role requirement in your chat configuration. Default: false

ExampleMetadata:

infused

Example:

import aws_cdk.aws_chatbot as chatbot

# project: codebuild.Project


target = chatbot.SlackChannelConfiguration(self, "MySlackChannel",
    slack_channel_configuration_name="YOUR_CHANNEL_NAME",
    slack_workspace_id="YOUR_SLACK_WORKSPACE_ID",
    slack_channel_id="YOUR_SLACK_CHANNEL_ID"
)

rule = project.notify_on_build_succeeded("NotifyOnBuildSucceeded", target)

Attributes

guardrail_policies

A list of IAM managed policies that are applied as channel guardrails.

Default:
  • The AWS managed ‘AdministratorAccess’ policy is applied as a default if this is not set.

log_retention

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn’t remove the log retention policy. To remove the retention policy, set the value to INFINITE.

Default:

logs.RetentionDays.INFINITE

log_retention_retry_options

When log retention is specified, a custom resource attempts to create the CloudWatch log group.

These options control the retry policy when interacting with CloudWatch APIs.

Default:
  • Default AWS SDK retry options.

log_retention_role

The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

Default:
  • A new role is created.

logging_level

Specifies the logging level for this configuration.

This property affects the log entries pushed to Amazon CloudWatch Logs.

Default:

LoggingLevel.NONE

notification_topics

The SNS topics that deliver notifications to AWS Chatbot.

Default:

None

role

The permission role of Slack channel configuration.

Default:
  • A role will be created.

slack_channel_configuration_name

The name of Slack channel configuration.

slack_channel_id

The ID of the Slack channel.

To get the ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.

slack_workspace_id

The ID of the Slack workspace authorized with AWS Chatbot.

To get the workspace ID, you must perform the initial authorization flow with Slack in the AWS Chatbot console. Then you can copy and paste the workspace ID from the console. For more details, see steps 1-4 in Setting Up AWS Chatbot with Slack in the AWS Chatbot User Guide.

See:

https://docs.aws.amazon.com/chatbot/latest/adminguide/setting-up.html#Setup_intro

user_role_required

Enables use of a user role requirement in your chat configuration.

Default:

false