Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
AWS CDK synth and different cdk.json files

So, I have 3 different cdk.json files with different name/value pairs: cdk.json, cdk-west.json cdk-east.json

When, I run a synth or deploy, can I specify a specific json file instead of the default cdk.json one?

I know you can change profiles with the --profile option, but not sure about cdk.json

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Unfortunately, there is no such option.

over 4 years ago · Santiago Trujillo Report

0

A good way around this is to add an "environment" attribute to your cdk.json file with attributes for each environment that contain settings for that environment.

{
...
"environments":{
   "xxxxxxxxxxxx":{
      "name": "dev",
      "awsAccountId":"xxxxxxxxxxxx",
      "awsRegion":"us-west-2",
      "logLevel":"debug",
      "customSetting": "value 1",
      ...
   },
   "prod-west-1-account-id":{
      "name": "prod-us-west-1",
      ...
   },
   "prod-west-2-account-id":{
      "name": "prod-us-west-2",
      ...
   }
}

Then each Stack can grab the appropriate environment configuration based on the value of "this.account"

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!