Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

333
Visualizações
Is there a way of running AWS Step Functions locally when defined by CDK?

AWS Step Functions may be run in a local Docker environment using Step Functions Local Docker. However, the step functions need to be defined using the JSON-based Amazon States Language. This is not at all convenient if your AWS infrastructure (Step Functions plus lambdas) is defined using AWS CDK/CloudFormation.

Is there a way to create the Amazon States Language definition of a state machine from the CDK or CloudFormation output, such that it’s possible to run the step functions locally?

My development cycle is currently taking me 30 minutes to build/deploy/run my Lambda-based step functions in AWS in order to test them and there must surely be a better/faster way of testing them than this.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You can use cdk watch or the --hotswap option to deploy your updated state machine or Lambda functions without a CloudFormation deployment.

https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/

If you want to test with Step Functions local, cdk synth generates the CloudFormation code containing the state machine's ASL JSON definition. If you get that and replace the CloudFormation references and intrinsic functions, you can use it to create and execute the state machine in Step Functions Local.

How some people have automated this:

  • https://nathanagez.com/blog/mocking-service-integration-step-functions-local-cdk/
  • https://github.com/kenfdev/step-functions-testing
over 4 years ago · Santiago Trujillo Relatório

0

We have been able to achieve this by the following:

Download:

https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local.html

To run step functions local, in the directory where you extracted the local Step Function files run:

java -jar StepFunctionsLocal.jar --lambda-endpoint http://localhost:3003

To create a state machine, you need a json definition (It can be pulled from the generated template or can get the toolkit plug in for Vs code, type step functions, select from a template and that can be your starter. Can also get it from the AWS console in the definition tab on the step function.

Run this command in the same directory as the definition json:

aws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition "cat step-function.json" --name "local-state-machine" --role-arn "arn:aws:iam::012345678901:role/DummyRole"

You should be able to hit the SF now (hopefully) :)

over 4 years ago · Santiago Trujillo Relatório

0

Another solution that might help is to use localstack what is supports many tools such CDK or CloudFormation and let developers to run stack locally.

There are a variety ways to run it, one of them is to run it manually in docker container, according to the instruction get started.

Next following the instruction what's next configure aws-cli or use awslocal.

All next steps and templates should be the same as for AWS API in the cloud.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda