Skip to content
v2.276.0

SlackChannelConfigurationProps Struct ​

Properties for a new Slack channel configuration.

Example ​

ts
import * as chatbot from 'aws-cdk-lib/aws-chatbot';

declare const project: codebuild.Project;

const target = new chatbot.SlackChannelConfiguration(this, 'MySlackChannel', {
  slackChannelConfigurationName: 'YOUR_CHANNEL_NAME',
  slackWorkspaceId: 'YOUR_SLACK_WORKSPACE_ID',
  slackChannelId: 'YOUR_SLACK_CHANNEL_ID',
});

const rule = project.notifyOnBuildSucceeded('NotifyOnBuildSucceeded', target);
python
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)
java
import software.amazon.awscdk.services.chatbot.*;

Project project;


SlackChannelConfiguration target = SlackChannelConfiguration.Builder.create(this, "MySlackChannel")
        .slackChannelConfigurationName("YOUR_CHANNEL_NAME")
        .slackWorkspaceId("YOUR_SLACK_WORKSPACE_ID")
        .slackChannelId("YOUR_SLACK_CHANNEL_ID")
        .build();

INotificationRule rule = project.notifyOnBuildSucceeded("NotifyOnBuildSucceeded", target);
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Chatbot;

Project project;


var target = new SlackChannelConfiguration(this, "MySlackChannel", new SlackChannelConfigurationProps {
    SlackChannelConfigurationName = "YOUR_CHANNEL_NAME",
    SlackWorkspaceId = "YOUR_SLACK_WORKSPACE_ID",
    SlackChannelId = "YOUR_SLACK_CHANNEL_ID"
});

var rule = project.NotifyOnBuildSucceeded("NotifyOnBuildSucceeded", target);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import chatbot "github.com/aws/aws-cdk-go/awscdk"

var project Project


target := chatbot.NewSlackChannelConfiguration(this, jsii.String("MySlackChannel"), &SlackChannelConfigurationProps{
	SlackChannelConfigurationName: jsii.String("YOUR_CHANNEL_NAME"),
	SlackWorkspaceId: jsii.String("YOUR_SLACK_WORKSPACE_ID"),
	SlackChannelId: jsii.String("YOUR_SLACK_CHANNEL_ID"),
})

rule := project.notifyOnBuildSucceeded(jsii.String("NotifyOnBuildSucceeded"), target)

Properties ​

guardrailPoliciesoptionalIManagedPolicy[]guardrail_policiesoptionaltyping.List[IManagedPolicy]guardrailPoliciesoptionalList<IManagedPolicy>GuardrailPoliciesoptionalIManagedPolicy[]GuardrailPoliciesoptional*[]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.

loggingLeveloptionalLoggingLevellogging_leveloptionalLoggingLevelloggingLeveloptionalLoggingLevelLoggingLeveloptionalLoggingLevelLoggingLeveloptionalLoggingLevel= LoggingLevel.NONE#
Specifies the logging level for this configuration.

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

logRetentionoptionalRetentionDayslog_retentionoptionalRetentionDayslogRetentionoptionalRetentionDaysLogRetentionoptionalRetentionDaysLogRetentionoptionalRetentionDays= logs.RetentionDays.INFINITE#
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.

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

Default: Default AWS SDK retry options.

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

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

Default: A new role is created.

notificationTopicsoptionalITopic[]notification_topicsoptionaltyping.List[ITopic]notificationTopicsoptionalList<ITopic>NotificationTopicsoptionalITopic[]NotificationTopicsoptional*[]ITopic= None#
The SNS topics that deliver notifications to AWS Chatbot.
roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole#
The permission role of Slack channel configuration.

Default: A role will be created.

slackChannelConfigurationNamestringslack_channel_configuration_namestrslackChannelConfigurationNameStringSlackChannelConfigurationNamestringSlackChannelConfigurationName*stringrequired#
The name of Slack channel configuration.
slackChannelIdstringslack_channel_idstrslackChannelIdStringSlackChannelIdstringSlackChannelId*stringrequired#
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.

slackWorkspaceIdstringslack_workspace_idstrslackWorkspaceIdStringSlackWorkspaceIdstringSlackWorkspaceId*stringrequired#
The ID of the Slack workspace authorized with AWS Chatbot.
notes

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.

userRoleRequiredoptionalbooleanuser_role_requiredoptionalbooluserRoleRequiredoptionalBooleanUserRoleRequiredoptionalboolUserRoleRequiredoptional*bool= false#
Enables use of a user role requirement in your chat configuration.