@aws-solutions-constructs/aws-cloudfront-oai-s3 2.79.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 +4403 -0
- package/README.md +109 -0
- package/architecture.png +0 -0
- package/integ.config.json +7 -0
- package/lib/index.d.ts +118 -0
- package/lib/index.js +106 -0
- package/package.json +95 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.d.ts +13 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js +56 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.assets.json +32 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.template.json +1061 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/cftoais3bucketencryptedwithmanagedkeyprovidedasexistingbucketIntegDefaultTestDeployAssert105E804F.assets.json +19 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/cftoais3bucketencryptedwithmanagedkeyprovidedasexistingbucketIntegDefaultTestDeployAssert105E804F.template.json +36 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/manifest.json +215 -0
- package/test/integ.cftoais3-bucket-encrypted-with-managed-key-provided-as-existingbucket.js.snapshot/tree.json +1105 -0
- package/test/integ.cftoais3-custom-headers.d.ts +13 -0
- package/test/integ.cftoais3-custom-headers.js +71 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/cftoais3-custom-headers.assets.json +32 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/cftoais3-custom-headers.template.json +1116 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/cftoais3customheadersIntegDefaultTestDeployAssert5AA11BA9.assets.json +19 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/cftoais3customheadersIntegDefaultTestDeployAssert5AA11BA9.template.json +36 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/manifest.json +227 -0
- package/test/integ.cftoais3-custom-headers.js.snapshot/tree.json +1196 -0
- package/test/integ.cftoais3-custom-originPath.d.ts +13 -0
- package/test/integ.cftoais3-custom-originPath.js +48 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/cftoais3-custom-originPath.assets.json +32 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/cftoais3-custom-originPath.template.json +1085 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/cftoais3customoriginPathIntegDefaultTestDeployAssert1C351914.assets.json +19 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/cftoais3customoriginPathIntegDefaultTestDeployAssert1C351914.template.json +36 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/manifest.json +221 -0
- package/test/integ.cftoais3-custom-originPath.js.snapshot/tree.json +1147 -0
- package/test/integ.cftoais3-customLoggingBuckets.d.ts +13 -0
- package/test/integ.cftoais3-customLoggingBuckets.js +64 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/cftoais3-customLoggingBuckets.assets.json +32 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/cftoais3-customLoggingBuckets.template.json +1109 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/cftoais3customLoggingBucketsIntegDefaultTestDeployAssert8F33EF2A.assets.json +19 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/cftoais3customLoggingBucketsIntegDefaultTestDeployAssert8F33EF2A.template.json +36 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/manifest.json +221 -0
- package/test/integ.cftoais3-customLoggingBuckets.js.snapshot/tree.json +1172 -0
- package/test/integ.cftoais3-existing-bucket.d.ts +13 -0
- package/test/integ.cftoais3-existing-bucket.js +59 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/cftoais3-existing-bucket.assets.json +32 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/cftoais3-existing-bucket.template.json +1131 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/cftoais3existingbucketIntegDefaultTestDeployAssertB7627F26.assets.json +19 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/cftoais3existingbucketIntegDefaultTestDeployAssertB7627F26.template.json +36 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/manifest.json +233 -0
- package/test/integ.cftoais3-existing-bucket.js.snapshot/tree.json +1240 -0
- package/test/integ.cftoais3-no-arguments.d.ts +13 -0
- package/test/integ.cftoais3-no-arguments.js +53 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/cftoais3-no-arguments.assets.json +32 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/cftoais3-no-arguments.template.json +1094 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/cftoais3noargumentsIntegDefaultTestDeployAssert5CF03E3D.assets.json +19 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/cftoais3noargumentsIntegDefaultTestDeployAssert5CF03E3D.template.json +36 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/manifest.json +356 -0
- package/test/integ.cftoais3-no-arguments.js.snapshot/tree.json +1146 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.d.ts +13 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js +60 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/cftoais3-no-cloudfront-s3-access-logs.assets.json +32 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/cftoais3-no-cloudfront-s3-access-logs.template.json +743 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/cftoais3nocloudfronts3accesslogsIntegDefaultTestDeployAssert6D810275.assets.json +19 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/cftoais3nocloudfronts3accesslogsIntegDefaultTestDeployAssert6D810275.template.json +36 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/manifest.json +185 -0
- package/test/integ.cftoais3-no-cloudfront-s3-access-logs.js.snapshot/tree.json +726 -0
- package/test/integ.cftoais3-no-logging.d.ts +13 -0
- package/test/integ.cftoais3-no-logging.js +56 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/cftoais3-no-logging.assets.json +32 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/cftoais3-no-logging.template.json +576 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/cftoais3nologgingIntegDefaultTestDeployAssertCED06EE4.assets.json +19 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/cftoais3nologgingIntegDefaultTestDeployAssertCED06EE4.template.json +36 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/manifest.json +167 -0
- package/test/integ.cftoais3-no-logging.js.snapshot/tree.json +542 -0
- package/test/integ.cftoais3-no-security-headers.d.ts +13 -0
- package/test/integ.cftoais3-no-security-headers.js +50 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/cdk.out +1 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/cftoais3-no-security-headers.assets.json +32 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/cftoais3-no-security-headers.template.json +1061 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/cftoais3nosecurityheadersIntegDefaultTestDeployAssertAB4B2F28.assets.json +19 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/cftoais3nosecurityheadersIntegDefaultTestDeployAssertAB4B2F28.template.json +36 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/integ.json +12 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/manifest.json +215 -0
- package/test/integ.cftoais3-no-security-headers.js.snapshot/tree.json +1105 -0
- package/test/test.cloudfront-oai-s3.test.d.ts +13 -0
- package/test/test.cloudfront-oai-s3.test.js +702 -0
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "tree-0.1",
|
|
3
|
+
"tree": {
|
|
4
|
+
"id": "App",
|
|
5
|
+
"path": "",
|
|
6
|
+
"children": {
|
|
7
|
+
"cftoais3-no-logging": {
|
|
8
|
+
"id": "cftoais3-no-logging",
|
|
9
|
+
"path": "cftoais3-no-logging",
|
|
10
|
+
"children": {
|
|
11
|
+
"test-cloudfront-oai-s3": {
|
|
12
|
+
"id": "test-cloudfront-oai-s3",
|
|
13
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3",
|
|
14
|
+
"children": {
|
|
15
|
+
"S3Bucket": {
|
|
16
|
+
"id": "S3Bucket",
|
|
17
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket",
|
|
18
|
+
"children": {
|
|
19
|
+
"Resource": {
|
|
20
|
+
"id": "Resource",
|
|
21
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket/Resource",
|
|
22
|
+
"attributes": {
|
|
23
|
+
"aws:cdk:cloudformation:type": "AWS::S3::Bucket",
|
|
24
|
+
"aws:cdk:cloudformation:props": {
|
|
25
|
+
"bucketEncryption": {
|
|
26
|
+
"serverSideEncryptionConfiguration": [
|
|
27
|
+
{
|
|
28
|
+
"serverSideEncryptionByDefault": {
|
|
29
|
+
"sseAlgorithm": "AES256"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"lifecycleConfiguration": {
|
|
35
|
+
"rules": [
|
|
36
|
+
{
|
|
37
|
+
"noncurrentVersionTransitions": [
|
|
38
|
+
{
|
|
39
|
+
"storageClass": "GLACIER",
|
|
40
|
+
"transitionInDays": 90
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"status": "Enabled"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"publicAccessBlockConfiguration": {
|
|
48
|
+
"blockPublicAcls": true,
|
|
49
|
+
"blockPublicPolicy": true,
|
|
50
|
+
"ignorePublicAcls": true,
|
|
51
|
+
"restrictPublicBuckets": true
|
|
52
|
+
},
|
|
53
|
+
"tags": [
|
|
54
|
+
{
|
|
55
|
+
"key": "aws-cdk:auto-delete-objects",
|
|
56
|
+
"value": "true"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"versioningConfiguration": {
|
|
60
|
+
"status": "Enabled"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"constructInfo": {
|
|
65
|
+
"fqn": "aws-cdk-lib.aws_s3.CfnBucket",
|
|
66
|
+
"version": "2.177.0"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"Policy": {
|
|
70
|
+
"id": "Policy",
|
|
71
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket/Policy",
|
|
72
|
+
"children": {
|
|
73
|
+
"Resource": {
|
|
74
|
+
"id": "Resource",
|
|
75
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket/Policy/Resource",
|
|
76
|
+
"attributes": {
|
|
77
|
+
"aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy",
|
|
78
|
+
"aws:cdk:cloudformation:props": {
|
|
79
|
+
"bucket": {
|
|
80
|
+
"Ref": "testcloudfrontoais3S3Bucket578AB9F3"
|
|
81
|
+
},
|
|
82
|
+
"policyDocument": {
|
|
83
|
+
"Statement": [
|
|
84
|
+
{
|
|
85
|
+
"Action": "s3:*",
|
|
86
|
+
"Condition": {
|
|
87
|
+
"Bool": {
|
|
88
|
+
"aws:SecureTransport": "false"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"Effect": "Deny",
|
|
92
|
+
"Principal": {
|
|
93
|
+
"AWS": "*"
|
|
94
|
+
},
|
|
95
|
+
"Resource": [
|
|
96
|
+
{
|
|
97
|
+
"Fn::GetAtt": [
|
|
98
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
99
|
+
"Arn"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"Fn::Join": [
|
|
104
|
+
"",
|
|
105
|
+
[
|
|
106
|
+
{
|
|
107
|
+
"Fn::GetAtt": [
|
|
108
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
109
|
+
"Arn"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"/*"
|
|
113
|
+
]
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"Action": [
|
|
120
|
+
"s3:DeleteObject*",
|
|
121
|
+
"s3:GetBucket*",
|
|
122
|
+
"s3:List*",
|
|
123
|
+
"s3:PutBucketPolicy"
|
|
124
|
+
],
|
|
125
|
+
"Effect": "Allow",
|
|
126
|
+
"Principal": {
|
|
127
|
+
"AWS": {
|
|
128
|
+
"Fn::GetAtt": [
|
|
129
|
+
"CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
|
|
130
|
+
"Arn"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"Resource": [
|
|
135
|
+
{
|
|
136
|
+
"Fn::GetAtt": [
|
|
137
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
138
|
+
"Arn"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"Fn::Join": [
|
|
143
|
+
"",
|
|
144
|
+
[
|
|
145
|
+
{
|
|
146
|
+
"Fn::GetAtt": [
|
|
147
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
148
|
+
"Arn"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"/*"
|
|
152
|
+
]
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"Action": "s3:GetObject",
|
|
159
|
+
"Effect": "Allow",
|
|
160
|
+
"Principal": {
|
|
161
|
+
"CanonicalUser": {
|
|
162
|
+
"Fn::GetAtt": [
|
|
163
|
+
"testcloudfrontoais3CloudFrontDistributionOrigin1S3OriginF57A3CB1",
|
|
164
|
+
"S3CanonicalUserId"
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"Resource": {
|
|
169
|
+
"Fn::Join": [
|
|
170
|
+
"",
|
|
171
|
+
[
|
|
172
|
+
{
|
|
173
|
+
"Fn::GetAtt": [
|
|
174
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
175
|
+
"Arn"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"/*"
|
|
179
|
+
]
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"Action": "s3:GetObject",
|
|
185
|
+
"Condition": {
|
|
186
|
+
"StringEquals": {
|
|
187
|
+
"AWS:SourceArn": {
|
|
188
|
+
"Fn::Join": [
|
|
189
|
+
"",
|
|
190
|
+
[
|
|
191
|
+
"arn:",
|
|
192
|
+
{
|
|
193
|
+
"Ref": "AWS::Partition"
|
|
194
|
+
},
|
|
195
|
+
":cloudfront::",
|
|
196
|
+
{
|
|
197
|
+
"Ref": "AWS::AccountId"
|
|
198
|
+
},
|
|
199
|
+
":distribution/",
|
|
200
|
+
{
|
|
201
|
+
"Ref": "testcloudfrontoais3CloudFrontDistribution0E089CC5"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"Effect": "Allow",
|
|
209
|
+
"Principal": {
|
|
210
|
+
"Service": "cloudfront.amazonaws.com"
|
|
211
|
+
},
|
|
212
|
+
"Resource": {
|
|
213
|
+
"Fn::Join": [
|
|
214
|
+
"",
|
|
215
|
+
[
|
|
216
|
+
{
|
|
217
|
+
"Fn::GetAtt": [
|
|
218
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
219
|
+
"Arn"
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"/*"
|
|
223
|
+
]
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"Version": "2012-10-17"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"constructInfo": {
|
|
233
|
+
"fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy",
|
|
234
|
+
"version": "2.177.0"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"constructInfo": {
|
|
239
|
+
"fqn": "aws-cdk-lib.aws_s3.BucketPolicy",
|
|
240
|
+
"version": "2.177.0"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"AutoDeleteObjectsCustomResource": {
|
|
244
|
+
"id": "AutoDeleteObjectsCustomResource",
|
|
245
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket/AutoDeleteObjectsCustomResource",
|
|
246
|
+
"children": {
|
|
247
|
+
"Default": {
|
|
248
|
+
"id": "Default",
|
|
249
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/S3Bucket/AutoDeleteObjectsCustomResource/Default",
|
|
250
|
+
"constructInfo": {
|
|
251
|
+
"fqn": "aws-cdk-lib.CfnResource",
|
|
252
|
+
"version": "2.177.0"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"constructInfo": {
|
|
257
|
+
"fqn": "aws-cdk-lib.CustomResource",
|
|
258
|
+
"version": "2.177.0"
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"constructInfo": {
|
|
263
|
+
"fqn": "aws-cdk-lib.aws_s3.Bucket",
|
|
264
|
+
"version": "2.177.0"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"SetHttpSecurityHeaders": {
|
|
268
|
+
"id": "SetHttpSecurityHeaders",
|
|
269
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/SetHttpSecurityHeaders",
|
|
270
|
+
"children": {
|
|
271
|
+
"Resource": {
|
|
272
|
+
"id": "Resource",
|
|
273
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/SetHttpSecurityHeaders/Resource",
|
|
274
|
+
"attributes": {
|
|
275
|
+
"aws:cdk:cloudformation:type": "AWS::CloudFront::Function",
|
|
276
|
+
"aws:cdk:cloudformation:props": {
|
|
277
|
+
"autoPublish": true,
|
|
278
|
+
"functionCode": "function handler(event) { var response = event.response; var headers = response.headers; headers['strict-transport-security'] = { value: 'max-age=63072000; includeSubdomains; preload'}; headers['content-security-policy'] = { value: \"default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'\"}; headers['x-content-type-options'] = { value: 'nosniff'}; headers['x-frame-options'] = {value: 'DENY'}; headers['x-xss-protection'] = {value: '1; mode=block'}; return response; }",
|
|
279
|
+
"functionConfig": {
|
|
280
|
+
"comment": "SetHttpSecurityHeadersc8ef3112652a2611d5eff9255f981ddb83b0566ae4",
|
|
281
|
+
"runtime": "cloudfront-js-1.0"
|
|
282
|
+
},
|
|
283
|
+
"name": "SetHttpSecurityHeadersc8ef3112652a2611d5eff9255f981ddb83b0566ae4"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"constructInfo": {
|
|
287
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.CfnFunction",
|
|
288
|
+
"version": "2.177.0"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"constructInfo": {
|
|
293
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.Function",
|
|
294
|
+
"version": "2.177.0"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"CloudFrontDistribution": {
|
|
298
|
+
"id": "CloudFrontDistribution",
|
|
299
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/CloudFrontDistribution",
|
|
300
|
+
"children": {
|
|
301
|
+
"Origin1": {
|
|
302
|
+
"id": "Origin1",
|
|
303
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/CloudFrontDistribution/Origin1",
|
|
304
|
+
"children": {
|
|
305
|
+
"S3Origin": {
|
|
306
|
+
"id": "S3Origin",
|
|
307
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/CloudFrontDistribution/Origin1/S3Origin",
|
|
308
|
+
"children": {
|
|
309
|
+
"Resource": {
|
|
310
|
+
"id": "Resource",
|
|
311
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/CloudFrontDistribution/Origin1/S3Origin/Resource",
|
|
312
|
+
"attributes": {
|
|
313
|
+
"aws:cdk:cloudformation:type": "AWS::CloudFront::CloudFrontOriginAccessIdentity",
|
|
314
|
+
"aws:cdk:cloudformation:props": {
|
|
315
|
+
"cloudFrontOriginAccessIdentityConfig": {
|
|
316
|
+
"comment": "Identity for cftoais3nologgingtestcloudfrontoais3CloudFrontDistributionOrigin18473615C"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"constructInfo": {
|
|
321
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.CfnCloudFrontOriginAccessIdentity",
|
|
322
|
+
"version": "2.177.0"
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"constructInfo": {
|
|
327
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.OriginAccessIdentity",
|
|
328
|
+
"version": "2.177.0"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"constructInfo": {
|
|
333
|
+
"fqn": "constructs.Construct",
|
|
334
|
+
"version": "10.4.2"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"Resource": {
|
|
338
|
+
"id": "Resource",
|
|
339
|
+
"path": "cftoais3-no-logging/test-cloudfront-oai-s3/CloudFrontDistribution/Resource",
|
|
340
|
+
"attributes": {
|
|
341
|
+
"aws:cdk:cloudformation:type": "AWS::CloudFront::Distribution",
|
|
342
|
+
"aws:cdk:cloudformation:props": {
|
|
343
|
+
"distributionConfig": {
|
|
344
|
+
"enabled": true,
|
|
345
|
+
"origins": [
|
|
346
|
+
{
|
|
347
|
+
"domainName": {
|
|
348
|
+
"Fn::GetAtt": [
|
|
349
|
+
"testcloudfrontoais3S3Bucket578AB9F3",
|
|
350
|
+
"RegionalDomainName"
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
"id": "cftoais3nologgingtestcloudfrontoais3CloudFrontDistributionOrigin18473615C",
|
|
354
|
+
"s3OriginConfig": {
|
|
355
|
+
"originAccessIdentity": {
|
|
356
|
+
"Fn::Join": [
|
|
357
|
+
"",
|
|
358
|
+
[
|
|
359
|
+
"origin-access-identity/cloudfront/",
|
|
360
|
+
{
|
|
361
|
+
"Ref": "testcloudfrontoais3CloudFrontDistributionOrigin1S3OriginF57A3CB1"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"defaultCacheBehavior": {
|
|
370
|
+
"pathPattern": "*",
|
|
371
|
+
"targetOriginId": "cftoais3nologgingtestcloudfrontoais3CloudFrontDistributionOrigin18473615C",
|
|
372
|
+
"cachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
|
|
373
|
+
"compress": true,
|
|
374
|
+
"viewerProtocolPolicy": "redirect-to-https",
|
|
375
|
+
"functionAssociations": [
|
|
376
|
+
{
|
|
377
|
+
"functionArn": {
|
|
378
|
+
"Fn::GetAtt": [
|
|
379
|
+
"testcloudfrontoais3SetHttpSecurityHeaders4EB3C97B",
|
|
380
|
+
"FunctionARN"
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
"eventType": "viewer-response"
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
"defaultRootObject": "index.html",
|
|
388
|
+
"httpVersion": "http2",
|
|
389
|
+
"ipv6Enabled": true
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"constructInfo": {
|
|
394
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.CfnDistribution",
|
|
395
|
+
"version": "2.177.0"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"constructInfo": {
|
|
400
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.Distribution",
|
|
401
|
+
"version": "2.177.0"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"constructInfo": {
|
|
406
|
+
"fqn": "@aws-solutions-constructs/aws-cloudfront-oai-s3.CloudFrontToOaiToS3",
|
|
407
|
+
"version": "2.78.1"
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
"LatestNodeRuntimeMap": {
|
|
411
|
+
"id": "LatestNodeRuntimeMap",
|
|
412
|
+
"path": "cftoais3-no-logging/LatestNodeRuntimeMap",
|
|
413
|
+
"constructInfo": {
|
|
414
|
+
"fqn": "aws-cdk-lib.CfnMapping",
|
|
415
|
+
"version": "2.177.0"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"Custom::S3AutoDeleteObjectsCustomResourceProvider": {
|
|
419
|
+
"id": "Custom::S3AutoDeleteObjectsCustomResourceProvider",
|
|
420
|
+
"path": "cftoais3-no-logging/Custom::S3AutoDeleteObjectsCustomResourceProvider",
|
|
421
|
+
"children": {
|
|
422
|
+
"Staging": {
|
|
423
|
+
"id": "Staging",
|
|
424
|
+
"path": "cftoais3-no-logging/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging",
|
|
425
|
+
"constructInfo": {
|
|
426
|
+
"fqn": "aws-cdk-lib.AssetStaging",
|
|
427
|
+
"version": "2.177.0"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
"Role": {
|
|
431
|
+
"id": "Role",
|
|
432
|
+
"path": "cftoais3-no-logging/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role",
|
|
433
|
+
"constructInfo": {
|
|
434
|
+
"fqn": "aws-cdk-lib.CfnResource",
|
|
435
|
+
"version": "2.177.0"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"Handler": {
|
|
439
|
+
"id": "Handler",
|
|
440
|
+
"path": "cftoais3-no-logging/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler",
|
|
441
|
+
"constructInfo": {
|
|
442
|
+
"fqn": "aws-cdk-lib.CfnResource",
|
|
443
|
+
"version": "2.177.0"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"constructInfo": {
|
|
448
|
+
"fqn": "aws-cdk-lib.CustomResourceProviderBase",
|
|
449
|
+
"version": "2.177.0"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"Integ": {
|
|
453
|
+
"id": "Integ",
|
|
454
|
+
"path": "cftoais3-no-logging/Integ",
|
|
455
|
+
"children": {
|
|
456
|
+
"DefaultTest": {
|
|
457
|
+
"id": "DefaultTest",
|
|
458
|
+
"path": "cftoais3-no-logging/Integ/DefaultTest",
|
|
459
|
+
"children": {
|
|
460
|
+
"Default": {
|
|
461
|
+
"id": "Default",
|
|
462
|
+
"path": "cftoais3-no-logging/Integ/DefaultTest/Default",
|
|
463
|
+
"constructInfo": {
|
|
464
|
+
"fqn": "constructs.Construct",
|
|
465
|
+
"version": "10.4.2"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"DeployAssert": {
|
|
469
|
+
"id": "DeployAssert",
|
|
470
|
+
"path": "cftoais3-no-logging/Integ/DefaultTest/DeployAssert",
|
|
471
|
+
"children": {
|
|
472
|
+
"BootstrapVersion": {
|
|
473
|
+
"id": "BootstrapVersion",
|
|
474
|
+
"path": "cftoais3-no-logging/Integ/DefaultTest/DeployAssert/BootstrapVersion",
|
|
475
|
+
"constructInfo": {
|
|
476
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
477
|
+
"version": "2.177.0"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"CheckBootstrapVersion": {
|
|
481
|
+
"id": "CheckBootstrapVersion",
|
|
482
|
+
"path": "cftoais3-no-logging/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
|
|
483
|
+
"constructInfo": {
|
|
484
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
485
|
+
"version": "2.177.0"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"constructInfo": {
|
|
490
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
491
|
+
"version": "2.177.0"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
"constructInfo": {
|
|
496
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
|
|
497
|
+
"version": "2.177.0-alpha.0"
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
"constructInfo": {
|
|
502
|
+
"fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
|
|
503
|
+
"version": "2.177.0-alpha.0"
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
"BootstrapVersion": {
|
|
507
|
+
"id": "BootstrapVersion",
|
|
508
|
+
"path": "cftoais3-no-logging/BootstrapVersion",
|
|
509
|
+
"constructInfo": {
|
|
510
|
+
"fqn": "aws-cdk-lib.CfnParameter",
|
|
511
|
+
"version": "2.177.0"
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
"CheckBootstrapVersion": {
|
|
515
|
+
"id": "CheckBootstrapVersion",
|
|
516
|
+
"path": "cftoais3-no-logging/CheckBootstrapVersion",
|
|
517
|
+
"constructInfo": {
|
|
518
|
+
"fqn": "aws-cdk-lib.CfnRule",
|
|
519
|
+
"version": "2.177.0"
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"constructInfo": {
|
|
524
|
+
"fqn": "aws-cdk-lib.Stack",
|
|
525
|
+
"version": "2.177.0"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"Tree": {
|
|
529
|
+
"id": "Tree",
|
|
530
|
+
"path": "Tree",
|
|
531
|
+
"constructInfo": {
|
|
532
|
+
"fqn": "constructs.Construct",
|
|
533
|
+
"version": "10.4.2"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"constructInfo": {
|
|
538
|
+
"fqn": "aws-cdk-lib.App",
|
|
539
|
+
"version": "2.177.0"
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 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
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 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 aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
17
|
+
const lib_1 = require("../lib");
|
|
18
|
+
const core_1 = require("@aws-solutions-constructs/core");
|
|
19
|
+
const integ_tests_alpha_1 = require("@aws-cdk/integ-tests-alpha");
|
|
20
|
+
// Setup
|
|
21
|
+
const app = new aws_cdk_lib_1.App();
|
|
22
|
+
const stack = new aws_cdk_lib_1.Stack(app, (0, core_1.generateIntegStackName)(__filename));
|
|
23
|
+
stack.templateOptions.description = 'Integration Test for aws-cloudfront-oai-s3';
|
|
24
|
+
// Definitions
|
|
25
|
+
const props = {
|
|
26
|
+
cloudFrontLoggingBucketProps: {
|
|
27
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
28
|
+
autoDeleteObjects: true
|
|
29
|
+
},
|
|
30
|
+
insertHttpSecurityHeaders: false,
|
|
31
|
+
bucketProps: {
|
|
32
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
33
|
+
autoDeleteObjects: true
|
|
34
|
+
},
|
|
35
|
+
loggingBucketProps: {
|
|
36
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
37
|
+
autoDeleteObjects: true
|
|
38
|
+
},
|
|
39
|
+
cloudFrontLoggingBucketAccessLogBucketProps: {
|
|
40
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
41
|
+
autoDeleteObjects: true
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
new lib_1.CloudFrontToOaiToS3(stack, 'test-cloudfront-oai-s3-no-security-headers', props);
|
|
45
|
+
(0, core_1.suppressCustomHandlerCfnNagWarnings)(stack, 'Custom::S3AutoDeleteObjectsCustomResourceProvider');
|
|
46
|
+
// Synth
|
|
47
|
+
new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
|
|
48
|
+
stack
|
|
49
|
+
] });
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuY2Z0b2FpczMtbm8tc2VjdXJpdHktaGVhZGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludGVnLmNmdG9haXMzLW5vLXNlY3VyaXR5LWhlYWRlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7OztHQVdHOztBQUVILFVBQVU7QUFDViw2Q0FBd0Q7QUFDeEQsZ0NBQXVFO0FBQ3ZFLHlEQUE2RztBQUM3RyxrRUFBdUQ7QUFFdkQsUUFBUTtBQUNSLE1BQU0sR0FBRyxHQUFHLElBQUksaUJBQUcsRUFBRSxDQUFDO0FBQ3RCLE1BQU0sS0FBSyxHQUFHLElBQUksbUJBQUssQ0FBQyxHQUFHLEVBQUUsSUFBQSw2QkFBc0IsRUFBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLEtBQUssQ0FBQyxlQUFlLENBQUM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3RvbUhhbmRsZXJDZm5OYWdXYXJuaW5ncyhzdGFjaywgJ0N1c3RvbTo6UzNBdXRvRGVsZXRlT2JqZWN0c0N1c3RvbVJlc291cmNlUHJvdmlkZXInKTtcbi8vIFN5bnRoXG5uZXcgSW50ZWdUZXN0KHN0YWNrLCAnSW50ZWcnLCB7IHRlc3RDYXNlczogW1xuICBzdGFja1xuXSB9KTtcbiJdfQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var f=Object.create,i=Object.defineProperty,I=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,w=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty,A=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},d=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of C(e))!P.call(t,s)&&s!==o&&i(t,s,{get:()=>e[s],enumerable:!(r=I(e,s))||r.enumerable});return t},l=(t,e,o)=>(o=t!=null?f(w(t)):{},d(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t)),B=t=>d(i({},"__esModule",{value:!0}),t),q={};A(q,{autoDeleteHandler:()=>S,handler:()=>H}),module.exports=B(q);var h=require("@aws-sdk/client-s3"),y=l(require("https")),m=l(require("url")),a={sendHttpRequest:D,log:T,includeStackTraces:!0,userHandlerIndex:"./index"},p="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",L="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";function R(t){return async(e,o)=>{let r={...e,ResponseURL:"..."};if(a.log(JSON.stringify(r,void 0,2)),e.RequestType==="Delete"&&e.PhysicalResourceId===p){a.log("ignoring DELETE event caused by a failed CREATE event"),await u("SUCCESS",e);return}try{let s=await t(r,o),n=k(e,s);await u("SUCCESS",n)}catch(s){let n={...e,Reason:a.includeStackTraces?s.stack:s.message};n.PhysicalResourceId||(e.RequestType==="Create"?(a.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),n.PhysicalResourceId=p):a.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(e)}`)),await u("FAILED",n)}}}function k(t,e={}){let o=e.PhysicalResourceId??t.PhysicalResourceId??t.RequestId;if(t.RequestType==="Delete"&&o!==t.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${t.PhysicalResourceId}" to "${e.PhysicalResourceId}" during deletion`);return{...t,...e,PhysicalResourceId:o}}async function u(t,e){let o={Status:t,Reason:e.Reason??t,StackId:e.StackId,RequestId:e.RequestId,PhysicalResourceId:e.PhysicalResourceId||L,LogicalResourceId:e.LogicalResourceId,NoEcho:e.NoEcho,Data:e.Data},r=m.parse(e.ResponseURL),s=`${r.protocol}//${r.hostname}/${r.pathname}?***`;a.log("submit response to cloudformation",s,o);let n=JSON.stringify(o),E={hostname:r.hostname,path:r.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(n,"utf8")}};await O({attempts:5,sleep:1e3},a.sendHttpRequest)(E,n)}async function D(t,e){return new Promise((o,r)=>{try{let s=y.request(t,n=>{n.resume(),!n.statusCode||n.statusCode>=400?r(new Error(`Unsuccessful HTTP response: ${n.statusCode}`)):o()});s.on("error",r),s.write(e),s.end()}catch(s){r(s)}})}function T(t,...e){console.log(t,...e)}function O(t,e){return async(...o)=>{let r=t.attempts,s=t.sleep;for(;;)try{return await e(...o)}catch(n){if(r--<=0)throw n;await b(Math.floor(Math.random()*s)),s*=2}}}async function b(t){return new Promise(e=>setTimeout(e,t))}var g="aws-cdk:auto-delete-objects",x=JSON.stringify({Version:"2012-10-17",Statement:[]}),c=new h.S3({}),H=R(S);async function S(t){switch(t.RequestType){case"Create":return;case"Update":return{PhysicalResourceId:(await F(t)).PhysicalResourceId};case"Delete":return N(t.ResourceProperties?.BucketName)}}async function F(t){let e=t,o=e.OldResourceProperties?.BucketName;return{PhysicalResourceId:e.ResourceProperties?.BucketName??o}}async function _(t){try{let e=(await c.getBucketPolicy({Bucket:t}))?.Policy??x,o=JSON.parse(e);o.Statement.push({Principal:"*",Effect:"Deny",Action:["s3:PutObject"],Resource:[`arn:aws:s3:::${t}/*`]}),await c.putBucketPolicy({Bucket:t,Policy:JSON.stringify(o)})}catch(e){if(e.name==="NoSuchBucket")throw e;console.log(`Could not set new object deny policy on bucket '${t}' prior to deletion.`)}}async function U(t){let e;do{e=await c.listObjectVersions({Bucket:t});let o=[...e.Versions??[],...e.DeleteMarkers??[]];if(o.length===0)return;let r=o.map(s=>({Key:s.Key,VersionId:s.VersionId}));await c.deleteObjects({Bucket:t,Delete:{Objects:r}})}while(e?.IsTruncated)}async function N(t){if(!t)throw new Error("No BucketName was provided.");try{if(!await W(t)){console.log(`Bucket does not have '${g}' tag, skipping cleaning.`);return}await _(t),await U(t)}catch(e){if(e.name==="NoSuchBucket"){console.log(`Bucket '${t}' does not exist.`);return}throw e}}async function W(t){return(await c.getBucketTagging({Bucket:t})).TagSet?.some(o=>o.Key===g&&o.Value==="true")}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"39.0.0"}
|
package/test/integ.cftoais3-no-security-headers.js.snapshot/cftoais3-no-security-headers.assets.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "39.0.0",
|
|
3
|
+
"files": {
|
|
4
|
+
"faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": {
|
|
5
|
+
"source": {
|
|
6
|
+
"path": "asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6",
|
|
7
|
+
"packaging": "zip"
|
|
8
|
+
},
|
|
9
|
+
"destinations": {
|
|
10
|
+
"current_account-current_region": {
|
|
11
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
12
|
+
"objectKey": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
|
|
13
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"cf28050d9f6dca28e44fd59eaa742a1bf2f11c4f650e9be09a9eb80fcf0ee709": {
|
|
18
|
+
"source": {
|
|
19
|
+
"path": "cftoais3-no-security-headers.template.json",
|
|
20
|
+
"packaging": "file"
|
|
21
|
+
},
|
|
22
|
+
"destinations": {
|
|
23
|
+
"current_account-current_region": {
|
|
24
|
+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
25
|
+
"objectKey": "cf28050d9f6dca28e44fd59eaa742a1bf2f11c4f650e9be09a9eb80fcf0ee709.json",
|
|
26
|
+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dockerImages": {}
|
|
32
|
+
}
|