Skip to content

Instantly share code, notes, and snippets.

@dsandor
Created February 26, 2020 14:37
Show Gist options
  • Select an option

  • Save dsandor/14ed63cc84dae37ecde4ef922da1fea4 to your computer and use it in GitHub Desktop.

Select an option

Save dsandor/14ed63cc84dae37ecde4ef922da1fea4 to your computer and use it in GitHub Desktop.
HelloWorldApi:
Type: AWS::Serverless::Api
Properties:
Name: hello-world-api
StageName: v1
MethodSettings:
- LoggingLevel: INFO
ResourcePath: '/*' # allows logging on any resource
HttpMethod: '*' # allows logging on all methods
Cors:
AllowMethods: "'GET,OPTIONS,HEAD,POST,PUT,DELETE,CONNECT,PATCH'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,Accept,Origin,Referer,User-Agent'"
AllowOrigin: "'*'"
Auth:
AddDefaultAuthorizerToCorsPreflight: false
DefaultAuthorizer: RequestAuth
Authorizers:
RequestAuth:
FunctionPayloadType: REQUEST
FunctionArn: !GetAtt RequestAuthorizerFunction.Arn
Identity:
Headers:
- Authorization
ReauthorizeEvery: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment