@aws-solutions-constructs/aws-lambda-elasticachememcached 1.153.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.jsii +1979 -0
- package/README.md +120 -0
- package/architecture.png +0 -0
- package/lib/index.d.ts +81 -0
- package/lib/index.js +67 -0
- package/package.json +97 -0
- package/test/integ.existingResources.d.ts +13 -0
- package/test/integ.existingResources.expected.json +622 -0
- package/test/integ.existingResources.js +52 -0
- package/test/integ.newResources.d.ts +13 -0
- package/test/integ.newResources.expected.json +638 -0
- package/test/integ.newResources.js +35 -0
- package/test/integ.withClientProps.d.ts +13 -0
- package/test/integ.withClientProps.expected.json +638 -0
- package/test/integ.withClientProps.js +41 -0
- package/test/lambda/index.js +8 -0
- package/test/lambda-elasticachememcached.test.d.ts +13 -0
- package/test/lambda-elasticachememcached.test.js +318 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Description": "Integration Test with new resourcesfor aws-lambda-elasticachememcached",
|
|
3
|
+
"Resources": {
|
|
4
|
+
"testtestcachesg9F6CF9E2": {
|
|
5
|
+
"Type": "AWS::EC2::SecurityGroup",
|
|
6
|
+
"Properties": {
|
|
7
|
+
"GroupDescription": "withClientProps/test/test-cachesg",
|
|
8
|
+
"SecurityGroupEgress": [
|
|
9
|
+
{
|
|
10
|
+
"CidrIp": "0.0.0.0/0",
|
|
11
|
+
"Description": "Allow all outbound traffic by default",
|
|
12
|
+
"IpProtocol": "-1"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"VpcId": {
|
|
16
|
+
"Ref": "Vpc8378EB38"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"Metadata": {
|
|
20
|
+
"cfn_nag": {
|
|
21
|
+
"rules_to_suppress": [
|
|
22
|
+
{
|
|
23
|
+
"id": "W5",
|
|
24
|
+
"reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "W40",
|
|
28
|
+
"reason": "Egress IPProtocol of -1 is default and generally considered OK"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"testtestingress291C0179": {
|
|
35
|
+
"Type": "AWS::EC2::SecurityGroupIngress",
|
|
36
|
+
"Properties": {
|
|
37
|
+
"IpProtocol": "TCP",
|
|
38
|
+
"Description": "Self referencing rule to control access to Elasticache memcached cluster",
|
|
39
|
+
"FromPort": 11222,
|
|
40
|
+
"GroupId": {
|
|
41
|
+
"Fn::GetAtt": [
|
|
42
|
+
"testtestcachesg9F6CF9E2",
|
|
43
|
+
"GroupId"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"SourceSecurityGroupId": {
|
|
47
|
+
"Fn::GetAtt": [
|
|
48
|
+
"testtestcachesg9F6CF9E2",
|
|
49
|
+
"GroupId"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"ToPort": 11222
|
|
53
|
+
},
|
|
54
|
+
"DependsOn": [
|
|
55
|
+
"testtestcachesg9F6CF9E2"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"testecsubnetgrouptest868C53AE": {
|
|
59
|
+
"Type": "AWS::ElastiCache::SubnetGroup",
|
|
60
|
+
"Properties": {
|
|
61
|
+
"Description": "Solutions Constructs generated Cache Subnet Group",
|
|
62
|
+
"SubnetIds": [
|
|
63
|
+
{
|
|
64
|
+
"Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"Ref": "VpcisolatedSubnet2Subnet39217055"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"Ref": "VpcisolatedSubnet3Subnet44F2537D"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"CacheSubnetGroupName": "test-subnet-group"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"testtestcluster57FB8D14": {
|
|
77
|
+
"Type": "AWS::ElastiCache::CacheCluster",
|
|
78
|
+
"Properties": {
|
|
79
|
+
"CacheNodeType": "cache.t3.medium",
|
|
80
|
+
"Engine": "memcached",
|
|
81
|
+
"NumCacheNodes": 2,
|
|
82
|
+
"AZMode": "single-az",
|
|
83
|
+
"CacheSubnetGroupName": "test-subnet-group",
|
|
84
|
+
"ClusterName": "test-cdk-cluster",
|
|
85
|
+
"Port": 11222,
|
|
86
|
+
"VpcSecurityGroupIds": [
|
|
87
|
+
{
|
|
88
|
+
"Fn::GetAtt": [
|
|
89
|
+
"testtestcachesg9F6CF9E2",
|
|
90
|
+
"GroupId"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"DependsOn": [
|
|
96
|
+
"testecsubnetgrouptest868C53AE"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"testLambdaFunctionServiceRoleA03EDA2B": {
|
|
100
|
+
"Type": "AWS::IAM::Role",
|
|
101
|
+
"Properties": {
|
|
102
|
+
"AssumeRolePolicyDocument": {
|
|
103
|
+
"Statement": [
|
|
104
|
+
{
|
|
105
|
+
"Action": "sts:AssumeRole",
|
|
106
|
+
"Effect": "Allow",
|
|
107
|
+
"Principal": {
|
|
108
|
+
"Service": "lambda.amazonaws.com"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"Version": "2012-10-17"
|
|
113
|
+
},
|
|
114
|
+
"Policies": [
|
|
115
|
+
{
|
|
116
|
+
"PolicyDocument": {
|
|
117
|
+
"Statement": [
|
|
118
|
+
{
|
|
119
|
+
"Action": [
|
|
120
|
+
"logs:CreateLogGroup",
|
|
121
|
+
"logs:CreateLogStream",
|
|
122
|
+
"logs:PutLogEvents"
|
|
123
|
+
],
|
|
124
|
+
"Effect": "Allow",
|
|
125
|
+
"Resource": {
|
|
126
|
+
"Fn::Join": [
|
|
127
|
+
"",
|
|
128
|
+
[
|
|
129
|
+
"arn:",
|
|
130
|
+
{
|
|
131
|
+
"Ref": "AWS::Partition"
|
|
132
|
+
},
|
|
133
|
+
":logs:",
|
|
134
|
+
{
|
|
135
|
+
"Ref": "AWS::Region"
|
|
136
|
+
},
|
|
137
|
+
":",
|
|
138
|
+
{
|
|
139
|
+
"Ref": "AWS::AccountId"
|
|
140
|
+
},
|
|
141
|
+
":log-group:/aws/lambda/*"
|
|
142
|
+
]
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"Version": "2012-10-17"
|
|
148
|
+
},
|
|
149
|
+
"PolicyName": "LambdaFunctionServiceRolePolicy"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"testLambdaFunctionServiceRoleDefaultPolicy4F560EE3": {
|
|
155
|
+
"Type": "AWS::IAM::Policy",
|
|
156
|
+
"Properties": {
|
|
157
|
+
"PolicyDocument": {
|
|
158
|
+
"Statement": [
|
|
159
|
+
{
|
|
160
|
+
"Action": [
|
|
161
|
+
"ec2:CreateNetworkInterface",
|
|
162
|
+
"ec2:DescribeNetworkInterfaces",
|
|
163
|
+
"ec2:DeleteNetworkInterface",
|
|
164
|
+
"ec2:AssignPrivateIpAddresses",
|
|
165
|
+
"ec2:UnassignPrivateIpAddresses"
|
|
166
|
+
],
|
|
167
|
+
"Effect": "Allow",
|
|
168
|
+
"Resource": "*"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"Action": [
|
|
172
|
+
"xray:PutTraceSegments",
|
|
173
|
+
"xray:PutTelemetryRecords"
|
|
174
|
+
],
|
|
175
|
+
"Effect": "Allow",
|
|
176
|
+
"Resource": "*"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"Version": "2012-10-17"
|
|
180
|
+
},
|
|
181
|
+
"PolicyName": "testLambdaFunctionServiceRoleDefaultPolicy4F560EE3",
|
|
182
|
+
"Roles": [
|
|
183
|
+
{
|
|
184
|
+
"Ref": "testLambdaFunctionServiceRoleA03EDA2B"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"Metadata": {
|
|
189
|
+
"cfn_nag": {
|
|
190
|
+
"rules_to_suppress": [
|
|
191
|
+
{
|
|
192
|
+
"id": "W12",
|
|
193
|
+
"reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"testReplaceDefaultSecurityGroupsecuritygroupAC4F969B": {
|
|
200
|
+
"Type": "AWS::EC2::SecurityGroup",
|
|
201
|
+
"Properties": {
|
|
202
|
+
"GroupDescription": "withClientProps/test/ReplaceDefaultSecurityGroup-security-group",
|
|
203
|
+
"SecurityGroupEgress": [
|
|
204
|
+
{
|
|
205
|
+
"CidrIp": "0.0.0.0/0",
|
|
206
|
+
"Description": "Allow all outbound traffic by default",
|
|
207
|
+
"IpProtocol": "-1"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"VpcId": {
|
|
211
|
+
"Ref": "Vpc8378EB38"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"Metadata": {
|
|
215
|
+
"cfn_nag": {
|
|
216
|
+
"rules_to_suppress": [
|
|
217
|
+
{
|
|
218
|
+
"id": "W5",
|
|
219
|
+
"reason": "Egress of 0.0.0.0/0 is default and generally considered OK"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "W40",
|
|
223
|
+
"reason": "Egress IPProtocol of -1 is default and generally considered OK"
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"testLambdaFunction1BF7CD84": {
|
|
230
|
+
"Type": "AWS::Lambda::Function",
|
|
231
|
+
"Properties": {
|
|
232
|
+
"Code": {
|
|
233
|
+
"S3Bucket": {
|
|
234
|
+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
235
|
+
},
|
|
236
|
+
"S3Key": "c1b23d6af38c04acb744bda25a3dc7f4394daea942c67eaff40911a707a3c37a.zip"
|
|
237
|
+
},
|
|
238
|
+
"Role": {
|
|
239
|
+
"Fn::GetAtt": [
|
|
240
|
+
"testLambdaFunctionServiceRoleA03EDA2B",
|
|
241
|
+
"Arn"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"Environment": {
|
|
245
|
+
"Variables": {
|
|
246
|
+
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
|
|
247
|
+
"CACHE_ENDPOINT": {
|
|
248
|
+
"Fn::Join": [
|
|
249
|
+
"",
|
|
250
|
+
[
|
|
251
|
+
{
|
|
252
|
+
"Fn::GetAtt": [
|
|
253
|
+
"testtestcluster57FB8D14",
|
|
254
|
+
"ConfigurationEndpoint.Address"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
":",
|
|
258
|
+
{
|
|
259
|
+
"Fn::GetAtt": [
|
|
260
|
+
"testtestcluster57FB8D14",
|
|
261
|
+
"ConfigurationEndpoint.Port"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"Handler": "index.handler",
|
|
270
|
+
"Runtime": "nodejs14.x",
|
|
271
|
+
"TracingConfig": {
|
|
272
|
+
"Mode": "Active"
|
|
273
|
+
},
|
|
274
|
+
"VpcConfig": {
|
|
275
|
+
"SecurityGroupIds": [
|
|
276
|
+
{
|
|
277
|
+
"Fn::GetAtt": [
|
|
278
|
+
"testtestcachesg9F6CF9E2",
|
|
279
|
+
"GroupId"
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"Fn::GetAtt": [
|
|
284
|
+
"testReplaceDefaultSecurityGroupsecuritygroupAC4F969B",
|
|
285
|
+
"GroupId"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"SubnetIds": [
|
|
290
|
+
{
|
|
291
|
+
"Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"Ref": "VpcisolatedSubnet2Subnet39217055"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"Ref": "VpcisolatedSubnet3Subnet44F2537D"
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"DependsOn": [
|
|
303
|
+
"testLambdaFunctionServiceRoleDefaultPolicy4F560EE3",
|
|
304
|
+
"testLambdaFunctionServiceRoleA03EDA2B"
|
|
305
|
+
],
|
|
306
|
+
"Metadata": {
|
|
307
|
+
"cfn_nag": {
|
|
308
|
+
"rules_to_suppress": [
|
|
309
|
+
{
|
|
310
|
+
"id": "W58",
|
|
311
|
+
"reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "W89",
|
|
315
|
+
"reason": "This is not a rule for the general case, just for specific use cases/industries"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"id": "W92",
|
|
319
|
+
"reason": "Impossible for us to define the correct concurrency for clients"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"Vpc8378EB38": {
|
|
326
|
+
"Type": "AWS::EC2::VPC",
|
|
327
|
+
"Properties": {
|
|
328
|
+
"CidrBlock": "192.68.0.0/16",
|
|
329
|
+
"EnableDnsHostnames": true,
|
|
330
|
+
"EnableDnsSupport": true,
|
|
331
|
+
"InstanceTenancy": "default",
|
|
332
|
+
"Tags": [
|
|
333
|
+
{
|
|
334
|
+
"Key": "Name",
|
|
335
|
+
"Value": "withClientProps/Vpc"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"VpcisolatedSubnet1SubnetE62B1B9B": {
|
|
341
|
+
"Type": "AWS::EC2::Subnet",
|
|
342
|
+
"Properties": {
|
|
343
|
+
"VpcId": {
|
|
344
|
+
"Ref": "Vpc8378EB38"
|
|
345
|
+
},
|
|
346
|
+
"AvailabilityZone": "test-region-1a",
|
|
347
|
+
"CidrBlock": "192.68.0.0/18",
|
|
348
|
+
"MapPublicIpOnLaunch": false,
|
|
349
|
+
"Tags": [
|
|
350
|
+
{
|
|
351
|
+
"Key": "aws-cdk:subnet-name",
|
|
352
|
+
"Value": "isolated"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"Key": "aws-cdk:subnet-type",
|
|
356
|
+
"Value": "Isolated"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"Key": "Name",
|
|
360
|
+
"Value": "withClientProps/Vpc/isolatedSubnet1"
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"VpcisolatedSubnet1RouteTableE442650B": {
|
|
366
|
+
"Type": "AWS::EC2::RouteTable",
|
|
367
|
+
"Properties": {
|
|
368
|
+
"VpcId": {
|
|
369
|
+
"Ref": "Vpc8378EB38"
|
|
370
|
+
},
|
|
371
|
+
"Tags": [
|
|
372
|
+
{
|
|
373
|
+
"Key": "Name",
|
|
374
|
+
"Value": "withClientProps/Vpc/isolatedSubnet1"
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"VpcisolatedSubnet1RouteTableAssociationD259E31A": {
|
|
380
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
|
381
|
+
"Properties": {
|
|
382
|
+
"RouteTableId": {
|
|
383
|
+
"Ref": "VpcisolatedSubnet1RouteTableE442650B"
|
|
384
|
+
},
|
|
385
|
+
"SubnetId": {
|
|
386
|
+
"Ref": "VpcisolatedSubnet1SubnetE62B1B9B"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"VpcisolatedSubnet2Subnet39217055": {
|
|
391
|
+
"Type": "AWS::EC2::Subnet",
|
|
392
|
+
"Properties": {
|
|
393
|
+
"VpcId": {
|
|
394
|
+
"Ref": "Vpc8378EB38"
|
|
395
|
+
},
|
|
396
|
+
"AvailabilityZone": "test-region-1b",
|
|
397
|
+
"CidrBlock": "192.68.64.0/18",
|
|
398
|
+
"MapPublicIpOnLaunch": false,
|
|
399
|
+
"Tags": [
|
|
400
|
+
{
|
|
401
|
+
"Key": "aws-cdk:subnet-name",
|
|
402
|
+
"Value": "isolated"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"Key": "aws-cdk:subnet-type",
|
|
406
|
+
"Value": "Isolated"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"Key": "Name",
|
|
410
|
+
"Value": "withClientProps/Vpc/isolatedSubnet2"
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"VpcisolatedSubnet2RouteTable334F9764": {
|
|
416
|
+
"Type": "AWS::EC2::RouteTable",
|
|
417
|
+
"Properties": {
|
|
418
|
+
"VpcId": {
|
|
419
|
+
"Ref": "Vpc8378EB38"
|
|
420
|
+
},
|
|
421
|
+
"Tags": [
|
|
422
|
+
{
|
|
423
|
+
"Key": "Name",
|
|
424
|
+
"Value": "withClientProps/Vpc/isolatedSubnet2"
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"VpcisolatedSubnet2RouteTableAssociation25A4716F": {
|
|
430
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
|
431
|
+
"Properties": {
|
|
432
|
+
"RouteTableId": {
|
|
433
|
+
"Ref": "VpcisolatedSubnet2RouteTable334F9764"
|
|
434
|
+
},
|
|
435
|
+
"SubnetId": {
|
|
436
|
+
"Ref": "VpcisolatedSubnet2Subnet39217055"
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"VpcisolatedSubnet3Subnet44F2537D": {
|
|
441
|
+
"Type": "AWS::EC2::Subnet",
|
|
442
|
+
"Properties": {
|
|
443
|
+
"VpcId": {
|
|
444
|
+
"Ref": "Vpc8378EB38"
|
|
445
|
+
},
|
|
446
|
+
"AvailabilityZone": "test-region-1c",
|
|
447
|
+
"CidrBlock": "192.68.128.0/18",
|
|
448
|
+
"MapPublicIpOnLaunch": false,
|
|
449
|
+
"Tags": [
|
|
450
|
+
{
|
|
451
|
+
"Key": "aws-cdk:subnet-name",
|
|
452
|
+
"Value": "isolated"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"Key": "aws-cdk:subnet-type",
|
|
456
|
+
"Value": "Isolated"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"Key": "Name",
|
|
460
|
+
"Value": "withClientProps/Vpc/isolatedSubnet3"
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"VpcisolatedSubnet3RouteTableA2F6BBC0": {
|
|
466
|
+
"Type": "AWS::EC2::RouteTable",
|
|
467
|
+
"Properties": {
|
|
468
|
+
"VpcId": {
|
|
469
|
+
"Ref": "Vpc8378EB38"
|
|
470
|
+
},
|
|
471
|
+
"Tags": [
|
|
472
|
+
{
|
|
473
|
+
"Key": "Name",
|
|
474
|
+
"Value": "withClientProps/Vpc/isolatedSubnet3"
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"VpcisolatedSubnet3RouteTableAssociationDC010BEB": {
|
|
480
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
|
481
|
+
"Properties": {
|
|
482
|
+
"RouteTableId": {
|
|
483
|
+
"Ref": "VpcisolatedSubnet3RouteTableA2F6BBC0"
|
|
484
|
+
},
|
|
485
|
+
"SubnetId": {
|
|
486
|
+
"Ref": "VpcisolatedSubnet3Subnet44F2537D"
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
"VpcFlowLogIAMRole6A475D41": {
|
|
491
|
+
"Type": "AWS::IAM::Role",
|
|
492
|
+
"Properties": {
|
|
493
|
+
"AssumeRolePolicyDocument": {
|
|
494
|
+
"Statement": [
|
|
495
|
+
{
|
|
496
|
+
"Action": "sts:AssumeRole",
|
|
497
|
+
"Effect": "Allow",
|
|
498
|
+
"Principal": {
|
|
499
|
+
"Service": "vpc-flow-logs.amazonaws.com"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
"Version": "2012-10-17"
|
|
504
|
+
},
|
|
505
|
+
"Tags": [
|
|
506
|
+
{
|
|
507
|
+
"Key": "Name",
|
|
508
|
+
"Value": "withClientProps/Vpc"
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
"VpcFlowLogIAMRoleDefaultPolicy406FB995": {
|
|
514
|
+
"Type": "AWS::IAM::Policy",
|
|
515
|
+
"Properties": {
|
|
516
|
+
"PolicyDocument": {
|
|
517
|
+
"Statement": [
|
|
518
|
+
{
|
|
519
|
+
"Action": [
|
|
520
|
+
"logs:CreateLogStream",
|
|
521
|
+
"logs:PutLogEvents",
|
|
522
|
+
"logs:DescribeLogStreams"
|
|
523
|
+
],
|
|
524
|
+
"Effect": "Allow",
|
|
525
|
+
"Resource": {
|
|
526
|
+
"Fn::GetAtt": [
|
|
527
|
+
"VpcFlowLogLogGroup7B5C56B9",
|
|
528
|
+
"Arn"
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"Action": "iam:PassRole",
|
|
534
|
+
"Effect": "Allow",
|
|
535
|
+
"Resource": {
|
|
536
|
+
"Fn::GetAtt": [
|
|
537
|
+
"VpcFlowLogIAMRole6A475D41",
|
|
538
|
+
"Arn"
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
],
|
|
543
|
+
"Version": "2012-10-17"
|
|
544
|
+
},
|
|
545
|
+
"PolicyName": "VpcFlowLogIAMRoleDefaultPolicy406FB995",
|
|
546
|
+
"Roles": [
|
|
547
|
+
{
|
|
548
|
+
"Ref": "VpcFlowLogIAMRole6A475D41"
|
|
549
|
+
}
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
"VpcFlowLogLogGroup7B5C56B9": {
|
|
554
|
+
"Type": "AWS::Logs::LogGroup",
|
|
555
|
+
"Properties": {
|
|
556
|
+
"RetentionInDays": 731,
|
|
557
|
+
"Tags": [
|
|
558
|
+
{
|
|
559
|
+
"Key": "Name",
|
|
560
|
+
"Value": "withClientProps/Vpc"
|
|
561
|
+
}
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
"UpdateReplacePolicy": "Retain",
|
|
565
|
+
"DeletionPolicy": "Retain",
|
|
566
|
+
"Metadata": {
|
|
567
|
+
"cfn_nag": {
|
|
568
|
+
"rules_to_suppress": [
|
|
569
|
+
{
|
|
570
|
+
"id": "W84",
|
|
571
|
+
"reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"VpcFlowLog8FF33A73": {
|
|
578
|
+
"Type": "AWS::EC2::FlowLog",
|
|
579
|
+
"Properties": {
|
|
580
|
+
"ResourceId": {
|
|
581
|
+
"Ref": "Vpc8378EB38"
|
|
582
|
+
},
|
|
583
|
+
"ResourceType": "VPC",
|
|
584
|
+
"TrafficType": "ALL",
|
|
585
|
+
"DeliverLogsPermissionArn": {
|
|
586
|
+
"Fn::GetAtt": [
|
|
587
|
+
"VpcFlowLogIAMRole6A475D41",
|
|
588
|
+
"Arn"
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
"LogDestinationType": "cloud-watch-logs",
|
|
592
|
+
"LogGroupName": {
|
|
593
|
+
"Ref": "VpcFlowLogLogGroup7B5C56B9"
|
|
594
|
+
},
|
|
595
|
+
"Tags": [
|
|
596
|
+
{
|
|
597
|
+
"Key": "Name",
|
|
598
|
+
"Value": "withClientProps/Vpc"
|
|
599
|
+
}
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
"Parameters": {
|
|
605
|
+
"BootstrapVersion": {
|
|
606
|
+
"Type": "AWS::SSM::Parameter::Value<String>",
|
|
607
|
+
"Default": "/cdk-bootstrap/hnb659fds/version",
|
|
608
|
+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"Rules": {
|
|
612
|
+
"CheckBootstrapVersion": {
|
|
613
|
+
"Assertions": [
|
|
614
|
+
{
|
|
615
|
+
"Assert": {
|
|
616
|
+
"Fn::Not": [
|
|
617
|
+
{
|
|
618
|
+
"Fn::Contains": [
|
|
619
|
+
[
|
|
620
|
+
"1",
|
|
621
|
+
"2",
|
|
622
|
+
"3",
|
|
623
|
+
"4",
|
|
624
|
+
"5"
|
|
625
|
+
],
|
|
626
|
+
{
|
|
627
|
+
"Ref": "BootstrapVersion"
|
|
628
|
+
}
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
6
|
+
* with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
11
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
// Imports
|
|
16
|
+
const core_1 = require("@aws-cdk/core");
|
|
17
|
+
const lib_1 = require("../lib");
|
|
18
|
+
const lambda = require("@aws-cdk/aws-lambda");
|
|
19
|
+
const core_2 = require("@aws-solutions-constructs/core");
|
|
20
|
+
// Setup
|
|
21
|
+
const app = new core_1.App();
|
|
22
|
+
const stack = new core_1.Stack(app, core_2.generateIntegStackName(__filename));
|
|
23
|
+
stack.templateOptions.description = 'Integration Test with new resourcesfor aws-lambda-elasticachememcached';
|
|
24
|
+
// Definitions
|
|
25
|
+
const props = {
|
|
26
|
+
lambdaFunctionProps: {
|
|
27
|
+
runtime: lambda.Runtime.NODEJS_14_X,
|
|
28
|
+
handler: 'index.handler',
|
|
29
|
+
code: lambda.Code.fromAsset(`${__dirname}/lambda`)
|
|
30
|
+
},
|
|
31
|
+
cacheProps: {
|
|
32
|
+
azMode: "single-az"
|
|
33
|
+
},
|
|
34
|
+
vpcProps: {
|
|
35
|
+
cidr: '192.68.0.0/16'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
new lib_1.LambdaToElasticachememcached(stack, 'test', props);
|
|
39
|
+
// Synth
|
|
40
|
+
app.synth();
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcud2l0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dGVJbnRlZ1N0YWNrTmFtZSB9IGZyb20gJ0Bhd3Mtc29sdXRpb25zLWNvbnN0cnVjdHMvY29yZSc7XG5cbi8vIFNldHVwXG5jb25zdCBhcHAgPSBuZXcgQXBwKCk7XG5jb25zdCBzdGFjayA9IG5ldyBTdGFjayhhcHAsIGdlbmVyYXRlSW50ZWdTdGFja05hbWUoX19maWxlbmFtZSkpO1xuc3RhY2sudGVtcGxhdGVPcHRpb25zLmRlc2NyaXB0aW9uID0gJ0ludGVncmF0aW9uIFRlc3Qgd2l0aCBuZXcgcmVzb3VyY2VzZm9yIGF3cy1sYW1iZGEtZWxhc3RpY2FjaGVtZW1jYWNoZWQnO1xuXG4vLyBEZWZpbml0aW9uc1xuY29uc3QgcHJvcHM6IExhbWJkYVRvRWxhc3RpY2FjaGVtZW1jYWNoZWRQcm9wcyA9IHtcbiAgbGFtYmRhRnVuY3Rpb25Qcm9wczoge1xuICAgIHJ1bnRpbWU6IGxhbWJkYS5SdW50aW1lLk5PREVKU18xNF9YLFxuICAgIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgICBjb2RlOiBsYW1iZGEuQ29kZS5mcm9tQXNzZXQoYCR7X19kaXJuYW1lfS9sYW1iZGFgKVxuICB9LFxuICBjYWNoZVByb3BzOiB7XG4gICAgYXpNb2RlOiBcInNpbmdsZS1helwiXG4gIH0sXG4gIHZwY1Byb3BzOiB7XG4gICAgY2lkcjogJzE5Mi42OC4wLjAvMTYnXG4gIH1cbn07XG5cbm5ldyBMYW1iZGFUb0VsYXN0aWNhY2hlbWVtY2FjaGVkKHN0YWNrLCAndGVzdCcsIHByb3BzKTtcblxuLy8gU3ludGhcbmFwcC5zeW50aCgpOyJdfQ==
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import "@aws-cdk/assert/jest";
|