Package software.amazon.awscdk.services.chatbot
AWS::Chatbot Construct Library
AWS Chatbot is an AWS service that enables DevOps and software development teams to use Slack chat rooms to monitor and respond to operational events in their AWS Cloud. AWS Chatbot processes AWS service notifications from Amazon Simple Notification Service (Amazon SNS), and forwards them to Slack chat rooms so teams can analyze and act on them immediately, regardless of location.
This module is part of the AWS Cloud Development Kit project.
import software.amazon.awscdk.services.chatbot.*;
import software.amazon.awscdk.services.sns.*;
import software.amazon.awscdk.services.iam.*;
SlackChannelConfiguration slackChannel = SlackChannelConfiguration.Builder.create(this, "MySlackChannel")
.slackChannelConfigurationName("YOUR_CHANNEL_NAME")
.slackWorkspaceId("YOUR_SLACK_WORKSPACE_ID")
.slackChannelId("YOUR_SLACK_CHANNEL_ID")
.build();
slackChannel.addToRolePolicy(PolicyStatement.Builder.create()
.effect(Effect.ALLOW)
.actions(List.of("s3:GetObject"))
.resources(List.of("arn:aws:s3:::abc/xyz/123.txt"))
.build());
slackChannel.addNotificationTopic(new Topic(this, "MyTopic"));
Log Group
Slack channel configuration automatically create a log group with the name /aws/chatbot/<configuration-name> in us-east-1 upon first execution with
log data set to never expire.
The logRetention property can be used to set a different expiration period. A log group will be created if not already exists.
If the log group already exists, it's expiration will be configured to the value specified in this construct (never expire, by default).
By default, CDK uses the AWS SDK retry options when interacting with the log group. The logRetentionRetryOptions property
allows you to customize the maximum number of retries and base backoff duration.
Note that, if logRetention is set, a CloudFormation custom
resource is added
to the stack that pre-creates the log group as part of the stack deployment, if it already doesn't exist, and sets the
correct log retention period (never expire, by default).
Guardrails
By default slack channel will use AdministratorAccess managed policy as guardrail policy.
The guardrailPolicies property can be used to set a different set of managed policies.
User Role Requirement
Administrators can require user roles for all current channel members and channels and all channels created in the future by enabling a user role requirement.
You can configure this feature by setting the userRoleRequired property.
import software.amazon.awscdk.services.chatbot.*;
SlackChannelConfiguration slackChannel = SlackChannelConfiguration.Builder.create(this, "MySlackChannel")
.slackChannelConfigurationName("YOUR_CHANNEL_NAME")
.slackWorkspaceId("YOUR_SLACK_WORKSPACE_ID")
.slackChannelId("YOUR_SLACK_CHANNEL_ID")
.userRoleRequired(true)
.build();
-
ClassDescriptionA fluent builder for
CfnCustomAction.A builder forCfnCustomAction.CustomActionAttachmentCriteriaPropertyAn implementation forCfnCustomAction.CustomActionAttachmentCriteriaPropertyA builder forCfnCustomAction.CustomActionAttachmentPropertyAn implementation forCfnCustomAction.CustomActionAttachmentPropertyA builder forCfnCustomAction.CustomActionDefinitionPropertyAn implementation forCfnCustomAction.CustomActionDefinitionPropertyProperties for defining aCfnCustomAction.A builder forCfnCustomActionPropsAn implementation forCfnCustomActionPropsA fluent builder forCfnMicrosoftTeamsChannelConfiguration.Properties for defining aCfnMicrosoftTeamsChannelConfiguration.A builder forCfnMicrosoftTeamsChannelConfigurationPropsAn implementation forCfnMicrosoftTeamsChannelConfigurationPropsA fluent builder forCfnSlackChannelConfiguration.Properties for defining aCfnSlackChannelConfiguration.A builder forCfnSlackChannelConfigurationPropsAn implementation forCfnSlackChannelConfigurationPropsA reference to a CustomAction resource.A builder forCustomActionReferenceAn implementation forCustomActionReference(experimental) Indicates that this resource can be referenced as a CustomAction.Internal default implementation forICustomActionRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a MicrosoftTeamsChannelConfiguration.Internal default implementation forIMicrosoftTeamsChannelConfigurationRef.A proxy class which represents a concrete javascript instance of this type.Represents a Slack channel configuration.Internal default implementation forISlackChannelConfiguration.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a SlackChannelConfiguration.Internal default implementation forISlackChannelConfigurationRef.A proxy class which represents a concrete javascript instance of this type.Logging levels include ERROR, INFO, or NONE.A reference to a MicrosoftTeamsChannelConfiguration resource.A builder forMicrosoftTeamsChannelConfigurationReferenceAn implementation forMicrosoftTeamsChannelConfigurationReferenceA new Slack channel configuration.A fluent builder forSlackChannelConfiguration.Properties for a new Slack channel configuration.A builder forSlackChannelConfigurationPropsAn implementation forSlackChannelConfigurationPropsA reference to a SlackChannelConfiguration resource.A builder forSlackChannelConfigurationReferenceAn implementation forSlackChannelConfigurationReference