SlackChannelConfigurationProps

class aws_cdk.aws_chatbot.SlackChannelConfigurationProps(*, slack_channel_configuration_name, slack_channel_id, slack_workspace_id, logging_level=None, log_retention=None, log_retention_retry_options=None, log_retention_role=None, notification_topics=None, role=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.

  • 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 (Optional[LogRetentionRetryOptions]) – 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.

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_chatbot as chatbot
import aws_cdk.aws_sns as sns

slack_channel = 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"
)

slack_channel.add_to_role_policy(iam.PolicyStatement(
    effect=iam.Effect.ALLOW,
    actions=["s3:GetObject"
    ],
    resources=["arn:aws:s3:::abc/xyz/123.txt"]
))

slack_channel.add_notification_topic(sns.Topic(self, "MyTopic"))

Attributes

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

Return type

Optional[RetentionDays]

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.

Return type

Optional[LogRetentionRetryOptions]

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.

Return type

Optional[IRole]

logging_level

Specifies the logging level for this configuration.

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

Default

LoggingLevel.NONE

Return type

Optional[LoggingLevel]

notification_topics

The SNS topics that deliver notifications to AWS Chatbot.

Default

None

Return type

Optional[List[ITopic]]

role

The permission role of Slack channel configuration.

Default
  • A role will be created.

Return type

Optional[IRole]

slack_channel_configuration_name

The name of Slack channel configuration.

Return type

str

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.

Return type

str

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

Return type

str