aws-cdk-lib(core): App Inherits From Stage, But Doesn't Allow Setting Region #24570
Labels
@aws-cdk/core
Related to core CDK functionality
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
needs-discussion
This issue/PR requires more discussion with community.
p1
Describe the bug
I believe there's a fundamental "miss" in the code for
App
.App
inherits fromStage
yet does not allow setting any of theStageProps
. As defined hereaws-cdk/packages/@aws-cdk/core/lib/stage.ts
Lines 13 to 43 in 15cb919
env
allows setting the region from which all other resources in the stage will use.Even when casting
as any
to forceenv
intoApp
s constructor,App
ignoresprops
as a whole and only passesoutdir
as can be seen here:aws-cdk/packages/@aws-cdk/core/lib/app.ts
Lines 160 to 162 in 15cb919
Also of note, not passing a region to a
Stack
constructor's props will default the stack tous-east-1
even though--verbose
output shows thatCDK_DEFAULT_REGION
has been correctly pulled from~/.aws/config
.Expected Behavior
I would expect a number of things here:
App
inAppProps
CDK_DEFAULT_REGION
if nothing was specified manually in propsCDK_DEFAULT_REGION
diverged from what the default value ofus-east-1
with instructions or hints as to how to proceed.Current Behavior
The stage silently defaults to
us-east-1
Reproduction Steps
Please reference code permalinks above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.68.0
Framework Version
2.68.0
Node.js Version
18
OS
Mac Vetura
Language
Typescript
Language Version
4.9
Other information
No response
The text was updated successfully, but these errors were encountered: