I'm new to AWS. I want to add header parameters to my HTTP request. I tried the below command in CloudShell but it was not working.
aws apigatewayv2 update-integration --integration-id xxx --api-id xxxxx --request-parameters 'integration.request.header.Some-Header-Param'= 'SomeText'
It is giving the below error:
An error occurred (BadRequestException) when calling the UpdateIntegration operation: Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: SomeText]
After Searching for while I found the Answer from https://repost.aws/knowledge-center/api-gateway-vpc-link-integration
aws apigatewayv2 get-integrations --api-id <api-id>
{ "ApiId": "<api-id>", "IntegrationId": "<integration id retrieved from previous step>", "RequestParameters": { "integration.request.header.ConnectionId": "context.connectionId", //passing context variable connectionId as ConnectionId header to backend "integration.request.header.any-header-key": "''static value'", //passing static value as querystring to backend "integration.request.querystring.any-querystring-key": "'static value'" } } ```
aws apigatewayv2 update-integration --cli-input-json file://integration.json