Slide 11
Slide 11 text
export class AmplifyBuildNotification extends Construct {
constructor
(
scope: Construct,
id: string,
props: AmplifyBuildNotificationProps
) {
super(scope, id);
…
new chatbot.SlackChannelConfiguration
(this, "SlackChannel"
,
{
slackChannelConfigurationName:
"AmplifyBuildNotificationSlackChannel"
,
slackWorkspaceId: props.slackWorkspaceId
,
slackChannelId: props.slackChannelId
,
notificationTopics: [topic],
}
);
// 以下、他のConstructの定義が続く
}
Amplify Gen2のカスタマイズ(CDK Construct)
// amplify/backend.ts
import { defineBackend } from '@aws-amplify/backend'
;
import { auth } from './auth/resource'
;
import { data } from './data/resource'
;
import { AmplifyBuildNotification } from
'./custom/build-notification/amplify-build-notification-construct';
const backend = defineBackend
({
auth,
data
});
new AmplifyBuildNotification
(
backend.createStack
("NotificationStack"
), 'Notification'
,
{
slackWorkspaceId: "TXXXXXXX"
, // Slack Workspace's ID
slackChannelId: "CXXXXXXX"
, // Slack Channel ID
}
);
AWS Chatbotの設定などを含むカスタムのConstruct(一部抜粋) カスタムのConstructを含むStackをAmplify Gen2に追加する例