I'm attempting to setup aws CORS from the command line using aws-cli in a deployment script. I have created the POST Resource with the following perl to shell command. I'm attempting to set the integration-response to '*' much like enabling cores would do.
aws apigateway put-method-response \\
--region "$region" \\
--rest-api-id "$api_id" \\
--resource-id "$resource_id" \\
--http-method "POST" \\
--status-code 200 \\
--response-models '{"application/json":"Empty"}' \\
--response-parameters '{"method.response.header.Access-Control-Allow-Origin":true}'
When i run the following command to set the integration value.
aws apigateway put-integration-response \\
--region "$region" \\
--rest-api-id "$api_id" \\
--resource-id "$resource_id" \\
--http-method "$method" \\
--status-code 200 \\
--response-template '{"application/json":"Empty"}' \\
--response-parameters \\
'{"method.response.header.Access-Control-Allow-Origin": "'*'"}'
I get the following error.
A client error (BadRequestException) occurred when calling the PutIntegrationResponse operation: Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: *]
Can anyone tell me what this error is really referring to or even a better way to go about a api gateway deployment script.