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"

질문됨 2년 전702회 조회
1개 답변
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
AWS
지원 엔지니어
Tim_P
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠