-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
154 lines (130 loc) · 5.75 KB
/
template.yaml
File metadata and controls
154 lines (130 loc) · 5.75 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
com.networknt.market-1.0.1
Sample SAM Template for com.networknt.market-1.0.1
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 20
Parameters:
ParamStage:
Type: String
Description: Deployment stage.
Default: test
ParamServiceId:
Type: String
Description: Unique service id for your application
Default: com.networknt.market-1.0.1
Resources:
MarketFunctionRole:
Type: AWS::IAM::Role
Properties:
RoleName: market-function-role
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action:
- "sts:AssumeRole"
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Policies:
- PolicyName: DirectInvokeMarketLambda
PolicyDocument:
Version: "2012-10-17"
Statement:
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Effect: Allow
Resource: "*"
MarketStoreProductsGetFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: MarketStoreProductsGetFunction
Handler: com.networknt.market.handler.App::handleRequest
Runtime: provided.al2023
MemorySize: 512
FunctionName: MarketStoreProductsGetFunction
Role: !Sub ${MarketFunctionRole.Arn}
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
MarketStoreProductsPostFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: MarketStoreProductsPostFunction
Handler: com.networknt.market.handler.App::handleRequest
Runtime: provided.al2023
MemorySize: 512
FunctionName: MarketStoreProductsPostFunction
Role: !Sub ${MarketFunctionRole.Arn}
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
MarketNativeLambdaProxyFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
# CodeUri: s3://networknt-native-lambda-jar-for-deployment-reference/lambda-native-custom-runtime.zip
CodeUri: s3://networknt-native-lambda-jar-for-deployment-reference/lambda-native-2.1.34-SNAPSHOT.jar
Handler: com.networknt.aws.lambda.app.LambdaApp::handleRequest
Layers:
- !Ref MarketConfigLayer
# Runtime: provided.al2023
Runtime: java11
MemorySize: 512
FunctionName: MarketNativeLambdaProxyFunction
Role: !Sub ${MarketFunctionRole.Arn}
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
JAVA_TOOL_OPTIONS: -Dlight-4j-config-dir=/opt
Events:
MarketHealthGet:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /health
Method: GET
MarketAdmHealthGet:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /adm/health
Method: GET
MarketAdmServerInfoGet:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /adm/server/info
Method: GET
MarketAdmLoggerGet:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /adm/logger
Method: GET
MarketAdmLoggerPost:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /adm/logger
Method: POST
MarketStoreProductsGet:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /market/{store}/products
Method: GET
MarketStoreProductsPost:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /market/{store}/products
Method: POST
MarketConfigLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: sam-app-market-config-layer
Description: Configuration for the market
ContentUri: config/
CompatibleRuntimes:
- java11
- java17
LicenseInfo: 'MIT'
RetentionPolicy: Retain