Skip to content

Commit 824bb19

Browse files
authored
Bring use cases up to date (#671)
1 parent 5c1391e commit 824bb19

23 files changed

+7469
-1794
lines changed

source/use_cases/aws-custom-glue-etl/test/integ.gluejob.expected.json

+126-143
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
11
{
22
"Description": "Integration Test for sample application that uses aws-kineisstream-glue-job construct",
3-
"Parameters": {
4-
"AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3Bucket96760533": {
5-
"Type": "String",
6-
"Description": "S3 bucket for asset \"d4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4\""
7-
},
8-
"AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9": {
9-
"Type": "String",
10-
"Description": "S3 key for asset version \"d4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4\""
11-
},
12-
"AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4ArtifactHashC026BAAB": {
13-
"Type": "String",
14-
"Description": "Artifact hash for asset \"d4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4\""
15-
}
16-
},
173
"Resources": {
184
"CustomETLKinesisStreamB4F1869F": {
195
"Type": "AWS::Kinesis::Stream",
206
"Properties": {
21-
"ShardCount": 1,
227
"RetentionPeriodHours": 24,
8+
"ShardCount": 1,
239
"StreamEncryption": {
2410
"EncryptionType": "KMS",
2511
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
2615
}
2716
}
2817
},
@@ -135,7 +124,11 @@
135124
"s3:GetBucket*",
136125
"s3:List*",
137126
"s3:DeleteObject*",
138-
"s3:PutObject*",
127+
"s3:PutObject",
128+
"s3:PutObjectLegalHold",
129+
"s3:PutObjectRetention",
130+
"s3:PutObjectTagging",
131+
"s3:PutObjectVersionTagging",
139132
"s3:Abort*"
140133
],
141134
"Effect": "Allow",
@@ -180,34 +173,7 @@
180173
},
181174
":s3:::",
182175
{
183-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3Bucket96760533"
184-
},
185-
"/",
186-
{
187-
"Fn::Select": [
188-
0,
189-
{
190-
"Fn::Split": [
191-
"||",
192-
{
193-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
194-
}
195-
]
196-
}
197-
]
198-
},
199-
{
200-
"Fn::Select": [
201-
1,
202-
{
203-
"Fn::Split": [
204-
"||",
205-
{
206-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
207-
}
208-
]
209-
}
210-
]
176+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
211177
}
212178
]
213179
]
@@ -222,34 +188,7 @@
222188
},
223189
":s3:::",
224190
{
225-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3Bucket96760533"
226-
},
227-
"/",
228-
{
229-
"Fn::Select": [
230-
0,
231-
{
232-
"Fn::Split": [
233-
"||",
234-
{
235-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
236-
}
237-
]
238-
}
239-
]
240-
},
241-
{
242-
"Fn::Select": [
243-
1,
244-
{
245-
"Fn::Split": [
246-
"||",
247-
{
248-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
249-
}
250-
]
251-
}
252-
]
191+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
253192
},
254193
"/*"
255194
]
@@ -286,6 +225,9 @@
286225
"BlockPublicPolicy": true,
287226
"IgnorePublicAcls": true,
288227
"RestrictPublicBuckets": true
228+
},
229+
"VersioningConfiguration": {
230+
"Status": "Enabled"
289231
}
290232
},
291233
"UpdateReplacePolicy": "Retain",
@@ -310,7 +252,7 @@
310252
"PolicyDocument": {
311253
"Statement": [
312254
{
313-
"Action": "*",
255+
"Action": "s3:*",
314256
"Condition": {
315257
"Bool": {
316258
"aws:SecureTransport": "false"
@@ -320,21 +262,28 @@
320262
"Principal": {
321263
"AWS": "*"
322264
},
323-
"Resource": {
324-
"Fn::Join": [
325-
"",
326-
[
327-
{
328-
"Fn::GetAtt": [
329-
"CustomETLS3LoggingBucketBBDD45CB",
330-
"Arn"
331-
]
332-
},
333-
"/*"
265+
"Resource": [
266+
{
267+
"Fn::GetAtt": [
268+
"CustomETLS3LoggingBucketBBDD45CB",
269+
"Arn"
334270
]
335-
]
336-
},
337-
"Sid": "HttpsOnly"
271+
},
272+
{
273+
"Fn::Join": [
274+
"",
275+
[
276+
{
277+
"Fn::GetAtt": [
278+
"CustomETLS3LoggingBucketBBDD45CB",
279+
"Arn"
280+
]
281+
},
282+
"/*"
283+
]
284+
]
285+
}
286+
]
338287
}
339288
],
340289
"Version": "2012-10-17"
@@ -393,7 +342,7 @@
393342
"PolicyDocument": {
394343
"Statement": [
395344
{
396-
"Action": "*",
345+
"Action": "s3:*",
397346
"Condition": {
398347
"Bool": {
399348
"aws:SecureTransport": "false"
@@ -403,21 +352,28 @@
403352
"Principal": {
404353
"AWS": "*"
405354
},
406-
"Resource": {
407-
"Fn::Join": [
408-
"",
409-
[
410-
{
411-
"Fn::GetAtt": [
412-
"CustomETLS3Bucket3EE58725",
413-
"Arn"
414-
]
415-
},
416-
"/*"
355+
"Resource": [
356+
{
357+
"Fn::GetAtt": [
358+
"CustomETLS3Bucket3EE58725",
359+
"Arn"
417360
]
418-
]
419-
},
420-
"Sid": "HttpsOnly"
361+
},
362+
{
363+
"Fn::Join": [
364+
"",
365+
[
366+
{
367+
"Fn::GetAtt": [
368+
"CustomETLS3Bucket3EE58725",
369+
"Arn"
370+
]
371+
},
372+
"/*"
373+
]
374+
]
375+
}
376+
]
421377
}
422378
],
423379
"Version": "2012-10-17"
@@ -431,42 +387,7 @@
431387
"Name": "gluestreaming",
432388
"PythonVersion": "3",
433389
"ScriptLocation": {
434-
"Fn::Join": [
435-
"",
436-
[
437-
"s3://",
438-
{
439-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3Bucket96760533"
440-
},
441-
"/",
442-
{
443-
"Fn::Select": [
444-
0,
445-
{
446-
"Fn::Split": [
447-
"||",
448-
{
449-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
450-
}
451-
]
452-
}
453-
]
454-
},
455-
{
456-
"Fn::Select": [
457-
1,
458-
{
459-
"Fn::Split": [
460-
"||",
461-
{
462-
"Ref": "AssetParametersd4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4S3VersionKey856519B9"
463-
}
464-
]
465-
}
466-
]
467-
}
468-
]
469-
]
390+
"Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d4dd6643ee852c9578ae2d36cf2dc8a48630fd2219a15e74502c7ea75bff70c4.py"
470391
}
471392
},
472393
"Role": {
@@ -488,7 +409,7 @@
488409
"Fn::Join": [
489410
"",
490411
[
491-
"s3://",
412+
"s3a://",
492413
{
493414
"Ref": "CustomETLS3Bucket3EE58725"
494415
},
@@ -498,7 +419,35 @@
498419
}
499420
},
500421
"GlueVersion": "2.0",
501-
"SecurityConfiguration": "ETLJobSecurityConfig"
422+
"NumberOfWorkers": 2,
423+
"SecurityConfiguration": "ETLJobSecurityConfig",
424+
"WorkerType": "G.1X"
425+
}
426+
},
427+
"CustomETLKinesisStreamGetRecordsIteratorAgeAlarmCD7F4E34": {
428+
"Type": "AWS::CloudWatch::Alarm",
429+
"Properties": {
430+
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
431+
"EvaluationPeriods": 1,
432+
"AlarmDescription": "Consumer Record Processing Falling Behind, there is risk for data loss due to record expiration.",
433+
"MetricName": "GetRecords.IteratorAgeMilliseconds",
434+
"Namespace": "AWS/Kinesis",
435+
"Period": 300,
436+
"Statistic": "Maximum",
437+
"Threshold": 43200
438+
}
439+
},
440+
"CustomETLKinesisStreamReadProvisionedThroughputExceededAlarm6AB32664": {
441+
"Type": "AWS::CloudWatch::Alarm",
442+
"Properties": {
443+
"ComparisonOperator": "GreaterThanThreshold",
444+
"EvaluationPeriods": 1,
445+
"AlarmDescription": "Consumer Application is Reading at a Slower Rate Than Expected.",
446+
"MetricName": "ReadProvisionedThroughputExceeded",
447+
"Namespace": "AWS/Kinesis",
448+
"Period": 300,
449+
"Statistic": "Average",
450+
"Threshold": 0
502451
}
503452
},
504453
"GlueDatabase": {
@@ -523,7 +472,7 @@
523472
},
524473
"TableInput": {
525474
"Parameters": {
526-
"classication": "json"
475+
"classification": "json"
527476
},
528477
"StorageDescriptor": {
529478
"Columns": [
@@ -599,7 +548,7 @@
599548
}
600549
}
601550
},
602-
"GlueJobPolicyAEA4B94E": {
551+
"CustomETLGlueJobPolicy0AE5B5CB": {
603552
"Type": "AWS::IAM::Policy",
604553
"Properties": {
605554
"PolicyDocument": {
@@ -745,7 +694,7 @@
745694
],
746695
"Version": "2012-10-17"
747696
},
748-
"PolicyName": "GlueJobPolicyAEA4B94E",
697+
"PolicyName": "CustomETLGlueJobPolicy0AE5B5CB",
749698
"Roles": [
750699
{
751700
"Ref": "CustomETLJobRole53A1671F"
@@ -783,5 +732,39 @@
783732
]
784733
}
785734
}
735+
},
736+
"Parameters": {
737+
"BootstrapVersion": {
738+
"Type": "AWS::SSM::Parameter::Value<String>",
739+
"Default": "/cdk-bootstrap/hnb659fds/version",
740+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
741+
}
742+
},
743+
"Rules": {
744+
"CheckBootstrapVersion": {
745+
"Assertions": [
746+
{
747+
"Assert": {
748+
"Fn::Not": [
749+
{
750+
"Fn::Contains": [
751+
[
752+
"1",
753+
"2",
754+
"3",
755+
"4",
756+
"5"
757+
],
758+
{
759+
"Ref": "BootstrapVersion"
760+
}
761+
]
762+
}
763+
]
764+
},
765+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
766+
}
767+
]
768+
}
786769
}
787770
}

source/use_cases/aws-restaurant-management-demo/.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ test/*.js
33
bin/*.js
44
*.d.ts
55
coverage
6-
test/lambda/index.js
6+
test/lambda/index.js
7+
*/lambda/**/*.js

0 commit comments

Comments
 (0)