PacktPublishing / AWS-CDK-in-Practice

AWS CDK in Practice, published by Packt
MIT License
53 stars 55 forks source link

Slack integration #6

Open totterman opened 10 months ago

totterman commented 10 months ago

Chapter 5, Slack integration with AWS Chatbot. Seems like details are missing from the AWS Chat client configuration, channels for instance.

jpnws commented 7 months ago

@totterman , given the date on which you've posted the issue, I'm guessing you may have already figured out what was happening, but just to possibly inform others who might be visiting this issue, I'll try to expand on your potential concern you had at the time.

It seems you were suspecting a possible gap in the book regarding the configuration steps for new channels on AWS Chatbot. If I've understood correctly, you’re referring to the part where the instructions appear incomplete, particularly around setting up channels on AWS Chatbot admin console.

If we follow the instructions on manually configuring the Slack client on AWS Chatbot admin console, there are no (manual) steps for configuring the channels.

I wanted to highlight that in lib/constructs/Pipeline/index.ts, we have this code snippet:

const slackConfig = new SlackChannelConfiguration(this, 'SlackChannel', {
  slackChannelConfigurationName: `${props.environment}-Pipeline-Slack-Channel-Config`,
  slackWorkspaceId: workspaceId || '',
  slackChannelId: channelId || '',
});

This code snippet automatically creates the channels based on the .env.development and .env.production environment variables that we've provided.

Only once CDK deployes the CodePipeline, we would see something like the following:

image

Whereas, prior to the CDK deployment, we would see an empty list of Configured channels.