-
Notifications
You must be signed in to change notification settings - Fork 272
/
Copy pathtemplate.yaml
245 lines (244 loc) · 8.38 KB
/
template.yaml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
Resources:
HitsFF5AF8CD:
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: path
KeyType: HASH
AttributeDefinitions:
- AttributeName: path
AttributeType: S
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/Hits/Resource
DynamoLambdaHandlerServiceRole4C867B01:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: lambda.amazonaws.com
Version: "2012-10-17"
ManagedPolicyArns:
- Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/DynamoLambdaHandler/ServiceRole/Resource
DynamoLambdaHandlerServiceRoleDefaultPolicy2B40B090:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- dynamodb:BatchGetItem
- dynamodb:GetRecords
- dynamodb:GetShardIterator
- dynamodb:Query
- dynamodb:GetItem
- dynamodb:Scan
- dynamodb:BatchWriteItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Effect: Allow
Resource:
- Fn::GetAtt:
- HitsFF5AF8CD
- Arn
- Ref: AWS::NoValue
Version: "2012-10-17"
PolicyName: DynamoLambdaHandlerServiceRoleDefaultPolicy2B40B090
Roles:
- Ref: DynamoLambdaHandlerServiceRole4C867B01
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/DynamoLambdaHandler/ServiceRole/DefaultPolicy/Resource
DynamoLambdaHandlerFB6EB814:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket:
Ref: AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fS3BucketF2AE302C
S3Key:
Fn::Join:
- ""
- - Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fS3VersionKeyE28EE2B1
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fS3VersionKeyE28EE2B1
Handler: lambda.handler
Role:
Fn::GetAtt:
- DynamoLambdaHandlerServiceRole4C867B01
- Arn
Runtime: nodejs12.x
Environment:
Variables:
HITS_TABLE_NAME:
Ref: HitsFF5AF8CD
DependsOn:
- DynamoLambdaHandlerServiceRoleDefaultPolicy2B40B090
- DynamoLambdaHandlerServiceRole4C867B01
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/DynamoLambdaHandler/Resource
aws:asset:path: asset.174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08f
aws:asset:property: Code
DynamoLambdaHandlerTheSimpleWebserviceStackEndpointDefaultRouteC99962AAPermission5EE3812D:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName:
Fn::GetAtt:
- DynamoLambdaHandlerFB6EB814
- Arn
Principal: apigateway.amazonaws.com
SourceArn:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":execute-api:"
- Ref: AWS::Region
- ":"
- Ref: AWS::AccountId
- ":"
- Ref: EndpointEEF1FD8F
- /*/*
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/DynamoLambdaHandler/TheSimpleWebserviceStackEndpointDefaultRouteC99962AA-Permission
EndpointEEF1FD8F:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: Endpoint
ProtocolType: HTTP
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/Endpoint/Resource
EndpointDefaultRouteDefaultRouteIntegration4584A785:
Type: AWS::ApiGatewayV2::Integration
Properties:
ApiId:
Ref: EndpointEEF1FD8F
IntegrationType: AWS_PROXY
IntegrationUri:
Fn::GetAtt:
- DynamoLambdaHandlerFB6EB814
- Arn
PayloadFormatVersion: "2.0"
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/Endpoint/DefaultRoute/DefaultRoute-Integration/Resource
EndpointDefaultRouteB7B22F2B:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
Ref: EndpointEEF1FD8F
RouteKey: $default
Target:
Fn::Join:
- ""
- - integrations/
- Ref: EndpointDefaultRouteDefaultRouteIntegration4584A785
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/Endpoint/DefaultRoute/Resource
EndpointDefaultStage0AD21F27:
Type: AWS::ApiGatewayV2::Stage
Properties:
ApiId:
Ref: EndpointEEF1FD8F
StageName: $default
AutoDeploy: true
Metadata:
aws:cdk:path: TheSimpleWebserviceStack/Endpoint/DefaultStage/Resource
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Modules: aws-cdk=1.36.1,@aws-cdk/assets=1.37.0,@aws-cdk/aws-apigatewayv2=1.37.0,@aws-cdk/aws-applicationautoscaling=1.37.0,@aws-cdk/aws-autoscaling-common=1.37.0,@aws-cdk/aws-cloudwatch=1.37.0,@aws-cdk/aws-dynamodb=1.37.0,@aws-cdk/aws-ec2=1.37.0,@aws-cdk/aws-events=1.37.0,@aws-cdk/aws-iam=1.37.0,@aws-cdk/aws-kms=1.37.0,@aws-cdk/aws-lambda=1.37.0,@aws-cdk/aws-logs=1.37.0,@aws-cdk/aws-s3=1.37.0,@aws-cdk/aws-s3-assets=1.37.0,@aws-cdk/aws-sqs=1.37.0,@aws-cdk/aws-ssm=1.37.0,@aws-cdk/cloud-assembly-schema=1.37.0,@aws-cdk/core=1.37.0,@aws-cdk/custom-resources=1.37.0,@aws-cdk/cx-api=1.37.0,@aws-cdk/region-info=1.37.0,jsii-runtime=node.js/v13.12.0
Condition: CDKMetadataAvailable
Parameters:
AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fS3BucketF2AE302C:
Type: String
Description: S3 bucket for asset "174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08f"
AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fS3VersionKeyE28EE2B1:
Type: String
Description: S3 key for asset version "174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08f"
AssetParameters174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08fArtifactHash8DEFF75F:
Type: String
Description: Artifact hash for asset "174026f443aa8b39aca679cba1932daa64eefd69f09bb93d77dd34b362f7b08f"
Conditions:
CDKMetadataAvailable:
Fn::Or:
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- ap-east-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-2
- Fn::Equals:
- Ref: AWS::Region
- ap-south-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-2
- Fn::Equals:
- Ref: AWS::Region
- ca-central-1
- Fn::Equals:
- Ref: AWS::Region
- cn-north-1
- Fn::Equals:
- Ref: AWS::Region
- cn-northwest-1
- Fn::Equals:
- Ref: AWS::Region
- eu-central-1
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- eu-north-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-2
- Fn::Equals:
- Ref: AWS::Region
- eu-west-3
- Fn::Equals:
- Ref: AWS::Region
- me-south-1
- Fn::Equals:
- Ref: AWS::Region
- sa-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-2
- Fn::Equals:
- Ref: AWS::Region
- us-west-1
- Fn::Equals:
- Ref: AWS::Region
- us-west-2