Can not create a stepfunction with create-state-machine command in docker-compose
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"
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:
Setting Up Step Functions Local (Downloadable Version) and Docker - https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-docker.html
Setting Configuration Options for Step Functions Local - https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-config-options.html
Testing Step Functions State Machines Locally - https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local.html
Testing Step Functions and AWS SAM CLI Local - https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-lambda.html
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
Relevant questions
Can I specify GET URL path parameter in step function?
asked 2 months agohow to trigger a step function from a s3 object notification?
asked a month agoHow do I use Step Functions to create EMR clusters with different specifications?
Accepted Answerasked 2 years agoSpecifying Execution Name for Nested Step Functions
asked 2 years agoInvalid security token error when executing nested step function on Step Functions Local
asked 15 hours agoMultiple images in a HIT with python API
asked 3 years agoCan not create a stepfunction with create-state-machine command in docker-compose
asked 4 months agoTrigger Step Function with API Gateway and use Fargate within Step Function?
asked a month ago403 creating java lambda function
asked 4 months agoStep Function to Send Email on Error/Success
asked 4 months ago