1 Answer
- Newest
- Most votes
- Most comments
-1
To address the issue you're encountering with using JsonPath references in the ApiEndpoint
field of an AWS Step Functions state, Ensure your state definition is correctly formatted. Here’s an example that should work:
{ "StartAt": "InvokeAPI", "States": { "InvokeAPI": { "Type": "Task", "Resource": "arn:aws:states:::apigateway:invoke", "Parameters": { "ApiEndpoint.$": "States.Format('https://api.stripe.com/v1/customers/{}', $.customer_id)", "Method": "GET", "Headers": { "Authorization.$": "States.Format('Bearer {}', $.auth_token)" } }, "End": true } } }
answered a month ago
Relevant content
- asked 10 months ago
Thank you for your response and the example Step Function definition. I followed your example, but I'm still encountering the same error. To simplify and isolate the issue, I removed the 'Headers' attribute from my 'InvokeAPI' state and kept only the 'ApiEndpoint' with the JsonPath reference.
Here's the simplified definition of my state:
The error I continue to receive is:
As you can see, even with the simplified configuration, the error persists, indicating that the problem seems to be specifically related to the use of JsonPath in the 'ApiEndpoint' attribute. The value of 'customer_id' is being correctly substituted within States.Format, but ApiGateway does not accept the final value.
Any ideas why this might be happening or if there are any additional config