Dan Van Brunt
01/07/2022, 5:26 PMSeth Geoghegan
01/07/2022, 5:36 PMIn AWS CDK, you can, and should, specify the environment for every stack in the StackProps you pass to the constructor.
new cdk.Stack(this, "Stack1", new Struct { Env = new Struct {
Account = "123456789012",
Region = "eu-central-1"
}
});
I highly recommend providing this information explicitly and not using whatever credentials are currently active in your CLI to determine the target environment of your CDK stack instance. For example, suppose you have multiple CLI profiles on your machine and access to several accounts. In that case, you might deploy CDK apps into accounts of other customers, projects, or stages. This is something you definitely want to prevent.
Seth Geoghegan
01/07/2022, 5:36 PMthdxr
01/07/2022, 6:02 PMthdxr
01/07/2022, 6:02 PMSeth Geoghegan
01/07/2022, 6:08 PMthdxr
01/07/2022, 6:11 PMthdxr
01/07/2022, 6:12 PMthdxr
01/07/2022, 6:12 PMSeth Geoghegan
01/07/2022, 6:15 PMDan Van Brunt
01/07/2022, 6:18 PMDan Van Brunt
01/07/2022, 6:20 PMOllie Camp
01/07/2022, 6:50 PMthdxr
01/07/2022, 6:50 PMthdxr
01/07/2022, 6:51 PMthdxr
01/07/2022, 6:51 PMOllie Camp
01/07/2022, 6:52 PMSimon Reilly
01/07/2022, 6:52 PMOllie Camp
01/07/2022, 6:52 PMOllie Camp
01/07/2022, 6:52 PMOllie Camp
01/07/2022, 6:53 PMSimon Reilly
01/07/2022, 6:53 PMOllie Camp
01/07/2022, 6:55 PMOllie Camp
01/07/2022, 6:55 PMthdxr
01/07/2022, 6:57 PMthdxr
01/07/2022, 6:57 PMDan Van Brunt
01/07/2022, 6:58 PMOllie Camp
01/07/2022, 6:59 PMthdxr
01/07/2022, 7:00 PMthdxr
01/07/2022, 7:00 PMOllie Camp
01/07/2022, 7:00 PMOllie Camp
01/07/2022, 7:01 PMOllie Camp
01/07/2022, 7:01 PMthdxr
01/07/2022, 7:02 PMOllie Camp
01/07/2022, 7:02 PMthdxr
01/07/2022, 7:03 PMthdxr
01/07/2022, 7:03 PMOllie Camp
01/07/2022, 7:04 PMAdam Fanello
01/07/2022, 7:06 PMOllie Camp
01/07/2022, 7:19 PM