-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
67 lines (67 loc) · 2.54 KB
/
Copy pathtemplate.yml
File metadata and controls
67 lines (67 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Lambda application that calls the Lambda API.
Globals:
Function:
Timeout: 20
Api:
Cors:
AllowMethods: "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
AllowOrigin: "'*'"
AllowCredentials: "'*'"
Resources:
OAuthDemoFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: build/distributions/aws-lambda-authentication-java.zip
Handler: authentication.AuthenticationRequestHandler::handleRequest
Runtime: java8
Description: Java function
MemorySize: 512
Timeout: 10
# Function's execution role
Policies:
- AWSLambdaBasicExecutionRole
- AWSLambda_ReadOnlyAccess
- AWSXrayWriteOnlyAccess
- AWSLambdaVPCAccessExecutionRole
Tracing: Active
Environment:
Variables:
COGNITO_DOMAIN_PREFIX: sunnyoauth
COGNITO_APP_ID: 1vvp0tt53g1uhntoa5bmvnvk2a
COGNITO_APP_SECRET: <secret>
CORS_ALLOW_ORIGIN: http://localhost:4200
#CORS_ALLOW_ORIGIN: http://oauthdemo2021.s3-website-us-east-1.amazonaws.com
LOGIN_REDIRECT_URL: http://localhost:4200
#LOGIN_REDIRECT_URL: http://oauthdemo2021.s3-website-us-east-1.amazonaws.com
Layers:
- !Ref libs
Events:
DemoAPI:
Type: Api
Properties:
Path: /{proxy+}
Method: any
libs:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: aws-lambda-authentication-java-lib
Description: Dependencies for the aws-lambda-authentication-java sample app.
ContentUri: build/aws-lambda-authentication-java-lib.zip
CompatibleRuntimes:
- java8
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
OAuthDemoApi:
Description: "API Gateway endpoint URL for Prod stage for OAuth Demo function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"
OAuthDemoFunction:
Description: "OAuth Demo Lambda Function ARN"
Value: !GetAtt OAuthDemoFunction.Arn
OAuthDemoFunctionIamRole:
Description: "Implicit IAM Role created for OAuth Demo function"
Value: !GetAtt OAuthDemoFunctionRole.Arn