-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-s3-deployment: BucketDeployment executes in stack that is not being deployed #29952
Comments
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I think i've figured out exactly what is happening now. It has to do with CDK caching the output of the BucketDeployment Assets and thinking it doesn't need to rebuild, so it just deploys what it has cached, which happens to be the 'dev' build, not the 'prod' build like i instructed. I see above that you were not able to replicate using the |
I played around with it a little bit and it appears that even if i manage to get the So the real bug here is that CDK is not rebuilding the To replicate this,
|
Alright, i don't know how i didn't see this setting but setting the
Solves the problem. By default it is set to |
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
I often break up my CDK apps into multiple stacks, i've found that if i place a
BucketDeployment
in stackA
and then ask to deploy stackB
withnpx cdk deploy B
stackA
will execute the bucket deployment even when i haven't asked it to.Expected Behavior
Don't execute the BucketDeployment when not being asked to?
Current Behavior
It executed the BucketDeployment incorrectly and then stopped.
Reproduction Steps
Build a stack like below then attempt to deploy prod with
npx cdk deploy prod-web
. It will synth the dev assets first and then immediately start the deployment of the DEV asset to the prod bucket.Possible Solution
I've tried to see if the code knows which app is being deployed but its not present in the process.env or args.
Additional Information/Context
No response
CDK CLI Version
2.137.0 (build bb90b4c)
Framework Version
No response
Node.js Version
v20.12.0
OS
windows 11
Language
TypeScript
Language Version
5.4.3
Other information
No response
The text was updated successfully, but these errors were encountered: