Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

682
Views
AWS CDK Init for an existing project

I'm trying to initialize the AWS CDK on a new website I just created via Visual Studio.

But when I run the init commmand I get the error: cdk init cannot be run in a non-empty directory

❯ cdk init app --language=csharp
`cdk init` cannot be run in a non-empty directory!

The CDK Workshop uses the example of starting from scrach (in an empty directory).

Is it possible to initialize the CDK inside an existing solution/project?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

cdk init creats a basic structure and skelton such as app and sub directory in which it create a stack.

You can run it in a empty directory and then back up the files you will override, then copy an actual cdk application/project (such as workshop one) into it.

I use this way to create another CDK project when I re-use the existing one.

over 4 years ago · Santiago Trujillo Report

0

At the moment there is no way to execute cdk init in a non-empty directory. This is a safety net against cluttering a directory with the CDK files where they might not be wanted.

That said, there is no practical reason a command flag to override this protection couldnt be added. You could consider putting in a feature-request on the repo.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!