Might be addressed by #1499
I am proposing a feature to define the stage status of the infrastructure. This will help contextualize and isolate the set of infrastructure targeted for different environment. It will allow authors of IaC to contain the changes within the context of the stage and allow reproducing the target infrastructures or modifying the incrementally as long as they are in the same stage.
Additionally it will drive the practice of separating the parameter for the stages to be fed from text files and keep them outside of VCS for better security and make the workflow stateless.
Here are my mind dumps:
cdk synth --stage [dev|staging|prod]
which will set the app
level or stack level Environment property called stage
. Or stage can be set from Stack instance property of Environment using @aws-cdk/core.Environment
interfacestage
prod would read prod.yml file or any file defined by --stage-file CLI option. This will then inject it into stack propertiesNA
Any reason --context stage=prod
and this.tryGetContext('stage')
can't be used to this purpose?
Any reason
--context stage=prod
andthis.tryGetContext('stage')
can't be used to this purpose?
@mirazmamun
I will close this issue since there hasn't been activity on it in a while and it seems to have been resolved by the above comment. Feel free to reopen.
Most helpful comment
Any reason
--context stage=prod
andthis.tryGetContext('stage')
can't be used to this purpose?