How to pass Header from Step function to API Gateway


Hello All,

I have a step function that calls a JIRA Create Issue REST API which is registered in the API gateway. The JIRA API requires an Authentication token to be passed as an Header.

However, when I invoke the API from the Step function, I am unable to pass the Authorization token to the Endpoint request header. Since the parameter "Authorization" is not allowed in the Step function, I had to provide a different parameter name.

I can see that, from CloudWatch logs, that the Authorization header is being passed to the Method request, but I am not able to map it to the Integration request.

Step function Definition:

{ "Comment": "Call the JIRA API", "StartAt": "Call Create Issue JIRA", "States": { "Call Create Issue JIRA": { "Type": "Task", "Resource": "arn:aws:states:::apigateway:invoke", "InputPath": "$", "Parameters": { "ApiEndpoint": "", "Method": "POST", "Stage": "stage", "Path": "createissue", "Headers": { "AuthCode": ["Basic <Authcode encoded in base64>"] }, "AuthType": "IAM_ROLE", "RequestBody.$": "$" }, "End": true } }

I have created the "AuthCode" in the HTTP header in Method Request of the API and mapped the same in the HTTP header section of the Integration request.

I could not see the HTTP header in the Endpoint request headers section.

I am new to this and learning as I go, so any help is appreciated on how to achieve this

1 Answer

Map of request query string parameters and headers that should be passed to the backend responder using request_parameters in api gateway integration . For example: request_parameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" },from%20the%20original%20API%20request.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions