By using AWS re:Post, you agree to the Terms of Use
/Can not create a stepfunction with create-state-machine command in docker-compose/

Can not create a stepfunction with create-state-machine command in docker-compose

0

Hi, I am trying to create a step function in local using step-function-local docker images and ones the step function is created, I am using aws-cli docker image to create state machine, but I would like the aws-cli container to be alive so that I can do testing in my local environment, I tried setting tty option to true but that doesn't work. please help with achieving this, here is my docker-compose file.

version: "3.9"
services:
  dynamo-db:
    image: "amazon/dynamodb-local"
    ports:
      - "8000:8000"

  step-function:
    image: "amazon/aws-stepfunctions-local"
    environment:
      - AWS_ACCESS_KEY_ID=<access-key>
      - AWS_SECRET_ACCESS_KEY=<secret-key>
    ports:
      - "8083:8083"
  state-machine:
    image: amazon/aws-cli:latest
    stdin_open: true # equivalent of -i
    tty: true        # equivalent of -t
    network_mode: host
    #entrypoint: tail -F anything
    depends_on:
      - step-function
    deploy:
      mode: replicated
      replicas: 1
      resources:
        limits:
          cpus: "2"
          memory: 2048M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
    env_file:
      - aws-stepfunctions-local-credentials.txt
    volumes:
      - ./config:/config
    command: stepfunctions --endpoint http://localhost:8083 create-state-machine --definition file:///config/<file-name> --name test --role-arn "arn:aws:iam::123456789012:role/HelloWorldFunctionRole"
1 Answers
0

Hello,

As docker isn’t an AWS service I may not be able to help debug the docker file itself, however I did find our documentation on setting up step function local with docker and how to test this:

I’d recommend taking a peek at our documentation and seeing if you can scaffold a solution from within it. It can be hard to determine what is occurring since we have three items in play:

  • Your local machines setup
  • Docker
  • Step Function Local
SUPPORT ENGINEER
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions