Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS-CDK Pipelines trigger deployment from local terminal

Currently I'm using @aws-cdk/pipelines package for quick and easy setup of CI/CD for my service.

However during the experimentation/development phase, I would like to manually call cdk deploy for my stack with business logic components, so the deployment loop would be a lot faster, as I don't need pipeline self-mutation steps and also I don't want to push everything to repository each time.

Unfortunately I'm not able to achieve this. After trying to call manually npx cdk deploy command in the repository root folder, it's simply deploying the stack, that contains the pipeline resources.

I was also trying to achieve this by calling stack name directly:

npx cdk deploy -c config=dev <full-stack-name>

And it fails with No stacks match the name(s) [...] message.

Is this possible? I believe it's quite important use case, since deploying through proper CI/CD pipeline takes at least 2-3 minutes and it ruins my focus.

like image 402
PatrykMilewski Avatar asked Oct 26 '25 08:10

PatrykMilewski


1 Answers

As an alternative to creating a separate app, you can also deploy the stacks directly. To get the stack name, use cdk ls. It will be <Pipeline Name>/<Stage Name>/<Stack name>.

Also, you can deploy the whole stage manually with

cdk deploy "<Pipeline Name>/<Stage Name>"
like image 122
gshpychka Avatar answered Oct 28 '25 23:10

gshpychka