@aws-solutions-constructs/aws-cloudfront-apigateway-lambda 2.47.0 → 2.48.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/.jsii +24 -24
- package/README.md +42 -18
- package/lib/index.d.ts +6 -3
- package/lib/index.js +17 -16
- package/package.json +5 -5
- package/test/integ.cftaplam-customCloudfrontLoggingBucket.expected.json +369 -28
- package/test/integ.cftaplam-customCloudfrontLoggingBucket.js +8 -1
- package/test/integ.cftaplam-no-arguments.expected.json +369 -28
- package/test/integ.cftaplam-no-arguments.js +8 -1
- package/test/integ.cftaplam-override-behavior.expected.json +369 -8
- package/test/integ.cftaplam-override-behavior.js +3 -2
- package/test/test.cloudfront-apigateway-lambda.test.js +46 -3
|
@@ -1,6 +1,177 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Description": "Integration Test for aws-cloudfront-apigateway-lambda",
|
|
3
3
|
"Resources": {
|
|
4
|
+
"cftaplamnoargumentsauthorizerAuthFunctionServiceRole122160C6": {
|
|
5
|
+
"Type": "AWS::IAM::Role",
|
|
6
|
+
"Properties": {
|
|
7
|
+
"AssumeRolePolicyDocument": {
|
|
8
|
+
"Statement": [
|
|
9
|
+
{
|
|
10
|
+
"Action": "sts:AssumeRole",
|
|
11
|
+
"Effect": "Allow",
|
|
12
|
+
"Principal": {
|
|
13
|
+
"Service": "lambda.amazonaws.com"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"Version": "2012-10-17"
|
|
18
|
+
},
|
|
19
|
+
"ManagedPolicyArns": [
|
|
20
|
+
{
|
|
21
|
+
"Fn::Join": [
|
|
22
|
+
"",
|
|
23
|
+
[
|
|
24
|
+
"arn:",
|
|
25
|
+
{
|
|
26
|
+
"Ref": "AWS::Partition"
|
|
27
|
+
},
|
|
28
|
+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
29
|
+
]
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"cftaplamnoargumentsauthorizerAuthFunction9B127993": {
|
|
36
|
+
"Type": "AWS::Lambda::Function",
|
|
37
|
+
"Properties": {
|
|
38
|
+
"Code": {
|
|
39
|
+
"S3Bucket": {
|
|
40
|
+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
41
|
+
},
|
|
42
|
+
"S3Key": "42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c.zip"
|
|
43
|
+
},
|
|
44
|
+
"Handler": ".handler",
|
|
45
|
+
"Role": {
|
|
46
|
+
"Fn::GetAtt": [
|
|
47
|
+
"cftaplamnoargumentsauthorizerAuthFunctionServiceRole122160C6",
|
|
48
|
+
"Arn"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"Runtime": "nodejs16.x"
|
|
52
|
+
},
|
|
53
|
+
"DependsOn": [
|
|
54
|
+
"cftaplamnoargumentsauthorizerAuthFunctionServiceRole122160C6"
|
|
55
|
+
],
|
|
56
|
+
"Metadata": {
|
|
57
|
+
"cfn_nag": {
|
|
58
|
+
"rules_to_suppress": [
|
|
59
|
+
{
|
|
60
|
+
"id": "W58",
|
|
61
|
+
"reason": "Test Resource"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "W89",
|
|
65
|
+
"reason": "Test Resource"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "W92",
|
|
69
|
+
"reason": "Test Resource"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"cftaplamnoargumentsauthorizerAuthFunctioncftaplamnoargumentscftaplamnoargumentsauthorizer14876A7BPermissionsE711C432": {
|
|
76
|
+
"Type": "AWS::Lambda::Permission",
|
|
77
|
+
"Properties": {
|
|
78
|
+
"Action": "lambda:InvokeFunction",
|
|
79
|
+
"FunctionName": {
|
|
80
|
+
"Fn::GetAtt": [
|
|
81
|
+
"cftaplamnoargumentsauthorizerAuthFunction9B127993",
|
|
82
|
+
"Arn"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"Principal": "apigateway.amazonaws.com",
|
|
86
|
+
"SourceArn": {
|
|
87
|
+
"Fn::Join": [
|
|
88
|
+
"",
|
|
89
|
+
[
|
|
90
|
+
"arn:",
|
|
91
|
+
{
|
|
92
|
+
"Ref": "AWS::Partition"
|
|
93
|
+
},
|
|
94
|
+
":execute-api:",
|
|
95
|
+
{
|
|
96
|
+
"Ref": "AWS::Region"
|
|
97
|
+
},
|
|
98
|
+
":",
|
|
99
|
+
{
|
|
100
|
+
"Ref": "AWS::AccountId"
|
|
101
|
+
},
|
|
102
|
+
":",
|
|
103
|
+
{
|
|
104
|
+
"Ref": "testcloudfrontapigatewaylambdaLambdaRestApi6A4CBD44"
|
|
105
|
+
},
|
|
106
|
+
"/authorizers/",
|
|
107
|
+
{
|
|
108
|
+
"Ref": "cftaplamnoargumentsauthorizerD7B341B1"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"cftaplamnoargumentsauthorizerD7B341B1": {
|
|
116
|
+
"Type": "AWS::ApiGateway::Authorizer",
|
|
117
|
+
"Properties": {
|
|
118
|
+
"AuthorizerUri": {
|
|
119
|
+
"Fn::Join": [
|
|
120
|
+
"",
|
|
121
|
+
[
|
|
122
|
+
"arn:",
|
|
123
|
+
{
|
|
124
|
+
"Fn::Select": [
|
|
125
|
+
1,
|
|
126
|
+
{
|
|
127
|
+
"Fn::Split": [
|
|
128
|
+
":",
|
|
129
|
+
{
|
|
130
|
+
"Fn::GetAtt": [
|
|
131
|
+
"cftaplamnoargumentsauthorizerAuthFunction9B127993",
|
|
132
|
+
"Arn"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
":apigateway:",
|
|
140
|
+
{
|
|
141
|
+
"Fn::Select": [
|
|
142
|
+
3,
|
|
143
|
+
{
|
|
144
|
+
"Fn::Split": [
|
|
145
|
+
":",
|
|
146
|
+
{
|
|
147
|
+
"Fn::GetAtt": [
|
|
148
|
+
"cftaplamnoargumentsauthorizerAuthFunction9B127993",
|
|
149
|
+
"Arn"
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
":lambda:path/2015-03-31/functions/",
|
|
157
|
+
{
|
|
158
|
+
"Fn::GetAtt": [
|
|
159
|
+
"cftaplamnoargumentsauthorizerAuthFunction9B127993",
|
|
160
|
+
"Arn"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"/invocations"
|
|
164
|
+
]
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"IdentitySource": "method.request.header.Authorization",
|
|
168
|
+
"Name": "cftaplamnoargumentscftaplamnoargumentsauthorizer14876A7B",
|
|
169
|
+
"RestApiId": {
|
|
170
|
+
"Ref": "testcloudfrontapigatewaylambdaLambdaRestApi6A4CBD44"
|
|
171
|
+
},
|
|
172
|
+
"Type": "REQUEST"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
4
175
|
"testcloudfrontapigatewaylambdaLambdaFunctionServiceRoleCB74590F": {
|
|
5
176
|
"Type": "AWS::IAM::Role",
|
|
6
177
|
"Properties": {
|
|
@@ -169,7 +340,7 @@
|
|
|
169
340
|
"Name": "LambdaRestApi"
|
|
170
341
|
}
|
|
171
342
|
},
|
|
172
|
-
"
|
|
343
|
+
"testcloudfrontapigatewaylambdaLambdaRestApiDeployment0C4661C0be4652c0c81d13dbdf8cd82fdf384ca9": {
|
|
173
344
|
"Type": "AWS::ApiGateway::Deployment",
|
|
174
345
|
"Properties": {
|
|
175
346
|
"Description": "Automatically created by the RestApi construct",
|
|
@@ -206,7 +377,7 @@
|
|
|
206
377
|
"Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
|
|
207
378
|
},
|
|
208
379
|
"DeploymentId": {
|
|
209
|
-
"Ref": "
|
|
380
|
+
"Ref": "testcloudfrontapigatewaylambdaLambdaRestApiDeployment0C4661C0be4652c0c81d13dbdf8cd82fdf384ca9"
|
|
210
381
|
},
|
|
211
382
|
"MethodSettings": [
|
|
212
383
|
{
|
|
@@ -319,7 +490,10 @@
|
|
|
319
490
|
"testcloudfrontapigatewaylambdaLambdaRestApiproxyANYAE500A13": {
|
|
320
491
|
"Type": "AWS::ApiGateway::Method",
|
|
321
492
|
"Properties": {
|
|
322
|
-
"AuthorizationType": "
|
|
493
|
+
"AuthorizationType": "CUSTOM",
|
|
494
|
+
"AuthorizerId": {
|
|
495
|
+
"Ref": "cftaplamnoargumentsauthorizerD7B341B1"
|
|
496
|
+
},
|
|
323
497
|
"HttpMethod": "ANY",
|
|
324
498
|
"Integration": {
|
|
325
499
|
"IntegrationHttpMethod": "POST",
|
|
@@ -354,16 +528,6 @@
|
|
|
354
528
|
"RestApiId": {
|
|
355
529
|
"Ref": "testcloudfrontapigatewaylambdaLambdaRestApi6A4CBD44"
|
|
356
530
|
}
|
|
357
|
-
},
|
|
358
|
-
"Metadata": {
|
|
359
|
-
"cfn_nag": {
|
|
360
|
-
"rules_to_suppress": [
|
|
361
|
-
{
|
|
362
|
-
"id": "W59",
|
|
363
|
-
"reason": "AWS::ApiGateway::Method AuthorizationType is set to 'NONE' because API Gateway behind CloudFront does not support AWS_IAM authentication"
|
|
364
|
-
}
|
|
365
|
-
]
|
|
366
|
-
}
|
|
367
531
|
}
|
|
368
532
|
},
|
|
369
533
|
"testcloudfrontapigatewaylambdaLambdaRestApiANYApiPermissioncftaplamnoargumentstestcloudfrontapigatewaylambdaLambdaRestApiF14A7709ANY1BADAD44": {
|
|
@@ -447,7 +611,10 @@
|
|
|
447
611
|
"testcloudfrontapigatewaylambdaLambdaRestApiANYBC435DFD": {
|
|
448
612
|
"Type": "AWS::ApiGateway::Method",
|
|
449
613
|
"Properties": {
|
|
450
|
-
"AuthorizationType": "
|
|
614
|
+
"AuthorizationType": "CUSTOM",
|
|
615
|
+
"AuthorizerId": {
|
|
616
|
+
"Ref": "cftaplamnoargumentsauthorizerD7B341B1"
|
|
617
|
+
},
|
|
451
618
|
"HttpMethod": "ANY",
|
|
452
619
|
"Integration": {
|
|
453
620
|
"IntegrationHttpMethod": "POST",
|
|
@@ -485,16 +652,6 @@
|
|
|
485
652
|
"RestApiId": {
|
|
486
653
|
"Ref": "testcloudfrontapigatewaylambdaLambdaRestApi6A4CBD44"
|
|
487
654
|
}
|
|
488
|
-
},
|
|
489
|
-
"Metadata": {
|
|
490
|
-
"cfn_nag": {
|
|
491
|
-
"rules_to_suppress": [
|
|
492
|
-
{
|
|
493
|
-
"id": "W59",
|
|
494
|
-
"reason": "AWS::ApiGateway::Method AuthorizationType is set to 'NONE' because API Gateway behind CloudFront does not support AWS_IAM authentication"
|
|
495
|
-
}
|
|
496
|
-
]
|
|
497
|
-
}
|
|
498
655
|
}
|
|
499
656
|
},
|
|
500
657
|
"testcloudfrontapigatewaylambdaLambdaRestApiUsagePlan59548A66": {
|
|
@@ -598,10 +755,9 @@
|
|
|
598
755
|
"Name": "SetHttpSecurityHeadersc87d9e55c0a6a55f893f95e9a700c7ce19634229d0"
|
|
599
756
|
}
|
|
600
757
|
},
|
|
601
|
-
"
|
|
758
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57": {
|
|
602
759
|
"Type": "AWS::S3::Bucket",
|
|
603
760
|
"Properties": {
|
|
604
|
-
"AccessControl": "LogDeliveryWrite",
|
|
605
761
|
"BucketEncryption": {
|
|
606
762
|
"ServerSideEncryptionConfiguration": [
|
|
607
763
|
{
|
|
@@ -641,12 +797,197 @@
|
|
|
641
797
|
"rules_to_suppress": [
|
|
642
798
|
{
|
|
643
799
|
"id": "W35",
|
|
644
|
-
"reason": "This S3 bucket is used as the access logging bucket for
|
|
800
|
+
"reason": "This S3 bucket is used as the access logging bucket for another bucket"
|
|
645
801
|
}
|
|
646
802
|
]
|
|
647
803
|
}
|
|
648
804
|
}
|
|
649
805
|
},
|
|
806
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLogPolicy521355D8": {
|
|
807
|
+
"Type": "AWS::S3::BucketPolicy",
|
|
808
|
+
"Properties": {
|
|
809
|
+
"Bucket": {
|
|
810
|
+
"Ref": "testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57"
|
|
811
|
+
},
|
|
812
|
+
"PolicyDocument": {
|
|
813
|
+
"Statement": [
|
|
814
|
+
{
|
|
815
|
+
"Action": "s3:*",
|
|
816
|
+
"Condition": {
|
|
817
|
+
"Bool": {
|
|
818
|
+
"aws:SecureTransport": "false"
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"Effect": "Deny",
|
|
822
|
+
"Principal": {
|
|
823
|
+
"AWS": "*"
|
|
824
|
+
},
|
|
825
|
+
"Resource": [
|
|
826
|
+
{
|
|
827
|
+
"Fn::GetAtt": [
|
|
828
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57",
|
|
829
|
+
"Arn"
|
|
830
|
+
]
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"Fn::Join": [
|
|
834
|
+
"",
|
|
835
|
+
[
|
|
836
|
+
{
|
|
837
|
+
"Fn::GetAtt": [
|
|
838
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57",
|
|
839
|
+
"Arn"
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
"/*"
|
|
843
|
+
]
|
|
844
|
+
]
|
|
845
|
+
}
|
|
846
|
+
]
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"Action": [
|
|
850
|
+
"s3:PutBucketPolicy",
|
|
851
|
+
"s3:GetBucket*",
|
|
852
|
+
"s3:List*",
|
|
853
|
+
"s3:DeleteObject*"
|
|
854
|
+
],
|
|
855
|
+
"Effect": "Allow",
|
|
856
|
+
"Principal": {
|
|
857
|
+
"AWS": {
|
|
858
|
+
"Fn::GetAtt": [
|
|
859
|
+
"CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
|
|
860
|
+
"Arn"
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
"Resource": [
|
|
865
|
+
{
|
|
866
|
+
"Fn::GetAtt": [
|
|
867
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57",
|
|
868
|
+
"Arn"
|
|
869
|
+
]
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"Fn::Join": [
|
|
873
|
+
"",
|
|
874
|
+
[
|
|
875
|
+
{
|
|
876
|
+
"Fn::GetAtt": [
|
|
877
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57",
|
|
878
|
+
"Arn"
|
|
879
|
+
]
|
|
880
|
+
},
|
|
881
|
+
"/*"
|
|
882
|
+
]
|
|
883
|
+
]
|
|
884
|
+
}
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
"Action": "s3:PutObject",
|
|
889
|
+
"Condition": {
|
|
890
|
+
"ArnLike": {
|
|
891
|
+
"aws:SourceArn": {
|
|
892
|
+
"Fn::GetAtt": [
|
|
893
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucket7F467421",
|
|
894
|
+
"Arn"
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
"StringEquals": {
|
|
899
|
+
"aws:SourceAccount": {
|
|
900
|
+
"Ref": "AWS::AccountId"
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"Effect": "Allow",
|
|
905
|
+
"Principal": {
|
|
906
|
+
"Service": "logging.s3.amazonaws.com"
|
|
907
|
+
},
|
|
908
|
+
"Resource": {
|
|
909
|
+
"Fn::Join": [
|
|
910
|
+
"",
|
|
911
|
+
[
|
|
912
|
+
{
|
|
913
|
+
"Fn::GetAtt": [
|
|
914
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57",
|
|
915
|
+
"Arn"
|
|
916
|
+
]
|
|
917
|
+
},
|
|
918
|
+
"/*"
|
|
919
|
+
]
|
|
920
|
+
]
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
],
|
|
924
|
+
"Version": "2012-10-17"
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
},
|
|
928
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLogAutoDeleteObjectsCustomResource2395E2A2": {
|
|
929
|
+
"Type": "Custom::S3AutoDeleteObjects",
|
|
930
|
+
"Properties": {
|
|
931
|
+
"ServiceToken": {
|
|
932
|
+
"Fn::GetAtt": [
|
|
933
|
+
"CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F",
|
|
934
|
+
"Arn"
|
|
935
|
+
]
|
|
936
|
+
},
|
|
937
|
+
"BucketName": {
|
|
938
|
+
"Ref": "testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57"
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
"DependsOn": [
|
|
942
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLogPolicy521355D8"
|
|
943
|
+
],
|
|
944
|
+
"UpdateReplacePolicy": "Delete",
|
|
945
|
+
"DeletionPolicy": "Delete"
|
|
946
|
+
},
|
|
947
|
+
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucket7F467421": {
|
|
948
|
+
"Type": "AWS::S3::Bucket",
|
|
949
|
+
"Properties": {
|
|
950
|
+
"AccessControl": "LogDeliveryWrite",
|
|
951
|
+
"BucketEncryption": {
|
|
952
|
+
"ServerSideEncryptionConfiguration": [
|
|
953
|
+
{
|
|
954
|
+
"ServerSideEncryptionByDefault": {
|
|
955
|
+
"SSEAlgorithm": "AES256"
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
"LoggingConfiguration": {
|
|
961
|
+
"DestinationBucketName": {
|
|
962
|
+
"Ref": "testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57"
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
"OwnershipControls": {
|
|
966
|
+
"Rules": [
|
|
967
|
+
{
|
|
968
|
+
"ObjectOwnership": "ObjectWriter"
|
|
969
|
+
}
|
|
970
|
+
]
|
|
971
|
+
},
|
|
972
|
+
"PublicAccessBlockConfiguration": {
|
|
973
|
+
"BlockPublicAcls": true,
|
|
974
|
+
"BlockPublicPolicy": true,
|
|
975
|
+
"IgnorePublicAcls": true,
|
|
976
|
+
"RestrictPublicBuckets": true
|
|
977
|
+
},
|
|
978
|
+
"Tags": [
|
|
979
|
+
{
|
|
980
|
+
"Key": "aws-cdk:auto-delete-objects",
|
|
981
|
+
"Value": "true"
|
|
982
|
+
}
|
|
983
|
+
],
|
|
984
|
+
"VersioningConfiguration": {
|
|
985
|
+
"Status": "Enabled"
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
"UpdateReplacePolicy": "Delete",
|
|
989
|
+
"DeletionPolicy": "Delete"
|
|
990
|
+
},
|
|
650
991
|
"testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketPolicy4A551B79": {
|
|
651
992
|
"Type": "AWS::S3::BucketPolicy",
|
|
652
993
|
"Properties": {
|
|
@@ -910,7 +1251,7 @@
|
|
|
910
1251
|
[
|
|
911
1252
|
"Lambda function for auto-deleting objects in ",
|
|
912
1253
|
{
|
|
913
|
-
"Ref": "
|
|
1254
|
+
"Ref": "testcloudfrontapigatewaylambdaCloudFrontToApiGatewayCloudfrontLoggingBucketAccessLog347EED57"
|
|
914
1255
|
},
|
|
915
1256
|
" S3 bucket."
|
|
916
1257
|
]
|
|
@@ -17,6 +17,7 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
|
17
17
|
const lib_1 = require("../lib");
|
|
18
18
|
const lambda = require("aws-cdk-lib/aws-lambda");
|
|
19
19
|
const core_1 = require("@aws-solutions-constructs/core");
|
|
20
|
+
const apigateway = require("aws-cdk-lib/aws-apigateway");
|
|
20
21
|
// Setup
|
|
21
22
|
const app = new aws_cdk_lib_1.App();
|
|
22
23
|
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
@@ -27,6 +28,12 @@ const lambdaProps = {
|
|
|
27
28
|
handler: 'index.handler'
|
|
28
29
|
};
|
|
29
30
|
new lib_1.CloudFrontToApiGatewayToLambda(stack, 'test-cloudfront-apigateway-lambda', {
|
|
31
|
+
apiGatewayProps: {
|
|
32
|
+
defaultMethodOptions: {
|
|
33
|
+
authorizationType: apigateway.AuthorizationType.CUSTOM,
|
|
34
|
+
authorizer: core_1.CreateApiAuthorizer(stack, `${core_1.generateIntegStackName(__filename)}-authorizer`)
|
|
35
|
+
},
|
|
36
|
+
},
|
|
30
37
|
lambdaFunctionProps: lambdaProps,
|
|
31
38
|
cloudFrontLoggingBucketProps: {
|
|
32
39
|
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
@@ -36,4 +43,4 @@ new lib_1.CloudFrontToApiGatewayToLambda(stack, 'test-cloudfront-apigateway-lamb
|
|
|
36
43
|
core_1.suppressAutoDeleteHandlerWarnings(stack);
|
|
37
44
|
// Synth
|
|
38
45
|
app.synth();
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuY2Z0YXBsYW0tbm8tYXJndW1lbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW50ZWcuY2Z0YXBsYW0tbm8tYXJndW1lbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7R0FXRzs7QUFFSCxnQkFBZ0I7QUFDaEIsNkNBQXdEO0FBQ3hELGdDQUF3RDtBQUN4RCxpREFBaUQ7QUFDakQseURBQWdJO0FBQ2hJLHlEQUF5RDtBQUV6RCxRQUFRO0FBQ1IsTUFBTSxHQUFHLEdBQUcsSUFBSSxpQkFBRyxFQUFFLENBQUM7QUFDdEIsTUFBTSxLQUFLLEdBQUcsSUFBSSxtQkFBSyxDQUFDLEdBQUcsRUFBRSw2QkFBc0IsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLEtBQUssQ0FBQyxlQUFlLENBQUMsV0FBVyxHQUFHLHVEQUF1RCxDQUFDO0FBRTVGLE1BQU0sV0FBVyxHQUF5QjtJQUN4QyxJQUFJLEVBQUUsTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsR0FBRyxTQUFTLFNBQVMsQ0FBQztJQUNsRCxPQUFPLEVBQUUsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXO0lBQ25DLE9BQU8sRUFBRSxlQUFlO0NBQ3pCLENBQUM7QUFFRixJQUFJLG9DQUE4QixDQUFDLEtBQUssRUFBRSxtQ0FBbUMsRUFBRTtJQUM3RSxlQUFlLEVBQU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