-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
spec: cdk package #3555
Comments
I was just about to create an issue asking how to do a Currently in CI, we do a Also, currently with |
Hi @eladb! Like @j mentioned, advanced node.js apps can require some non CF operations (typescript compiling, webpack building, etc). It's only after these operations occur that there's a nice compiled directory to use s3 deployment with. Would I be able incorporate non CF commands into the package stage? I guess I could always build my entire web source code as a local asset and then include a cdk template with codebuild that includes those commands in a buildspec. That's not much different than what I'm doing now in my pipeline. I suppose non CF operation support is a bit much :) Thanks! |
@jewelsjacobs since we are trying to be agnostic to programming languages/framework/build tools, our approach is that if you want something to be available during synthesis it needs to be there before you run So in the case of building websites, your approach is what we expect people to do: run some pre-synth commands that will produce the website (either in .zip format or just a "dist" directory) and then during synth, reference this artifact and let the CDK do it's work to package it and deploy it. Does that make sense? |
Thanks for your thoughtful response @eladb. Makes perfect sense! |
I really like the idea and it seems abstract enough to apply to any asset needing to be built and prepared prior to releasing. Is there any plan in place for implementing this? Is it planned for V2 or earlier? |
This is currently superseded by #3437 |
Following up on this comment, this issue is an initial spec for a new CLI command called (for now)
cdk package
.Similarly to the cloudformation package and sam package commands, the new
cdk package STACK
will:Currently this process is performed by
cdk deploy
. Decouplingpackage
fromdeploy
is required in order to mitigate risks related to runningdocker build
in an environment that has administrative privileges, and also to allow using of native cloudformation APIs for deployments, instead of requiring to run a container withcdk deploy
. This addresses users's concern around costs and constraints the administrative IAM role in remote accounts to the cloudformation service principal).Similar to the approach we took with
cdk synth
(which produces a cloud assembly as an output),cdk deploy
will automatically invokecdk package
but it will also be possible to invoke them independently (similar tocdk synth
). We can decide that if--app
points to an s3:// url,cdk deploy
will treat it as a ready-to-deploy template.The eventual flow will be:
The text was updated successfully, but these errors were encountered: