© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
環境ごとのパラメータの指定⽅法を変更
import { Environment } from 'aws-cdk-lib';
export interface MyParameter {
env?: Environment;
envName: string;
securityNotifyEmail: string;
chatbotWorkspaceId: string;
chatbotChannelId: string;
}
export const devParameter: MyParameter = {
envName: 'Development',
securityNotifyEmail: '
[email protected]',
chatbotWorkspaceId: 'T8XXXXXXX',
import { devParameter, stgParameter } from "../parameter"
const app = new cdk.App();
new Stack(app, "DevStack", {
securityNotifyEmail: devParameter.securityNotifyEmail,
});
new Stack(app, "StageStack", {
securityNotifyEmail: stgParameter.securityNotifyEmail,
});
$ cdk deploy
parameter.ts
bin/sample.ts
• TypeScript ファイル (parameter.ts) にパラメータのインターフェイスと実際の値を定義
• CDK App はエクスポートされたパラメータの値をインポートして使⽤
• ⼀度の Synth ですべての環境⽤にスタックを合成
Synth 1回で
すべての環境の
スタックを静的に合成
BLEA v3