GithubHelp home page GithubHelp logo

westonsteimel / aws-cdk-local Goto Github PK

View Code? Open in Web Editor NEW

This project forked from localstack/aws-cdk-local

0.0 1.0 0.0 48 KB

Thin wrapper script for using the AWS CDK CLI with LocalStack

License: Apache License 2.0

JavaScript 100.00%

aws-cdk-local's Introduction

AWS Cloud Development Kit (CDK) for LocalStack

This project provides a thin wrapper script cdklocal for using the AWS CDK library against local APIs provided by LocalStack.

Note: This project replaces the old (deprecated) repo which was a fork of the AWS CDK repo. Instead of forking the repo and applying changes, we now simply provide a simple wrapper script cdklocal which applies runtime patching. The advantage of the new approach is that you should be able to use arbitrary CDK versions under the cover.

Quick Installation

The cdklocal command line is published as an npm library:

$ npm install -g aws-cdk-local aws-cdk
...
$ cdklocal --version
1.65.5

Note: Starting with version 1.65.2, the dependency aws-cdk needs to be installed manually (to decouple the two libraries, and allow using arbitrary versions of aws-cdk under the covers).

(Note: Depending on your local setup, you may or may not have to use the global npm installation flag -g above.)

Configurations

The following environment variables can be configured:

  • EDGE_PORT: Port under which LocalStack edge service is accessible (default: 4566)
  • LOCALSTACK_HOSTNAME: Target host under which LocalStack edge service is accessible (default: localhost)
  • LAMBDA_MOUNT_CODE: Whether to use local Lambda code mounting (via setting __local__ S3 bucket name)

Deploying a Sample App

The CDK command line ships with a sample app generator to run a quick test for getting started:

$ mkdir /tmp/test; cd /tmp/test
$ cdklocal init sample-app --language=javascript
...

Make sure that LocalStack is installed and started up with the required services:

$ SERVICES=serverless,sqs,sns localstack start

Then deploy the sample app against the local APIs via the cdklocal command line:

$ 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

Once the deployment is done, you can inspect the created resources via the awslocal command line:

$ awslocal sns list-topics
{
    "Topics": [
        {
            "TopicArn": "arn:aws:sns:us-east-1:000000000000:TestStack-TestTopic339EC197-79F43WWCCS4Z"
        }
    ]
}

Change Log

  • 1.65.7: Add switch that checks for asset existence before symlinking assets; fix parsing fetched template body for JSON/YAML formats; add missing dependency to "diff" package
  • 1.65.6: Create symlinks to Lambda assets to enable persistent code mounting of Lambdas on "cdklocal synth"
  • 1.65.5: Add support for LAMBDA_MOUNT_CODE config to enable local Lambda code mounting
  • 1.65.4: Add support for large stacks by patching bucketUrl for ToolkitInfo
  • 1.65.2: Patch missing getPromise() in forceCredentialRetrieval; remove aws-cdk from npm dependencies
  • 1.65.1: Override BucketURL to use path style addressing
  • 1.65.0: Initial release

License

The AWS CDK is distributed under the Apache License, Version 2.0.

aws-cdk-local's People

Contributors

aminfazlmondo avatar martinjlowm avatar rehmanvirani-10p avatar thrau avatar ubaidbaig-10p avatar whummer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.