2

I am trying to locally test my step machine using SAM and the step function Docker for AWS and running into an error when loading my steps following these instructions.

Here's what I am loading:

aws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition "{\
    \"Comment\": \"Fetch from DB and pass to Lambda\",\
    \"StartAt\": \"GetWorkflowFromDb\",\
    \"States\": {\
      \"GetWorkflowFromDb\": {\
        \"Type\": \"Task\",\
        \"Resource\": \"arn:aws:dynamodb:us-east-1:11111111111:table/webhookDb\",\
        \"Parameters\": {\
            \"TableName\": \"webhookDb\",\
            \"Key\": null,\
            \"webhookId\": {\
            \"S\": \"$input.params('webhookId')\"\
            }\
        },\
        \"ResultPath\": \"$.DynamoDB\",\
        \"Next\": \"HandleWorkflow\"\
      }, \
      \"HandleWorkflow\": {\
        \"Type\": \"Task\",\
        \"Resource\": \"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:WebhookHandler\",\
        \"End\": true\
      }\
    }\
  }" --name "HelloWorld" --role-arn "arn:aws:iam::012345678901:role/DummyRole"

Which results in this error:

CreateStateMachine <= Invalid State Machine Definition: ''SCHEMA_VALIDATION_FAILED: Value is not a valid resource ARN at /States/GetWorkflowFromDb/Resource''

I have copied the ARN from my dynamoDB page. If I change my Dynamo ARN from arn:aws:dynamodb:us-east-1:11111111111:table/webhookDb to arn:aws:dynamodb:us-east-1:11111111111:table:webhookDb then the process takes but fails later saying the provided ARN is invalid. I have tried escaping the last slash (/) without success.

Can someone help shed some light on the issue?

cyberwombat
  • 38,105
  • 35
  • 175
  • 251

1 Answers1

1

Evidently the state machine code does not accept an actual DB Arn. It should be like this.

arn:aws:states:::dynamodb:getItem

Some examples here.

cyberwombat
  • 38,105
  • 35
  • 175
  • 251