### Install aws-cdk-local and aws-cdk Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md Install the `cdklocal` command-line tool globally using npm. Ensure `aws-cdk` is also installed, as it's a required peer dependency for versions 1.65.2 and above. ```bash $ npm install -g aws-cdk-local aws-cdk ``` -------------------------------- ### Start LocalStack Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md Ensure LocalStack is running before deploying your application. ```bash $ localstack start ``` -------------------------------- ### Set NODE_PATH for Mac OS Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md On Mac OS, if you encounter a `MODULE_NOT_FOUND` error, set the `NODE_PATH` environment variable to include the `node_modules` directory of your AWS CDK installation. Replace `` with your installed AWS CDK version. ```bash $ export NODE_PATH=$NODE_PATH:/opt/homebrew/Cellar/aws-cdk//libexec/lib/node_modules ``` -------------------------------- ### Verify cdklocal version Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md Check the installed version of the `cdklocal` command-line tool. ```bash $ cdklocal --version 1.65.5 ``` -------------------------------- ### Initialize Sample CDK App Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md Use this command to create a new sample application project for testing with CDK. ```bash $ mkdir /tmp/test; cd /tmp/test $ cdklocal init sample-app --language=javascript ... ``` -------------------------------- ### Deploy Sample App with cdklocal Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md Deploy the initialized sample application to your LocalStack environment. You will be prompted to confirm the deployment. ```bash $ cdklocal deploy ... Do you wish to deploy these changes (y/n)? y ... Stack ARN: arn:aws:cloudformation:us-east-1:000000000000:stack/TestStack/e3debc0a-311e-4968-8230-ed78f89cb614 ``` -------------------------------- ### Inspect SNS Topics with awslocal Source: https://github.com/localstack/aws-cdk-local/blob/main/README.md After deployment, use `awslocal` to inspect resources like SNS topics created by the sample app. ```bash $ awslocal sns list-topics { "Topics": [ { "TopicArn": "arn:aws:sns:us-east-1:000000000000:TestStack-TestTopic339EC197-79F43WWCCS4Z" } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.