Skip to content

Files

Latest commit

56576e2 · Jun 20, 2023

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023
Jun 20, 2023

LocalStack Demo: Deploying Resources via CDK

Simple demo application illustrating deployment of AWS resources using CDK for Terraform.

Prerequisites

Install dependencies

To install the dependencies, run the following command:

pipenv install

Generate CDK for Terraform

To generate CDK for Terraform constructs for Terraform providers and modules used in the project, run the following command:

cdktf get

To compile and generate Terraform configuration, run the following command:

cdktf synth

The above command will create a folder called cdktf.out that contains all Terraform JSON configuration that was generated.

Deploy the stack

To deploy the stack, run the following command:

cdktf deploy

Configuration

LocalStack currently does not provide a wrapper (similar to cdklocal or tflocal) to run CDK for Terraform. Therefore, you need to configure the AWS provider to redirect requests to the LocalStack API (http://localhost:4566 by default), using Terraform Override mechanism. Check the localstack_config.py file for an example.