-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.yml
57 lines (56 loc) · 1.72 KB
/
demo.yml
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
Transform: ["SamAlb", "AWS::Serverless-2016-10-31"]
Parameters:
ListenerArn:
Type: AWS::SSM::Parameter::Value<String>
Default: /SamAlbExample/ListenerArn
Resources:
FunctionA:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.7
Events:
Alb:
Type: ALB
Properties:
Oidc:
ClientId: '{{resolve:secretsmanager:GoogleOidc:SecretString:ClientId}}'
ClientSecret: '{{resolve:secretsmanager:GoogleOidc:SecretString:ClientSecret}}'
Issuer: https://accounts.google.com
Priority: 50
ListenerArn: !Ref ListenerArn
Conditions:
Host: [alb.ge.cx]
InlineCode: |
import json
def handler(event, context):
return {
"isBase64Encoded": False,
"statusCode": 200,
"statusDescription": "200 OK",
"headers": {"Content-Type": "application/json"},
"body": json.dumps(event, default=str)
}
FunctionB:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.7
Events:
PathAlb:
Type: ALB
Properties:
Priority: 30
ListenerArn: !Ref ListenerArn
Conditions:
Host: [alb.ge.cx]
Path: [/example]
InlineCode: |
def handler(event, context):
return {
"isBase64Encoded": False,
"statusCode": 200,
"statusDescription": "200 OK",
"headers": {"Content-Type": "text/plain"},
"body": "Goodbye from Lambda"
}