Skip to content

Instantly share code, notes, and snippets.

@tkeeber
Created October 3, 2019 14:07
Show Gist options
  • Save tkeeber/d224d654257679ae9cbff33ea4ae5b9f to your computer and use it in GitHub Desktop.
Save tkeeber/d224d654257679ae9cbff33ea4ae5b9f to your computer and use it in GitHub Desktop.
ApiGateway:
Type: AWS::ApiGateway::RestApi
Properties:
EndpointConfiguration:
Types:
- 'REGIONAL'
Body:
swagger: '2.0'
info:
version: 'v1'
title: !Ref AWS::StackName
paths:
/newapi:
post:
responses:
'202':
description: Accepted
headers:
Access-Control-Allow-Origin:
type: 'string'
Access-Control-Allow-Methods:
type: 'string'
Access-Control-Allow-Headers:
type: 'string'
x-amazon-apigateway-integration:
type: 'AWS_PROXY'
httpMethod: 'POST'
uri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyLambda.Arn}/invocations'
responses:
default:
statusCode: '202'
responseParameters:
method.response.header.Access-Control-Allow-Methods: "'OPTIONS,POST'"
method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'"
method.response.header.Access-Control-Allow-Origin: "'*'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment