Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS CLI – Get error in create-state-machine –definition

I have a file that I exported from a Step Function in JSON format, and I made some modifications. I’m trying to create another Step Function using the AWS CLI, but I always receive an error:

Command:
aws stepfunctions create-state-machine --name 'firstStep' --definition .\CriarContaFaturamento-PrimeiraEtapa.asl.json --role-arn arn:aws:iam::xxxxxxxxxxxxx:role/aws-stepfunctions-xxxxxxx-dev-default --profile xxx --region us-east-1
Error:
An error occurred (InvalidDefinition) when calling the CreateStateMachine operation: Invalid State Machine Definition: 'INVALID_JSON_DESCRIPTION: Unexpected character ('.' (code 46)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)".\CriarContaFaturamento-PrimeiraEtapa.asl.json"; line: 1, column: 2] at [Source: (String)".\CriarContaFaturamento-PrimeiraEtapa.asl.json"; line: 1, column: 2]'

Do you know what might be wrong with the definition and what I could do to resolve it?
Im using powershell, but i tried in CMD and i got the same error.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Unexpected character ‘.’ suggests me the command line didn’t parse your .\CriarContaFaturamento-PrimeiraEtapa.asl.json instruction. Have your tried something like:

$ aws stepfunctions create-state-machine --name 'state-machine-name' --definition file://CriarContaFaturamento-PrimeiraEtapa.asl.json --role-arn arn:aws:iam::xxxxxxxxxxxxx:role/aws-stepfunctions-xxxxxxx-dev-default --profile xxx --region us-east-1
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading