domingo, 2 de noviembre de 2025

CDK migrate, a way to migrate your cloudformation template to cdk code

 The migration from the CloudFormation template to the CDK is done with a single command: cdk migrate. Simply point to the local CloudFormation template file (let’s call it demo-template.yaml), and watch as the CLI converts the template into a CDK application. The output and result from running the command will be a directory comprised of the CDK code and dependencies, but will not deploy the stack.

You can grab the template code from cloudformation. 

cdk migrate --stack-name CdkStack --language python --from-path cleaned_template.json

 

After that the template is under cdk_stack.

 

 

Run the code to see the cdk.out code generated.

source .venv/bin/activate
pip install -r CdkStack/requirements.txt 

cd CdkStack
cdk deploy 

 

 

No hay comentarios:

Publicar un comentario