Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run local #1

Merged
merged 3 commits into from
Sep 19, 2019
Merged

Run local #1

merged 3 commits into from
Sep 19, 2019

Conversation

sinistral
Copy link
Owner

An example of using CDK, SAM local (Lambda) and Step Functions local. Setup of SAM, SFn local and of course CDK is assumed.

This is a simple script to set up a local Step Functions and Lambda test
environment for a CDK-based project.  It assumed that the local Step Functions
and Lambda systems so graciously provided by AWS in the form the Step Functions
local Docker image (amazon/aws-stepfunctions-local), and the SAM CLI (for Lambda
local), have already been set up.

The State Machine definition is extracted from the `synth'd` CDK template,
localised and injected into the local environment.  If everythings comes up
successfully, it can simply be run using the ARN printed when it is created:

  aws --region eu-central-1 stepfunctions \
      --endpoint http://localhost:8083 \
      start-execution \
      --state-machine arn:aws:states:us-east-1:123456789012:stateMachine:BuildReleaseStateMachine165B927F \
      --input "$(cat event.json)"

See:
 * https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local.html
 * https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-config-options.html
 * https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-start-lambda.html
 * https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds
A `--no-staging` syth sets the asset path to the local Lambda deployment
packager, (rather than CDK's asset bundle), which local Lambda honours.

See: aws/aws-cdk#716 (comment)
@sinistral sinistral merged commit 34761e1 into master Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant