スキップしてコンテンツを表示

Managing per deployment stage (e.g. prod, dev) configuration using CDK?

0

We're migrating from Serverless Framework (SF) to CDK and I'm wondering how to best manage per deployment stage (e.g. prod, dev) configuration using CDK. IN SF we had a YAML block like this:

  prod:
    alertsEmail: alerts@ourdomain.com
    captchaSecretId: prod/Backend/CaptchaSecretId
    enableAlarms: true
    enableDashboards: true

  dev:
    alertsEmail: dev-alerts@ourdomain.com
    captchaSecretId: prod/Backend/CaptchaSecretId
    enableAlarms: false
    enableDashboards: false

  default:
    # ...

("default" was used for all other stacks, like the per-developer sandbox stacks.)

These configuration variables then affect how we set up our CloudFormation (CF) resources. For example, if enableAlarms is true we'd add a bunch of Alarm resources.

  • What's the recommended way to store per deployment stage configuration?
  • How do we best specify which environment we're in when deploying? Using SF we'd do serverless deploy --stage=prod and the configuration got pick using the --stage command line flag.
  • please accept the answer if it was useful

質問済み 2年前647ビュー

1回答
1
エキスパート

回答済み 2年前

エキスパート

レビュー済み 2年前

エキスパート

レビュー済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ