@aws-solutions-constructs/aws-cloudfront-s3 2.0.0-rc.2 → 2.0.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 +59 -1061
- package/README.md +5 -2
- package/lib/index.d.ts +17 -1
- package/lib/index.js +10 -7
- package/package.json +5 -5
- package/test/integ.custom-originPath.d.ts +13 -0
- package/test/integ.custom-originPath.expected.json +425 -0
- package/test/integ.custom-originPath.js +28 -0
- package/test/integ.existing-bucket.js +2 -2
- package/test/integ.no-arguments.expected.json +11 -90
- package/test/integ.no-arguments.js +10 -3
- package/test/test.cloudfront-s3.test.js +50 -5
package/README.md
CHANGED
|
@@ -45,12 +45,14 @@ _Parameters_
|
|
|
45
45
|
|
|
46
46
|
| **Name** | **Type** | **Description** |
|
|
47
47
|
|:-------------|:----------------|-----------------|
|
|
48
|
-
|
|
|
48
|
+
|existingBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Existing instance of S3 Bucket object or interface. If this is provided, then also providing bucketProps will cause an error. |
|
|
49
49
|
|bucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Bucket.|
|
|
50
50
|
|cloudFrontDistributionProps?|[`cloudfront.DistributionProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudfront.DistributionProps.html)|Optional user provided props to override the default props for CloudFront Distribution|
|
|
51
51
|
|insertHttpSecurityHeaders?|`boolean`|Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from CloudFront|
|
|
52
|
+
|originPath?|`string`|Optional user provided props to provide an[originPath](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudfront-origins.S3OriginProps.html#originpath) that CloudFront appends to the origin domain name when CloudFront requests content from the origin. The string should start with a `/`, for example: `/production`. Default value is `'/'`|
|
|
52
53
|
|loggingBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Logging Bucket.|
|
|
53
54
|
|cloudFrontLoggingBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the CloudFront Logging Bucket.|
|
|
55
|
+
|logS3AccessLogs?| boolean|Whether to turn on Access Logging for the S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. default - true|
|
|
54
56
|
|
|
55
57
|
## Pattern Properties
|
|
56
58
|
|
|
@@ -60,7 +62,7 @@ _Parameters_
|
|
|
60
62
|
|cloudFrontFunction?|[`cloudfront.Function`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudfront.Function.html)|Returns an instance of the Cloudfront function created by the pattern.|
|
|
61
63
|
|cloudFrontLoggingBucket|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-readme.html)|Returns an instance of the logging bucket for CloudFront WebDistribution.|
|
|
62
64
|
|s3BucketInterface|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Returns an instance of s3.IBucket created by the construct|
|
|
63
|
-
|s3Bucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of s3.Bucket created by the construct. IMPORTANT: If
|
|
65
|
+
|s3Bucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of s3.Bucket created by the construct. IMPORTANT: If existingBucketObj was provided in Pattern Construct Props, this property will be `undefined`|
|
|
64
66
|
|s3LoggingBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of s3.Bucket created by the construct as the logging bucket for the primary bucket.|
|
|
65
67
|
|
|
66
68
|
## Default settings
|
|
@@ -70,6 +72,7 @@ Out of the box implementation of the Construct without any override will set the
|
|
|
70
72
|
### Amazon CloudFront
|
|
71
73
|
* Configure Access logging for CloudFront WebDistribution
|
|
72
74
|
* Enable automatic injection of best practice HTTP security headers in all responses from CloudFront WebDistribution
|
|
75
|
+
* CloudFront originPath set to `'/'`
|
|
73
76
|
|
|
74
77
|
### Amazon S3 Bucket
|
|
75
78
|
* Configure Access logging for S3 Bucket
|
package/lib/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface CloudFrontToS3Props {
|
|
|
22
22
|
*
|
|
23
23
|
* @default - None
|
|
24
24
|
*/
|
|
25
|
-
readonly
|
|
25
|
+
readonly existingBucketObj?: s3.IBucket;
|
|
26
26
|
/**
|
|
27
27
|
* Optional user provided props to override the default props for the S3 Bucket.
|
|
28
28
|
*
|
|
@@ -41,6 +41,14 @@ export interface CloudFrontToS3Props {
|
|
|
41
41
|
* @default - true
|
|
42
42
|
*/
|
|
43
43
|
readonly insertHttpSecurityHeaders?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Optional user provided props to provide an originPath that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
|
|
46
|
+
*
|
|
47
|
+
* The string should start with a `/`, for example `/production`.
|
|
48
|
+
*
|
|
49
|
+
* @dafault = '/'
|
|
50
|
+
*/
|
|
51
|
+
readonly originPath?: string;
|
|
44
52
|
/**
|
|
45
53
|
* Optional user provided props to override the default props for the S3 Logging Bucket.
|
|
46
54
|
*
|
|
@@ -53,6 +61,14 @@ export interface CloudFrontToS3Props {
|
|
|
53
61
|
* @default - Default props are used
|
|
54
62
|
*/
|
|
55
63
|
readonly cloudFrontLoggingBucketProps?: s3.BucketProps;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to turn on Access Logs for the S3 bucket with the associated storage costs.
|
|
66
|
+
*
|
|
67
|
+
* Enabling Access Logging is a best practice.
|
|
68
|
+
*
|
|
69
|
+
* @default - true
|
|
70
|
+
*/
|
|
71
|
+
readonly logS3AccessLogs?: boolean;
|
|
56
72
|
}
|
|
57
73
|
export declare class CloudFrontToS3 extends Construct {
|
|
58
74
|
readonly cloudFrontWebDistribution: cloudfront.Distribution;
|
package/lib/index.js
CHANGED
|
@@ -17,21 +17,24 @@ class CloudFrontToS3 extends constructs_1.Construct {
|
|
|
17
17
|
constructor(scope, id, props) {
|
|
18
18
|
super(scope, id);
|
|
19
19
|
defaults.CheckProps(props);
|
|
20
|
-
|
|
20
|
+
let bucket;
|
|
21
|
+
if (!props.existingBucketObj) {
|
|
21
22
|
[this.s3Bucket, this.s3LoggingBucket] = defaults.buildS3Bucket(this, {
|
|
22
23
|
bucketProps: props.bucketProps,
|
|
23
|
-
loggingBucketProps: props.loggingBucketProps
|
|
24
|
+
loggingBucketProps: props.loggingBucketProps,
|
|
25
|
+
logS3AccessLogs: props.logS3AccessLogs
|
|
24
26
|
});
|
|
25
|
-
|
|
27
|
+
bucket = this.s3Bucket;
|
|
26
28
|
}
|
|
27
29
|
else {
|
|
28
|
-
|
|
30
|
+
bucket = props.existingBucketObj;
|
|
29
31
|
}
|
|
32
|
+
this.s3BucketInterface = bucket;
|
|
30
33
|
[this.cloudFrontWebDistribution, this.cloudFrontFunction, this.cloudFrontLoggingBucket] =
|
|
31
|
-
defaults.CloudFrontDistributionForS3(this, this.s3BucketInterface, props.cloudFrontDistributionProps, props.insertHttpSecurityHeaders, props.cloudFrontLoggingBucketProps);
|
|
34
|
+
defaults.CloudFrontDistributionForS3(this, this.s3BucketInterface, props.cloudFrontDistributionProps, props.insertHttpSecurityHeaders, props.originPath, props.cloudFrontLoggingBucketProps);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
exports.CloudFrontToS3 = CloudFrontToS3;
|
|
35
38
|
_a = JSII_RTTI_SYMBOL_1;
|
|
36
|
-
CloudFrontToS3[_a] = { fqn: "@aws-solutions-constructs/aws-cloudfront-s3.CloudFrontToS3", version: "2.0.0
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
CloudFrontToS3[_a] = { fqn: "@aws-solutions-constructs/aws-cloudfront-s3.CloudFrontToS3", version: "2.0.0" };
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWlCQSwyQ0FBdUM7QUFDdkMsMkRBQTJEO0FBc0IzRCxNQUFhLGNBQWUsU0FBUSxzQkFBUzs7Ozs7Ozs7O0lBUzNDLFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsS0FBMEI7UUFDbEUsS0FBSyxDQUFDLEtBQUssRUFBRSxFQUFFLENBQUMsQ0FBQztRQUNqQixRQUFRLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBRTNCLElBQUksTUFBa0IsQ0FBQztRQUV2QixJQUFJLENBQUMsS0FBSyxDQUFDLGlCQUFpQixFQUFFO1lBQzVCLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDLEdBQUcsUUFBUSxDQUFDLGFBQWEsQ0FBQyxJQUFJLEVBQUU7Z0JBQ25FLFdBQVcsRUFBRSxLQUFLLENBQUMsV0FBVztnQkFDOUIsa0JBQWtCLEVBQUUsS0FBSyxDQUFDLGtCQUFrQjtnQkFDNUMsZUFBZSxFQUFFLEtBQUssQ0FBQyxlQUFlO2FBQ3ZDLENBQUMsQ0FBQztZQUNILE1BQU0sR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDO1NBQ3hCO2FBQU07WUFDTCxNQUFNLEdBQUcsS0FBSyxDQUFDLGlCQUFpQixDQUFDO1NBQ2xDO1FBRUQsSUFBSSxDQUFDLGlCQUFpQixHQ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dGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9uc1xuICogIGFuZCBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS5cbiAqL1xuXG5pbXBvcnQgKiBhcyBjbG91ZGZyb250IGZyb20gJ2F3cy1jZGstbGliL2F3cy1jbG91ZGZyb250JztcbmltcG9ydCAqIGFzIHMzIGZyb20gJ2F3cy1jZGstbGliL2F3cy1zMyc7XG4vLyBOb3RlOiBUbyBlbnN1cmUgQ0RLdjIgY29tcGF0aWJpbGl0eSwga2VlcCB0aGUgaW1wb3J0IHN0YXRlbWVudCBmb3IgQ29uc3RydWN0IHNlcGFyYXRlXG5pbXBvcnQgeyAgfSBmcm9tICdhd3MtY2RrLWxpYic7XG5pbXBvcnQgeyBDb25zdHJ1Y3QgfSBmcm9tICdjb25zdHJ1Y3RzJztcbmltcG9ydCAqIGFzIGRlZmF1bHRzIGZyb20gJ0Bhd3Mtc29sdXRpb25zLWNvbnN0cnVjdHMvY29yZSc7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbmV4cG9ydCBpbnRlcmZhY2UgQ2xvdWRGcm9udFRvUzNQcm9wcyB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBleGlzdGluZ0J1Y2tldE9iaj86IHMzLklCdWNrZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgYnVja2V0UHJvcHM/OiBzMy5CdWNrZXRQcm9wcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGNsb3VkRnJvbnREaXN0cmlidXRpb25Qcm9wcz86IGNsb3VkZnJvbnQuRGlzdHJpYnV0aW9uUHJvcHMgfCBhbnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGluc2VydEh0dHBTZWN1cml0eUhlYWRlcnM/OiBib29sZWFuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgb3JpZ2luUGF0aD86IHN0cmluZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGxvZ2dpbmdCdWNrZXRQcm9wcz86IHMzLkJ1Y2tldFByb3BzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGNsb3VkRnJvbnRMb2dnaW5nQnVja2V0UHJvcHM/OiBzMy5CdWNrZXRQcm9wc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBsb2dTM0FjY2Vzc0xvZ3M/OiBib29sZWFuO1xufVxuXG5leHBvcnQgY2xhc3MgQ2xvdWRGcm9udFRvUzMgZXh0ZW5kcyBDb25zdHJ1Y3Qge1xuICBwdWJsaWMgcmVhZG9ubHkgY2xvdWRGcm9udFdlYkRpc3RyaWJ1dGlvbjogY2xvdWRmcm9udC5EaXN0cmlidXRpb247XG4gIHB1YmxpYyByZWFkb25seSBjbG91ZEZyb250RnVuY3Rpb24/OiBjbG91ZGZyb250LkZ1bmN0aW9uO1xuICBwdWJsaWMgcmVhZG9ubHkgY2xvdWRGcm9udExvZ2dpbmdCdWNrZXQ/OiBzMy5CdWNrZXQ7XG4gIHB1YmxpYyByZWFkb25seSBzM0J1Y2tldEludGVyZmFjZTogczMuSUJ1Y2tldDtcbiAgcHVibGljIHJlYWRvbmx5IHMzQnVja2V0PzogczMuQnVja2V0O1xuICBwdWJsaWMgcmVhZG9ubHkgczNMb2dnaW5nQnVja2V0PzogczMuQnVja2V0O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgY29uc3RydWN0b3Ioc2NvcGU6IENvbnN0cnVjdCwgaWQ6IHN0cmluZywgcHJvcHM6IENsb3VkRnJvbnRUb1MzUHJvcHMpIHtcbiAgICBzdXBlcihzY29wZSwgaWQpO1xuICAgIGRlZmF1bHRzLkNoZWNrUHJvcHMocHJvcHMpO1xuXG4gICAgbGV0IGJ1Y2tldDogczMuSUJ1Y2tldDtcblxuICAgIGlmICghcHJvcHMuZXhpc3RpbmdCdWNrZXRPYmopIHtcbiAgICAgIFt0aGlzLnMzQnVja2V0LCB0aGlzLnMzTG9nZ2luZ0J1Y2tldF0gPSBkZWZhdWx0cy5idWlsZFMzQnVja2V0KHRoaXMsIHtcbiAgICAgICAgYnVja2V0UHJvcHM6IHByb3BzLmJ1Y2tldFByb3BzLFxuICAgICAgICBsb2dnaW5nQnVja2V0UHJvcHM6IHByb3BzLmxvZ2dpbmdCdWNrZXRQcm9wcyxcbiAgICAgICAgbG9nUzNBY2Nlc3NMb2dzOiBwcm9wcy5sb2dTM0FjY2Vzc0xvZ3NcbiAgICAgIH0pO1xuICAgICAgYnVja2V0ID0gdGhpcy5zM0J1Y2tldDtcbiAgICB9IGVsc2Uge1xuICAgICAgYnVja2V0ID0gcHJvcHMuZXhpc3RpbmdCdWNrZXRPYmo7XG4gICAgfVxuXG4gICAgdGhpcy5zM0J1Y2tldEludGVyZmFjZSA9IGJ1Y2tldDtcblxuICAgIFt0aGlzLmNsb3VkRnJvbnRXZWJEaXN0cmlidXRpb24sIHRoaXMuY2xvdWRGcm9udEZ1bmN0aW9uLCB0aGlzLmNsb3VkRnJvbnRMb2dnaW5nQnVja2V0XSA9XG4gICAgICBkZWZhdWx0cy5DbG91ZEZyb250RGlzdHJpYnV0aW9uRm9yUzModGhpcywgdGhpcy5zM0J1Y2tldEludGVyZmFjZSxcbiAgICAgICAgcHJvcHMuY2xvdWRGcm9udERpc3RyaWJ1dGlvblByb3BzLCBwcm9wcy5pbnNlcnRIdHRwU2VjdXJpdHlIZWFkZXJzLCBwcm9wcy5vcmlnaW5QYXRoLCBwcm9wcy5jbG91ZEZyb250TG9nZ2luZ0J1Y2tldFByb3BzKTtcbiAgfVxuXG59XG4iXX0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-solutions-constructs/aws-cloudfront-s3",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "CDK Constructs for AWS Cloudfront to AWS S3 integration.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dotnet": {
|
|
44
|
-
"namespace": "Amazon.
|
|
45
|
-
"packageId": "Amazon.
|
|
44
|
+
"namespace": "Amazon.SolutionsConstructs.AWS.CloudfrontS3",
|
|
45
|
+
"packageId": "Amazon.SolutionsConstructs.AWS.CloudfrontS3",
|
|
46
46
|
"signAssembly": true,
|
|
47
47
|
"iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png"
|
|
48
48
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@aws-solutions-constructs/core": "2.0.0
|
|
56
|
+
"@aws-solutions-constructs/core": "2.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@aws-cdk/assert": "2.0.0-rc.23",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@aws-solutions-constructs/core": "2.0.0
|
|
80
|
+
"@aws-solutions-constructs/core": "2.0.0",
|
|
81
81
|
"aws-cdk-lib": "^2.0.0-rc.23",
|
|
82
82
|
"constructs": "^10.0.0"
|
|
83
83
|
},
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2021 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,425 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Description": "Integration Test for originPath with aws-cloudfront-s3",
|
|
3
|
+
"Resources": {
|
|
4
|
+
"testcloudfronts3S3LoggingBucket90D239DD": {
|
|
5
|
+
"Type": "AWS::S3::Bucket",
|
|
6
|
+
"Properties": {
|
|
7
|
+
"AccessControl": "LogDeliveryWrite",
|
|
8
|
+
"BucketEncryption": {
|
|
9
|
+
"ServerSideEncryptionConfiguration": [
|
|
10
|
+
{
|
|
11
|
+
"ServerSideEncryptionByDefault": {
|
|
12
|
+
"SSEAlgorithm": "AES256"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"PublicAccessBlockConfiguration": {
|
|
18
|
+
"BlockPublicAcls": true,
|
|
19
|
+
"BlockPublicPolicy": true,
|
|
20
|
+
"IgnorePublicAcls": true,
|
|
21
|
+
"RestrictPublicBuckets": true
|
|
22
|
+
},
|
|
23
|
+
"VersioningConfiguration": {
|
|
24
|
+
"Status": "Enabled"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"UpdateReplacePolicy": "Retain",
|
|
28
|
+
"DeletionPolicy": "Retain",
|
|
29
|
+
"Metadata": {
|
|
30
|
+
"cfn_nag": {
|
|
31
|
+
"rules_to_suppress": [
|
|
32
|
+
{
|
|
33
|
+
"id": "W35",
|
|
34
|
+
"reason": "This S3 bucket is used as the access logging bucket for another bucket"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"testcloudfronts3S3LoggingBucketPolicy529D4CFF": {
|
|
41
|
+
"Type": "AWS::S3::BucketPolicy",
|
|
42
|
+
"Properties": {
|
|
43
|
+
"Bucket": {
|
|
44
|
+
"Ref": "testcloudfronts3S3LoggingBucket90D239DD"
|
|
45
|
+
},
|
|
46
|
+
"PolicyDocument": {
|
|
47
|
+
"Statement": [
|
|
48
|
+
{
|
|
49
|
+
"Action": "*",
|
|
50
|
+
"Condition": {
|
|
51
|
+
"Bool": {
|
|
52
|
+
"aws:SecureTransport": "false"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"Effect": "Deny",
|
|
56
|
+
"Principal": {
|
|
57
|
+
"AWS": "*"
|
|
58
|
+
},
|
|
59
|
+
"Resource": [
|
|
60
|
+
{
|
|
61
|
+
"Fn::Join": [
|
|
62
|
+
"",
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
"Fn::GetAtt": [
|
|
66
|
+
"testcloudfronts3S3LoggingBucket90D239DD",
|
|
67
|
+
"Arn"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"/*"
|
|
71
|
+
]
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"Fn::GetAtt": [
|
|
76
|
+
"testcloudfronts3S3LoggingBucket90D239DD",
|
|
77
|
+
"Arn"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"Sid": "HttpsOnly"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"Version": "2012-10-17"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"testcloudfronts3S3BucketE0C5F76E": {
|
|
89
|
+
"Type": "AWS::S3::Bucket",
|
|
90
|
+
"Properties": {
|
|
91
|
+
"BucketEncryption": {
|
|
92
|
+
"ServerSideEncryptionConfiguration": [
|
|
93
|
+
{
|
|
94
|
+
"ServerSideEncryptionByDefault": {
|
|
95
|
+
"SSEAlgorithm": "AES256"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"LifecycleConfiguration": {
|
|
101
|
+
"Rules": [
|
|
102
|
+
{
|
|
103
|
+
"NoncurrentVersionTransitions": [
|
|
104
|
+
{
|
|
105
|
+
"StorageClass": "GLACIER",
|
|
106
|
+
"TransitionInDays": 90
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"Status": "Enabled"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"LoggingConfiguration": {
|
|
114
|
+
"DestinationBucketName": {
|
|
115
|
+
"Ref": "testcloudfronts3S3LoggingBucket90D239DD"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"PublicAccessBlockConfiguration": {
|
|
119
|
+
"BlockPublicAcls": true,
|
|
120
|
+
"BlockPublicPolicy": true,
|
|
121
|
+
"IgnorePublicAcls": true,
|
|
122
|
+
"RestrictPublicBuckets": true
|
|
123
|
+
},
|
|
124
|
+
"VersioningConfiguration": {
|
|
125
|
+
"Status": "Enabled"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"UpdateReplacePolicy": "Retain",
|
|
129
|
+
"DeletionPolicy": "Retain"
|
|
130
|
+
},
|
|
131
|
+
"testcloudfronts3S3BucketPolicy250F1F61": {
|
|
132
|
+
"Type": "AWS::S3::BucketPolicy",
|
|
133
|
+
"Properties": {
|
|
134
|
+
"Bucket": {
|
|
135
|
+
"Ref": "testcloudfronts3S3BucketE0C5F76E"
|
|
136
|
+
},
|
|
137
|
+
"PolicyDocument": {
|
|
138
|
+
"Statement": [
|
|
139
|
+
{
|
|
140
|
+
"Action": "*",
|
|
141
|
+
"Condition": {
|
|
142
|
+
"Bool": {
|
|
143
|
+
"aws:SecureTransport": "false"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"Effect": "Deny",
|
|
147
|
+
"Principal": {
|
|
148
|
+
"AWS": "*"
|
|
149
|
+
},
|
|
150
|
+
"Resource": [
|
|
151
|
+
{
|
|
152
|
+
"Fn::Join": [
|
|
153
|
+
"",
|
|
154
|
+
[
|
|
155
|
+
{
|
|
156
|
+
"Fn::GetAtt": [
|
|
157
|
+
"testcloudfronts3S3BucketE0C5F76E",
|
|
158
|
+
"Arn"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"/*"
|
|
162
|
+
]
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"Fn::GetAtt": [
|
|
167
|
+
"testcloudfronts3S3BucketE0C5F76E",
|
|
168
|
+
"Arn"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"Sid": "HttpsOnly"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"Action": "s3:GetObject",
|
|
176
|
+
"Effect": "Allow",
|
|
177
|
+
"Principal": {
|
|
178
|
+
"CanonicalUser": {
|
|
179
|
+
"Fn::GetAtt": [
|
|
180
|
+
"testcloudfronts3CloudFrontDistributionOrigin1S3Origin4695F058",
|
|
181
|
+
"S3CanonicalUserId"
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"Resource": {
|
|
186
|
+
"Fn::Join": [
|
|
187
|
+
"",
|
|
188
|
+
[
|
|
189
|
+
{
|
|
190
|
+
"Fn::GetAtt": [
|
|
191
|
+
"testcloudfronts3S3BucketE0C5F76E",
|
|
192
|
+
"Arn"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"/*"
|
|
196
|
+
]
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"Version": "2012-10-17"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"Metadata": {
|
|
205
|
+
"cfn_nag": {
|
|
206
|
+
"rules_to_suppress": [
|
|
207
|
+
{
|
|
208
|
+
"id": "F16",
|
|
209
|
+
"reason": "Public website bucket policy requires a wildcard principal"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"testcloudfronts3SetHttpSecurityHeaders6C5A1E69": {
|
|
216
|
+
"Type": "AWS::CloudFront::Function",
|
|
217
|
+
"Properties": {
|
|
218
|
+
"Name": "SetHttpSecurityHeadersc824484dfea4176847245e871498ffd7e454223fe4",
|
|
219
|
+
"AutoPublish": true,
|
|
220
|
+
"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; }",
|
|
221
|
+
"FunctionConfig": {
|
|
222
|
+
"Comment": "SetHttpSecurityHeadersc824484dfea4176847245e871498ffd7e454223fe4",
|
|
223
|
+
"Runtime": "cloudfront-js-1.0"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"testcloudfronts3CloudfrontLoggingBucket985C0FE8": {
|
|
228
|
+
"Type": "AWS::S3::Bucket",
|
|
229
|
+
"Properties": {
|
|
230
|
+
"AccessControl": "LogDeliveryWrite",
|
|
231
|
+
"BucketEncryption": {
|
|
232
|
+
"ServerSideEncryptionConfiguration": [
|
|
233
|
+
{
|
|
234
|
+
"ServerSideEncryptionByDefault": {
|
|
235
|
+
"SSEAlgorithm": "AES256"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"PublicAccessBlockConfiguration": {
|
|
241
|
+
"BlockPublicAcls": true,
|
|
242
|
+
"BlockPublicPolicy": true,
|
|
243
|
+
"IgnorePublicAcls": true,
|
|
244
|
+
"RestrictPublicBuckets": true
|
|
245
|
+
},
|
|
246
|
+
"VersioningConfiguration": {
|
|
247
|
+
"Status": "Enabled"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"UpdateReplacePolicy": "Retain",
|
|
251
|
+
"DeletionPolicy": "Retain",
|
|
252
|
+
"Metadata": {
|
|
253
|
+
"cfn_nag": {
|
|
254
|
+
"rules_to_suppress": [
|
|
255
|
+
{
|
|
256
|
+
"id": "W35",
|
|
257
|
+
"reason": "This S3 bucket is used as the access logging bucket for CloudFront Distribution"
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"testcloudfronts3CloudfrontLoggingBucketPolicyDF55851B": {
|
|
264
|
+
"Type": "AWS::S3::BucketPolicy",
|
|
265
|
+
"Properties": {
|
|
266
|
+
"Bucket": {
|
|
267
|
+
"Ref": "testcloudfronts3CloudfrontLoggingBucket985C0FE8"
|
|
268
|
+
},
|
|
269
|
+
"PolicyDocument": {
|
|
270
|
+
"Statement": [
|
|
271
|
+
{
|
|
272
|
+
"Action": "*",
|
|
273
|
+
"Condition": {
|
|
274
|
+
"Bool": {
|
|
275
|
+
"aws:SecureTransport": "false"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"Effect": "Deny",
|
|
279
|
+
"Principal": {
|
|
280
|
+
"AWS": "*"
|
|
281
|
+
},
|
|
282
|
+
"Resource": [
|
|
283
|
+
{
|
|
284
|
+
"Fn::Join": [
|
|
285
|
+
"",
|
|
286
|
+
[
|
|
287
|
+
{
|
|
288
|
+
"Fn::GetAtt": [
|
|
289
|
+
"testcloudfronts3CloudfrontLoggingBucket985C0FE8",
|
|
290
|
+
"Arn"
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
"/*"
|
|
294
|
+
]
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"Fn::GetAtt": [
|
|
299
|
+
"testcloudfronts3CloudfrontLoggingBucket985C0FE8",
|
|
300
|
+
"Arn"
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"Sid": "HttpsOnly"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"Version": "2012-10-17"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"testcloudfronts3CloudFrontDistributionOrigin1S3Origin4695F058": {
|
|
312
|
+
"Type": "AWS::CloudFront::CloudFrontOriginAccessIdentity",
|
|
313
|
+
"Properties": {
|
|
314
|
+
"CloudFrontOriginAccessIdentityConfig": {
|
|
315
|
+
"Comment": "Identity for customoriginPathtestcloudfronts3CloudFrontDistributionOrigin1B44CC042"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"testcloudfronts3CloudFrontDistribution0565DEE8": {
|
|
320
|
+
"Type": "AWS::CloudFront::Distribution",
|
|
321
|
+
"Properties": {
|
|
322
|
+
"DistributionConfig": {
|
|
323
|
+
"DefaultCacheBehavior": {
|
|
324
|
+
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
|
|
325
|
+
"Compress": true,
|
|
326
|
+
"FunctionAssociations": [
|
|
327
|
+
{
|
|
328
|
+
"EventType": "viewer-response",
|
|
329
|
+
"FunctionARN": {
|
|
330
|
+
"Fn::GetAtt": [
|
|
331
|
+
"testcloudfronts3SetHttpSecurityHeaders6C5A1E69",
|
|
332
|
+
"FunctionARN"
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"TargetOriginId": "customoriginPathtestcloudfronts3CloudFrontDistributionOrigin1B44CC042",
|
|
338
|
+
"ViewerProtocolPolicy": "redirect-to-https"
|
|
339
|
+
},
|
|
340
|
+
"DefaultRootObject": "index.html",
|
|
341
|
+
"Enabled": true,
|
|
342
|
+
"HttpVersion": "http2",
|
|
343
|
+
"IPV6Enabled": true,
|
|
344
|
+
"Logging": {
|
|
345
|
+
"Bucket": {
|
|
346
|
+
"Fn::GetAtt": [
|
|
347
|
+
"testcloudfronts3CloudfrontLoggingBucket985C0FE8",
|
|
348
|
+
"RegionalDomainName"
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"Origins": [
|
|
353
|
+
{
|
|
354
|
+
"DomainName": {
|
|
355
|
+
"Fn::GetAtt": [
|
|
356
|
+
"testcloudfronts3S3BucketE0C5F76E",
|
|
357
|
+
"RegionalDomainName"
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
"Id": "customoriginPathtestcloudfronts3CloudFrontDistributionOrigin1B44CC042",
|
|
361
|
+
"OriginPath": "/testPath",
|
|
362
|
+
"S3OriginConfig": {
|
|
363
|
+
"OriginAccessIdentity": {
|
|
364
|
+
"Fn::Join": [
|
|
365
|
+
"",
|
|
366
|
+
[
|
|
367
|
+
"origin-access-identity/cloudfront/",
|
|
368
|
+
{
|
|
369
|
+
"Ref": "testcloudfronts3CloudFrontDistributionOrigin1S3Origin4695F058"
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"Metadata": {
|
|
380
|
+
"cfn_nag": {
|
|
381
|
+
"rules_to_suppress": [
|
|
382
|
+
{
|
|
383
|
+
"id": "W70",
|
|
384
|
+
"reason": "Since the distribution uses the CloudFront domain name, CloudFront automatically sets the security policy to TLSv1 regardless of the value of MinimumProtocolVersion"
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"Parameters": {
|
|
392
|
+
"BootstrapVersion": {
|
|
393
|
+
"Type": "AWS::SSM::Parameter::Value<String>",
|
|
394
|
+
"Default": "/cdk-bootstrap/hnb659fds/version",
|
|
395
|
+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store."
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"Rules": {
|
|
399
|
+
"CheckBootstrapVersion": {
|
|
400
|
+
"Assertions": [
|
|
401
|
+
{
|
|
402
|
+
"Assert": {
|
|
403
|
+
"Fn::Not": [
|
|
404
|
+
{
|
|
405
|
+
"Fn::Contains": [
|
|
406
|
+
[
|
|
407
|
+
"1",
|
|
408
|
+
"2",
|
|
409
|
+
"3",
|
|
410
|
+
"4",
|
|
411
|
+
"5"
|
|
412
|
+
],
|
|
413
|
+
{
|
|
414
|
+
"Ref": "BootstrapVersion"
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2021 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
|
+
// Setup
|
|
20
|
+
const app = new aws_cdk_lib_1.App();
|
|
21
|
+
const stack = new aws_cdk_lib_1.Stack(app, core_1.generateIntegStackName(__filename));
|
|
22
|
+
stack.templateOptions.description = 'Integration Test for originPath with aws-cloudfront-s3';
|
|
23
|
+
new lib_1.CloudFrontToS3(stack, 'test-cloudfront-s3', {
|
|
24
|
+
originPath: '/testPath'
|
|
25
|
+
});
|
|
26
|
+
// Synth
|
|
27
|
+
app.synth();
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuY3VzdG9tLW9yaWdpblBhdGguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbnRlZy5jdXN0b20tb3JpZ2luUGF0aC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7O0FBRUgsVUFBVTtBQUNWLDZDQUF5QztBQUN6QyxnQ0FBd0M7QUFDeEMseURBQXdFO0FBRXhFLFFBQVE7QUFDUixNQUFNLEdBQUcsR0FBRyxJQUFJLGlCQUFHLEVBQUUsQ0FBQztBQUN0QixNQUFNLEtBQUssR0FBRyxJQUFJLG1CQUFLLENBQUMs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