-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Environment defaults and support for relocatable templates #2866
Copy link
Copy link
Closed
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
[Only using “region” here, but same applies for account].
stack.regionwill resolve to:env.region || Aws.region- Any code that requires a concrete region will check
Token.isUndefined(stack.region), either fall back and return a "relocatable" result (e.g. useFn::GetAZs) or emit a metadata error and return dummy values for tests. - If
stack.regionis not a concrete value, assembly manifest will indicateany-regionin the stack's environment spec (aws://1287239487234/any-region). Same for account. - If
cdk deployseesany-regionin a stack's environment spec, it will use the default region as configured in the CLI. If a region is not configured for some reason, an error will be reported. - Remove
Context.getDefaultRegion(). It shouldn't be accessed directly.
User guide and documentation should guide users who wish to synthesize "relocatable" (account/region-agnostic) templates to simply set env: { account: Aws.account, region: Aws.region } when they define their stack. This will result in the above behavior to kick in.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.