-
We would like to know in our bin if the context of the current run is a snyth or a deploy or a destroy to react in our code differently. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To give you more insights: |
Beta Was this translation helpful? Give feedback.
-
The process that the CDK goes through doesn't allow you to do this. A cdk synth may be done moments, hours, or even months before a deployment is prepared and launched. Like CloudFormation, there should be as little logic pre-deployment as possible. If you require deploy-time access to resources, the Custom Resources model is probably what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
The process that the CDK goes through doesn't allow you to do this.
A cdk synth may be done moments, hours, or even months before a deployment is prepared and launched. Like CloudFormation, there should be as little logic pre-deployment as possible.
If you require deploy-time access to resources, the Custom Resources model is probably what you're looking for.