UNPKG

aws-lager

Version:

AWS Lambda / API Gateway / Endpoint Router

50 lines (49 loc) 1.9 kB
{ "x-lager": { "lambda": "sample-lambda-a", "lambdaInvocationRole": "LambdaInvocationSample", "apis": ["my-sample-api", "another-sample-api"] }, "produces": ["application/json"], "responses": { "200": { "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } }, "404": { "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } }, "x-amazon-apigateway-integration": { "type": "aws", "uri": "arn:aws:apigateway:{{ REGION }}:lambda:path/2015-03-31/functions/{{ LAMBDA_ARN }}/invocations", "httpMethod": "POST", "credentials": "arn:aws:iam::856019870963:role/NO_ENV/NO_ENV_LambdaInvocationSample", "requestTemplates": { "application/json": "{\"endpoint\": {\"path\": \"$context.resourcePath\", \"method\": \"$context.httpMethod\"}, \"cognitoIdentityPoolId\": \"$context.identity.cognitoIdentityPoolId\", \"cognitoIdentityId\": \"$context.identity.cognitoIdentityId\", \"id\": \"$input.params('id')\", \"body\": $input.json('$') }" }, "requestParameters": {}, "cacheNamespace": "cache-namespace", "cacheKeyParameters": [], "responses": { "default": { "statusCode": "200", "responseParameters": { "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,x-amz-security-token'", "method.response.header.Access-Control-Allow-Methods": "'*'", "method.response.header.Access-Control-Allow-Origin": "'*'" }, "responseTemplates": { "application/json": null } } } } }