Libertatem
Libertatem

Reputation: 91

cdk watch command never returns

I'm following the workshop provided by aws, https://cdkworkshop.com/20-typescript/30-hello-cdk/300-cdk-watch.html. When I issue

$ cdk watch

After the command is succeeded, it never returns. I can see that the new function is deployed correctly on the aws console. But it seems like it didn't finish normally. When I issue

$ cdk deploy --hotswap

I get no error. It deploys and returns cleanly.

Anyone knows or experiences the same?

enter image description here

Upvotes: 1

Views: 630

Answers (1)

fedonev
fedonev

Reputation: 25639

This is the expected behaviour. "watch mode (cdk deploy --watch, or cdk watch for short) continuously monitors your CDK app's source files and assets for changes and immediately performs a deployment of the specified stacks when a change is detected".

Watch mode is a common CLI idiom. Typescript's tsc --watch, works similarly, for instance, continuously compiling to js as you make changes.

Upvotes: 3

Related Questions