Skip to content

Instantly share code, notes, and snippets.

@rockey5520
Created January 19, 2021 12:44
Show Gist options
  • Save rockey5520/a654124bb6b891ce329470f1c0d63474 to your computer and use it in GitHub Desktop.
Save rockey5520/a654124bb6b891ce329470f1c0d63474 to your computer and use it in GitHub Desktop.
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
StageName:
Type: String
Default: Prod
Description: XXX
Globals:
Function:
Timeout: 180
HttpApi:
Auth:
Authorizers:
MyOauthAuthorizer:
IdentitySource: $request.header.Authorization
JwtConfiguration:
audience:
- https://awsgateway
issuer: "https://xxx.xx.com/"
DefaultAuthorizer: MyOauthAuthorizer
Resources:
API:
Type: AWS::Serverless::HttpApi
Properties:
StageName: !Ref StageName
XFunction:
Type: AWS::Serverless::Function
Properties:
Handler: xxx.StreamLambdaHandler::handleRequest
Runtime: java11
CodeUri: CoreApi
MemorySize: 2048
Role: arn:aws:iam::XXXX:role/ZZZZZ
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
PARAM1: VALUE
Events:
HttpApiEvent:
Type: HttpApi
Properties:
TimeoutInMillis: 20000
PayloadFormatVersion: '1.0'
Outputs:
XFunctionApi:
Description: URL for application
Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com'
Export:
Name: XFunctionApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment