Skip to content

Instantly share code, notes, and snippets.

@rockey5520
Created January 26, 2021 02:20
Show Gist options
  • Save rockey5520/8d9ae3828075149b40a31c6acad68476 to your computer and use it in GitHub Desktop.
Save rockey5520/8d9ae3828075149b40a31c6acad68476 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
StageName:
Type: String
Default: Prod
Globals:
Function:
Timeout: 180
Resources:
AFunction:
Type: AWS::Serverless::Function
Properties:
Handler: finapi.StreamLambdaHandler::handleRequest
Runtime: java11
CodeUri: api
MemorySize: 2048
Events:
HttpApiEvent:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Method: Any
Path: $default
TimeoutInMillis: 30000
PayloadFormatVersion: '1.0'
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
Tags:
Tag: Value
AccessLogSettings:
DestinationArn: !GetAtt AccessLogs.Arn
Format: $context.requestId
DefaultRouteSettings:
ThrottlingBurstLimit: 200
StageVariables:
StageVar: Value
FailOnWarnings: True
Auth:
Authorizers:
MyOauthAuthorizer:
IdentitySource: $request.header.Authorization
JwtConfiguration:
audience:
- https://aws-api-gateway
issuer: "https://XXX.com/"
DefaultAuthorizer: MyOauthAuthorizer
AccessLogs:
Type: AWS::Logs::LogGroup
Outputs:
AFunctionApi:
Description: URL for application
Value: !Sub 'https://${HttpApi}.execute-api.${AWS::Region}.amazonaws.com'
Export:
Name: AFunctionApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment