# SlackChannelConfigurationProps

Properties for a new Slack channel configuration.

Extends: SlackChannelConfigurationProps
Used as props by: SlackChannelConfiguration

- Source: [`aws-chatbot/lib/slack-channel-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-chatbot/lib/slack-channel-configuration.ts#L20)
- Type last changed: v2.145.0 · 7 Jun 2024

## 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);
```

## Properties

- `guardrailPolicies`: [IManagedPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IManagedPolicy.html)[] — 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.

- `loggingLevel`: [LoggingLevel](/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.LoggingLevel.html) = LoggingLevel.NONE — Specifies the logging level for this configuration.

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

- `logRetention`: [RetentionDays](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.RetentionDays.html) = 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`.

- `logRetentionRetryOptions`: [LogRetentionRetryOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogRetentionRetryOptions.html) — 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.

- `logRetentionRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

  **Default:** A new role is created.

- `notificationTopics`: [ITopic](/cdk/api/v2/docs/aws-cdk-lib.aws_sns.ITopic.html)[] = None — The SNS topics that deliver notifications to AWS Chatbot.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The permission role of Slack channel configuration.

  **Default:** A role will be created.

- `slackChannelConfigurationName`: string (required) — The name of Slack channel configuration.

- `slackChannelId`: string (required) — 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.

- `slackWorkspaceId`: string (required) — 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.

- `userRoleRequired`: boolean = false — Enables use of a user role requirement in your chat configuration.
