@quadnix/octo-aws-cdk 0.1.0 → 0.2.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/dist/factories/aws-client.factory.d.ts +28 -0
- package/dist/factories/aws-client.factory.js +36 -0
- package/dist/factories/aws-client.factory.js.map +1 -1
- package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.d.ts +6 -0
- package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.js +11 -1
- package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.js.map +1 -1
- package/dist/modules/service/aws-s3-static-website-service/index.schema.d.ts +58 -0
- package/dist/modules/service/aws-s3-static-website-service/index.schema.js +96 -0
- package/dist/modules/service/aws-s3-static-website-service/index.schema.js.map +1 -1
- package/dist/modules/service/aws-s3-static-website-service/models/service/actions/add-aws-s3-static-website-service.model.action.js +89 -4
- package/dist/modules/service/aws-s3-static-website-service/models/service/actions/add-aws-s3-static-website-service.model.action.js.map +1 -1
- package/dist/modules/service/aws-s3-static-website-service/models/service/actions/update-aws-s3-static-website-service-source-paths.model.action.js +17 -1
- package/dist/modules/service/aws-s3-static-website-service/models/service/actions/update-aws-s3-static-website-service-source-paths.model.action.js.map +1 -1
- package/dist/modules/service/aws-s3-static-website-service/models/service/aws-s3-static-website-service.model.js +6 -3
- package/dist/modules/service/aws-s3-static-website-service/models/service/aws-s3-static-website-service.model.js.map +1 -1
- package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.d.ts +97 -0
- package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.js +613 -0
- package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.js.map +1 -0
- package/dist/resources/cloudfront-distribution/index.d.ts +1 -0
- package/dist/resources/cloudfront-distribution/index.js +2 -0
- package/dist/resources/cloudfront-distribution/index.js.map +1 -0
- package/dist/resources/cloudfront-distribution/index.schema.d.ts +522 -0
- package/dist/resources/cloudfront-distribution/index.schema.js +754 -0
- package/dist/resources/cloudfront-distribution/index.schema.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.d.ts +36 -0
- package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.js +90 -0
- package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.d.ts +39 -0
- package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.js +69 -0
- package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.d.ts +37 -0
- package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.js +91 -0
- package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.d.ts +62 -0
- package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.js +89 -0
- package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/index.d.ts +5 -0
- package/dist/resources/cloudfront-invalidation/index.js +6 -0
- package/dist/resources/cloudfront-invalidation/index.js.map +1 -0
- package/dist/resources/cloudfront-invalidation/index.schema.d.ts +61 -0
- package/dist/resources/cloudfront-invalidation/index.schema.js +110 -0
- package/dist/resources/cloudfront-invalidation/index.schema.js.map +1 -0
- package/dist/resources/s3-website/index.schema.d.ts +20 -0
- package/dist/resources/s3-website/index.schema.js +38 -0
- package/dist/resources/s3-website/index.schema.js.map +1 -1
- package/dist/resources/s3-website/s3-website.resource.d.ts +20 -3
- package/dist/resources/s3-website/s3-website.resource.js +82 -26
- package/dist/resources/s3-website/s3-website.resource.js.map +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { BaseResourceSchema, Schema, Validate } from '@quadnix/octo';
|
|
11
|
+
/**
|
|
12
|
+
* The distribution an invalidation is issued against. Structural, so any resource publishing a
|
|
13
|
+
* distribution id satisfies it.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export class InvalidationDistributionSchema extends BaseResourceSchema {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.response = Schema({
|
|
21
|
+
DistributionId: 'E000000000000',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
Validate({
|
|
27
|
+
destruct: (value) => {
|
|
28
|
+
const subjects = [];
|
|
29
|
+
if (value.DistributionId) {
|
|
30
|
+
subjects.push(value.DistributionId);
|
|
31
|
+
}
|
|
32
|
+
return subjects;
|
|
33
|
+
},
|
|
34
|
+
options: { minLength: 1 },
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], InvalidationDistributionSchema.prototype, "response", void 0);
|
|
38
|
+
/**
|
|
39
|
+
* The `CloudFrontInvalidationSchema` class is the schema for the `CloudFrontInvalidation` resource,
|
|
40
|
+
* which drops what CloudFront's edge locations are holding for a distribution.
|
|
41
|
+
*
|
|
42
|
+
* Terraform provisions no part of it. There is no managed resource in the AWS provider for an
|
|
43
|
+
* invalidation, because an invalidation is not a thing that exists - it is a call that runs and
|
|
44
|
+
* finishes. So this is an external resource: octo issues `CreateInvalidation` itself, through the
|
|
45
|
+
* `octo run-action` callback terraform makes mid-apply.
|
|
46
|
+
*
|
|
47
|
+
* It exists because the alternative is silent. A distribution serving a bucket caches an object for
|
|
48
|
+
* as long as its cache policy says, which for `Managed-CachingOptimized` is a day, and an S3 object
|
|
49
|
+
* carries no `Cache-Control` of its own. Without this, uploading a new version of a site reports
|
|
50
|
+
* success and changes nothing a visitor can see until the next day.
|
|
51
|
+
*
|
|
52
|
+
* @group Resources/CloudFrontInvalidation
|
|
53
|
+
*
|
|
54
|
+
* @hideconstructor
|
|
55
|
+
*
|
|
56
|
+
* @overrideProperty parents - The distribution whose edge caches are dropped.
|
|
57
|
+
* ```mermaid
|
|
58
|
+
* graph TD;
|
|
59
|
+
* cloudfront_distribution((CloudFront<br>Distribution)) --> cloudfront_invalidation((CloudFront<br>Invalidation))
|
|
60
|
+
* ```
|
|
61
|
+
* @overrideProperty resourceId - The resource id is of format `cloudfront-invalidation-<distribution-name>`.
|
|
62
|
+
*/
|
|
63
|
+
export class CloudFrontInvalidationSchema extends BaseResourceSchema {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
/**
|
|
67
|
+
* Input properties.
|
|
68
|
+
* * `properties.awsAccountId` - The AWS account id.
|
|
69
|
+
* * `properties.contentVersion` - What the distribution is currently serving. It is not read by
|
|
70
|
+
* the call; it is the whole trigger. Octo re-runs this resource when this value moves, and does
|
|
71
|
+
* nothing when it does not, so whoever owns the content decides when an invalidation happens by
|
|
72
|
+
* deciding what this says. A digest over the published files is the usual answer.
|
|
73
|
+
* * `properties.paths` - The paths to drop, e.g. `/*`. AWS bills per path beyond the first
|
|
74
|
+
* thousand a month, and `/*` counts as one.
|
|
75
|
+
*/
|
|
76
|
+
this.properties = Schema();
|
|
77
|
+
/**
|
|
78
|
+
* Saved response.
|
|
79
|
+
* * `response.InvalidationId` - The id AWS assigned the invalidation that ran.
|
|
80
|
+
*/
|
|
81
|
+
this.response = Schema({
|
|
82
|
+
InvalidationId: 'I000000000000',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
__decorate([
|
|
87
|
+
Validate({
|
|
88
|
+
destruct: (value) => [
|
|
89
|
+
value.awsAccountId,
|
|
90
|
+
value.contentVersion,
|
|
91
|
+
...value.paths,
|
|
92
|
+
],
|
|
93
|
+
options: { minLength: 1 },
|
|
94
|
+
}),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], CloudFrontInvalidationSchema.prototype, "properties", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
Validate({
|
|
99
|
+
destruct: (value) => {
|
|
100
|
+
const subjects = [];
|
|
101
|
+
if (value.InvalidationId) {
|
|
102
|
+
subjects.push(value.InvalidationId);
|
|
103
|
+
}
|
|
104
|
+
return subjects;
|
|
105
|
+
},
|
|
106
|
+
options: { minLength: 1 },
|
|
107
|
+
}),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], CloudFrontInvalidationSchema.prototype, "response", void 0);
|
|
110
|
+
//# sourceMappingURL=index.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.schema.js","sourceRoot":"","sources":["../../../src/resources/cloudfront-invalidation/index.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IAAtE;;QAWW,aAAQ,GAAG,MAAM,CAEvB;YACD,cAAc,EAAE,eAAe;SAChC,CAAC,CAAC;IACL,CAAC;CAAA;AALU;IAVR,QAAQ,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Structural, so the bucket never has to know what
|
|
4
|
+
* kind of resource is in front of it - only that it publishes an ARN to name in a policy.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebsiteDistributionSchema extends BaseResourceSchema {
|
|
9
|
+
response: {
|
|
10
|
+
Arn?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* The `S3WebsiteSchema` class is the schema for the `S3Website` resource,
|
|
4
15
|
* which represents the AWS Simple Storage Service (S3) Website resource.
|
|
@@ -20,11 +31,17 @@ export declare class S3WebsiteSchema extends BaseResourceSchema {
|
|
|
20
31
|
* * `properties.Bucket` - The name of the bucket.
|
|
21
32
|
* * `properties.ErrorDocument` - Path of the error document, e.g. `error.html`.
|
|
22
33
|
* * `properties.IndexDocument` - Path of the index document, e.g. `index.html`.
|
|
34
|
+
* * `properties.distributionResourceIds` - The distributions allowed to read this bucket, each
|
|
35
|
+
* granted one statement in the policy below. It is also what decides how the bucket is reached:
|
|
36
|
+
* empty leaves the bucket public on its S3 website endpoint, over plain HTTP, and anything else
|
|
37
|
+
* closes it so that the distributions in front of it are the only way in. Two facts would
|
|
38
|
+
* disagree eventually, so there is only this one.
|
|
23
39
|
*/
|
|
24
40
|
properties: {
|
|
25
41
|
awsAccountId: string;
|
|
26
42
|
awsRegionId: string;
|
|
27
43
|
Bucket: string;
|
|
44
|
+
distributionResourceIds: string[];
|
|
28
45
|
ErrorDocument: string;
|
|
29
46
|
IndexDocument: string;
|
|
30
47
|
};
|
|
@@ -32,10 +49,13 @@ export declare class S3WebsiteSchema extends BaseResourceSchema {
|
|
|
32
49
|
* Saved response.
|
|
33
50
|
* * `response.Arn` - The ARN of the bucket.
|
|
34
51
|
* * `response.awsRegionId` - The AWS region id.
|
|
52
|
+
* * `response.RegionalDomainName` - The bucket's REST endpoint, which is what a CloudFront origin
|
|
53
|
+
* points at.
|
|
35
54
|
*/
|
|
36
55
|
response: {
|
|
37
56
|
Arn?: string;
|
|
38
57
|
awsRegionId?: string;
|
|
58
|
+
RegionalDomainName?: string;
|
|
39
59
|
};
|
|
40
60
|
sourcePathDigests: {
|
|
41
61
|
[remotePath: string]: string;
|
|
@@ -8,6 +8,33 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { BaseResourceSchema, Schema, Validate } from '@quadnix/octo';
|
|
11
|
+
/**
|
|
12
|
+
* A CloudFront distribution this bucket serves. Structural, so the bucket never has to know what
|
|
13
|
+
* kind of resource is in front of it - only that it publishes an ARN to name in a policy.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export class WebsiteDistributionSchema extends BaseResourceSchema {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.response = Schema({
|
|
21
|
+
Arn: 'arn:aws:cloudfront::000000000000:distribution/E000000000000',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
Validate({
|
|
27
|
+
destruct: (value) => {
|
|
28
|
+
const subjects = [];
|
|
29
|
+
if (value.Arn) {
|
|
30
|
+
subjects.push(value.Arn);
|
|
31
|
+
}
|
|
32
|
+
return subjects;
|
|
33
|
+
},
|
|
34
|
+
options: { minLength: 1 },
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], WebsiteDistributionSchema.prototype, "response", void 0);
|
|
11
38
|
/**
|
|
12
39
|
* The `S3WebsiteSchema` class is the schema for the `S3Website` resource,
|
|
13
40
|
* which represents the AWS Simple Storage Service (S3) Website resource.
|
|
@@ -31,16 +58,24 @@ export class S3WebsiteSchema extends BaseResourceSchema {
|
|
|
31
58
|
* * `properties.Bucket` - The name of the bucket.
|
|
32
59
|
* * `properties.ErrorDocument` - Path of the error document, e.g. `error.html`.
|
|
33
60
|
* * `properties.IndexDocument` - Path of the index document, e.g. `index.html`.
|
|
61
|
+
* * `properties.distributionResourceIds` - The distributions allowed to read this bucket, each
|
|
62
|
+
* granted one statement in the policy below. It is also what decides how the bucket is reached:
|
|
63
|
+
* empty leaves the bucket public on its S3 website endpoint, over plain HTTP, and anything else
|
|
64
|
+
* closes it so that the distributions in front of it are the only way in. Two facts would
|
|
65
|
+
* disagree eventually, so there is only this one.
|
|
34
66
|
*/
|
|
35
67
|
this.properties = Schema();
|
|
36
68
|
/**
|
|
37
69
|
* Saved response.
|
|
38
70
|
* * `response.Arn` - The ARN of the bucket.
|
|
39
71
|
* * `response.awsRegionId` - The AWS region id.
|
|
72
|
+
* * `response.RegionalDomainName` - The bucket's REST endpoint, which is what a CloudFront origin
|
|
73
|
+
* points at.
|
|
40
74
|
*/
|
|
41
75
|
this.response = Schema({
|
|
42
76
|
Arn: 'arn:aws:s3:::mock-website-bucket',
|
|
43
77
|
awsRegionId: 'us-east-1',
|
|
78
|
+
RegionalDomainName: 'mock-website-bucket.s3.us-east-1.amazonaws.com',
|
|
44
79
|
});
|
|
45
80
|
this.sourcePathDigests = Schema({});
|
|
46
81
|
}
|
|
@@ -68,6 +103,9 @@ __decorate([
|
|
|
68
103
|
if (value.awsRegionId) {
|
|
69
104
|
subjects.push(value.awsRegionId);
|
|
70
105
|
}
|
|
106
|
+
if (value.RegionalDomainName) {
|
|
107
|
+
subjects.push(value.RegionalDomainName);
|
|
108
|
+
}
|
|
71
109
|
return subjects;
|
|
72
110
|
},
|
|
73
111
|
options: { minLength: 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.schema.js","sourceRoot":"","sources":["../../../src/resources/s3-website/index.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,eAAgB,SAAQ,k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pB;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;KAC1B,CAAC;;mDAQG;AAyBI;IAhBR,QAAQ,CAAC;QACR,QAAQ,EAAE,CAAC,KAAkC,EAAY,EAAE;YACzD,MAAM,QAAQ,GAAa,EAAE,CAAC;YAC9B,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;gBACd,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;YACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACtB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACnC,CAAC;YACD,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;gBAC7B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;KAC1B,CAAC;;iDASC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AResource, ATerraformResource, type BaseResourceSchema, Diff, type TerraformModuleScope } from '@quadnix/octo';
|
|
2
|
-
import { S3WebsiteSchema } from './index.schema.js';
|
|
1
|
+
import { AResource, ATerraformResource, type BaseResourceSchema, Diff, type MatchingResource, type TerraformModuleScope } from '@quadnix/octo';
|
|
2
|
+
import { S3WebsiteSchema, type WebsiteDistributionSchema } from './index.schema.js';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -14,6 +14,7 @@ type IManifest = {
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare class S3Website extends ATerraformResource<S3WebsiteSchema, S3Website> {
|
|
17
|
+
parents: MatchingResource<WebsiteDistributionSchema>[];
|
|
17
18
|
properties: S3WebsiteSchema['properties'];
|
|
18
19
|
response: S3WebsiteSchema['response'];
|
|
19
20
|
private readonly manifest;
|
|
@@ -21,11 +22,27 @@ export declare class S3Website extends ATerraformResource<S3WebsiteSchema, S3Web
|
|
|
21
22
|
/**
|
|
22
23
|
* @internal
|
|
23
24
|
*/
|
|
24
|
-
constructor(resourceId: string, properties: S3WebsiteSchema['properties']);
|
|
25
|
+
constructor(resourceId: string, properties: S3WebsiteSchema['properties'], parents?: MatchingResource<WebsiteDistributionSchema>[]);
|
|
25
26
|
/**
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
29
|
static unSynth<S extends BaseResourceSchema, T>(deserializationClass: any, resource: S, deReferenceResource: (context: string) => Promise<AResource<BaseResourceSchema, any>>): Promise<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Admits one CloudFront distribution to this bucket.
|
|
32
|
+
*
|
|
33
|
+
* The grant is a statement in the policy this bucket already owns, rather than a policy of the
|
|
34
|
+
* distribution's own: `aws_s3_bucket_policy` writes a bucket's whole policy, so two of them
|
|
35
|
+
* pointed at one bucket would take turns overwriting each other. Adding a statement leaves every
|
|
36
|
+
* other statement alone, and dropping a distribution drops only its own.
|
|
37
|
+
*
|
|
38
|
+
* The statement names the distribution by ARN, which AWS assigns, so this bucket becomes the
|
|
39
|
+
* distribution's child and reads it as a reference. The distribution does not reference the bucket
|
|
40
|
+
* back - it writes this bucket's hostname down instead - because two folders referencing each
|
|
41
|
+
* other is a cycle terragrunt cannot order.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
addCloudFrontAccess(distribution: MatchingResource<WebsiteDistributionSchema>): void;
|
|
29
46
|
/**
|
|
30
47
|
* @internal
|
|
31
48
|
*/
|
|
@@ -18,8 +18,8 @@ let S3Website = class S3Website extends ATerraformResource {
|
|
|
18
18
|
/**
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
constructor(resourceId, properties) {
|
|
22
|
-
super(resourceId, properties,
|
|
21
|
+
constructor(resourceId, properties, parents = []) {
|
|
22
|
+
super(resourceId, properties, parents);
|
|
23
23
|
this.manifest = {};
|
|
24
24
|
this.sourcePathDigests = {};
|
|
25
25
|
}
|
|
@@ -32,16 +32,46 @@ let S3Website = class S3Website extends ATerraformResource {
|
|
|
32
32
|
s3Website.sourcePathDigests = digests ? { ...digests } : {};
|
|
33
33
|
return s3Website;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Admits one CloudFront distribution to this bucket.
|
|
37
|
+
*
|
|
38
|
+
* The grant is a statement in the policy this bucket already owns, rather than a policy of the
|
|
39
|
+
* distribution's own: `aws_s3_bucket_policy` writes a bucket's whole policy, so two of them
|
|
40
|
+
* pointed at one bucket would take turns overwriting each other. Adding a statement leaves every
|
|
41
|
+
* other statement alone, and dropping a distribution drops only its own.
|
|
42
|
+
*
|
|
43
|
+
* The statement names the distribution by ARN, which AWS assigns, so this bucket becomes the
|
|
44
|
+
* distribution's child and reads it as a reference. The distribution does not reference the bucket
|
|
45
|
+
* back - it writes this bucket's hostname down instead - because two folders referencing each
|
|
46
|
+
* other is a cycle terragrunt cannot order.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
addCloudFrontAccess(distribution) {
|
|
51
|
+
const distributionResourceId = distribution.getActual().resourceId;
|
|
52
|
+
if (this.properties.distributionResourceIds.includes(distributionResourceId)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const { childToParentDependency, parentToChildDependency } = distribution.addChild('resourceId', this, 'resourceId');
|
|
56
|
+
childToParentDependency.addBehavior('update-cloudfront-access', DiffAction.UPDATE, 'resourceId', DiffAction.ADD);
|
|
57
|
+
parentToChildDependency.addBehavior('resourceId', DiffAction.DELETE, 'update-cloudfront-access', DiffAction.UPDATE);
|
|
58
|
+
this.properties.distributionResourceIds.push(distributionResourceId);
|
|
59
|
+
}
|
|
35
60
|
/**
|
|
36
61
|
* @internal
|
|
37
62
|
*/
|
|
38
63
|
async diffProperties(previous) {
|
|
39
|
-
if (!DiffUtility.isObjectDeepEquals(previous.properties, this.properties)) {
|
|
64
|
+
if (!DiffUtility.isObjectDeepEquals(previous.properties, this.properties, ['distributionResourceIds'])) {
|
|
40
65
|
return [
|
|
41
66
|
new Diff(this, DiffAction.REPLACE, 'resourceId', this.getContext(), 'Bucket is force-new on aws_s3_bucket; a change recreates the bucket'),
|
|
42
67
|
];
|
|
43
68
|
}
|
|
44
69
|
const diffs = [];
|
|
70
|
+
// Putting a distribution in front of the bucket, or taking one away, rewrites how the bucket is
|
|
71
|
+
// reached and who may read it, without touching the bucket itself.
|
|
72
|
+
if (!DiffUtility.isObjectDeepEquals({ distributionResourceIds: [...previous.properties.distributionResourceIds].sort() }, { distributionResourceIds: [...this.properties.distributionResourceIds].sort() })) {
|
|
73
|
+
diffs.push(new Diff(this, DiffAction.UPDATE, 'update-cloudfront-access', [...this.properties.distributionResourceIds]));
|
|
74
|
+
}
|
|
45
75
|
// Only propose a content update when the digests differ from what was last committed.
|
|
46
76
|
if (!DiffUtility.isObjectDeepEquals(previous.sourcePathDigests, this.sourcePathDigests)) {
|
|
47
77
|
diffs.push(new Diff(this, DiffAction.UPDATE, 'update-source-paths', JSON.parse(JSON.stringify(this.manifest))));
|
|
@@ -83,33 +113,59 @@ let S3Website = class S3Website extends ATerraformResource {
|
|
|
83
113
|
s3WebsiteOctoResource.output({
|
|
84
114
|
Arn: terraform.raw(`${s3WebsiteTFResource.address}.arn`),
|
|
85
115
|
awsRegionId: this.properties.awsRegionId,
|
|
116
|
+
RegionalDomainName: terraform.raw(`${s3WebsiteTFResource.address}.bucket_regional_domain_name`),
|
|
86
117
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
118
|
+
// A bucket with nothing in front of it is reached directly, and a bucket with a distribution in
|
|
119
|
+
// front of it is reached through that. There is no third way, and no separate input saying so.
|
|
120
|
+
const isPublic = this.properties.distributionResourceIds.length === 0;
|
|
121
|
+
// A website endpoint is reachable only over plain HTTP and only from a public bucket, so it is
|
|
122
|
+
// emitted for a public bucket alone. Behind a distribution the same two documents are served
|
|
123
|
+
// through its root object and error responses.
|
|
124
|
+
if (isPublic) {
|
|
125
|
+
s3WebsiteOctoResource.addTerraformResource('aws_s3_bucket_website_configuration', `${this.resourceId}_website_bucket_config`, {
|
|
126
|
+
bucket: terraform.raw(`${s3WebsiteTFResource.address}.id`),
|
|
127
|
+
error_document: { key: this.properties.ErrorDocument },
|
|
128
|
+
index_document: { suffix: this.properties.IndexDocument },
|
|
129
|
+
});
|
|
130
|
+
}
|
|
92
131
|
s3WebsiteOctoResource.addTerraformResource('aws_s3_bucket_public_access_block', `${this.resourceId}_website_bucket_public_access`, {
|
|
93
|
-
block_public_acls:
|
|
94
|
-
block_public_policy:
|
|
132
|
+
block_public_acls: !isPublic,
|
|
133
|
+
block_public_policy: !isPublic,
|
|
95
134
|
bucket: terraform.raw(`${s3WebsiteTFResource.address}.id`),
|
|
96
|
-
ignore_public_acls:
|
|
97
|
-
restrict_public_buckets:
|
|
135
|
+
ignore_public_acls: !isPublic,
|
|
136
|
+
restrict_public_buckets: !isPublic,
|
|
98
137
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
138
|
+
// One policy, whatever is reading the bucket. A public bucket is one anonymous statement; a
|
|
139
|
+
// closed one is a statement per distribution, each naming that distribution alone, so no other
|
|
140
|
+
// distribution can read the bucket by pointing at it.
|
|
141
|
+
const statements = isPublic
|
|
142
|
+
? [
|
|
143
|
+
{
|
|
144
|
+
Action: ['s3:GetObject'],
|
|
145
|
+
Effect: 'Allow',
|
|
146
|
+
Principal: '*',
|
|
147
|
+
Resource: [terraform.raw(`"\${${s3WebsiteTFResource.address}.arn}/*"`)],
|
|
148
|
+
Sid: PolicyUtility.getSafeSid('PublicReadGetObject'),
|
|
149
|
+
},
|
|
150
|
+
]
|
|
151
|
+
: this.properties.distributionResourceIds.map((distributionResourceId) => {
|
|
152
|
+
const distribution = this.parents.find((p) => p.getActual().resourceId === distributionResourceId);
|
|
153
|
+
return {
|
|
154
|
+
Action: ['s3:GetObject'],
|
|
155
|
+
Condition: {
|
|
156
|
+
StringEquals: {
|
|
157
|
+
'AWS:SourceArn': terraform.getRef(distribution, 'Arn'),
|
|
158
|
+
},
|
|
109
159
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
160
|
+
Effect: 'Allow',
|
|
161
|
+
Principal: { Service: 'cloudfront.amazonaws.com' },
|
|
162
|
+
Resource: [terraform.raw(`"\${${s3WebsiteTFResource.address}.arn}/*"`)],
|
|
163
|
+
Sid: PolicyUtility.getSafeSid(`AllowCloudFrontRead-${distributionResourceId}`),
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
s3WebsiteOctoResource.addTerraformResource('aws_s3_bucket_policy', `${this.resourceId}_website_bucket_policy`, {
|
|
167
|
+
bucket: terraform.raw(`${s3WebsiteTFResource.address}.id`),
|
|
168
|
+
policy: terraform.jsonencode({ Statement: statements, Version: '2012-10-17' }),
|
|
113
169
|
});
|
|
114
170
|
for (const [remotePath, { digest, filePath }] of Object.entries(this.manifest)) {
|
|
115
171
|
if (digest === 'deleted') {
|
|
@@ -147,7 +203,7 @@ let S3Website = class S3Website extends ATerraformResource {
|
|
|
147
203
|
};
|
|
148
204
|
S3Website = __decorate([
|
|
149
205
|
Resource('@octo', 's3-website', S3WebsiteSchema),
|
|
150
|
-
__metadata("design:paramtypes", [String, Object])
|
|
206
|
+
__metadata("design:paramtypes", [String, Object, Array])
|
|
151
207
|
], S3Website);
|
|
152
208
|
export { S3Website };
|
|
153
209
|
//# sourceMappingURL=s3-website.resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3-website.resource.js","sourceRoot":"","sources":["../../../src/resources/s3-website/s3-website.resource.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,IAAI,EACJ,UAAU,EACV,WAAW,
|
|
1
|
+
{"version":3,"file":"s3-website.resource.js","sourceRoot":"","sources":["../../../src/resources/s3-website/s3-website.resource.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,IAAI,EACJ,UAAU,EACV,WAAW,EAEX,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,eAAe,EAAkC,MAAM,mBAAmB,CAAC;AAOpF;;GAEG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,kBAA8C;IAQ3E;;OAEG;IACH,YACE,UAAkB,EAClB,UAAyC,EACzC,UAAyD,EAAE;QAE3D,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAZxB,aAAQ,GAAc,EAAE,CAAC;QAElC,sBAAiB,GAAyC,EAAE,CAAC;IAWrE,CAAC;IAED;;OAEG;IACH,MAAM,CAAU,KAAK,CAAC,OAAO,CAC3B,oBAAyB,EACzB,QAAW,EACX,mBAAqF;QAErF,MAAM,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAc,CAAC;QAC1G,MAAM,OAAO,GAAI,QAAuC,CAAC,iBAAiB,CAAC;QAC3E,SAAS,CAAC,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO,SAAc,CAAC;IACxB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,mBAAmB,CAAC,YAAyD;QAC3E,MAAM,sBAAsB,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC;QACnE,IAAI,IAAI,CAAC,UAAU,CAAC,uBAA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,CAAC,GAAG,CAAC,SAAS,CAAC;aACjC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,mBAAmB,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,YAAuB;QACpC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAE9C,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC3C,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA1QY,SAAS;IADrB,QAAQ,CAAY,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC;;GAC/C,SAAS,CA0QrB"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/quadnix/octo/issues"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@aws-sdk/client-cloudfront": "~3.743.0",
|
|
6
7
|
"@aws-sdk/client-ecr": "~3.743.0",
|
|
7
8
|
"@aws-sdk/credential-provider-ini": "~3.743.0",
|
|
8
9
|
"@quadnix/octo": "~0.1.0",
|
|
@@ -79,6 +80,8 @@
|
|
|
79
80
|
"./resources/alb-listener/schema": "./dist/resources/alb-listener/index.schema.js",
|
|
80
81
|
"./resources/alb-target-group/schema": "./dist/resources/alb-target-group/index.schema.js",
|
|
81
82
|
"./resources/alb/schema": "./dist/resources/alb/index.schema.js",
|
|
83
|
+
"./resources/cloudfront-distribution/schema": "./dist/resources/cloudfront-distribution/index.schema.js",
|
|
84
|
+
"./resources/cloudfront-invalidation/schema": "./dist/resources/cloudfront-invalidation/index.schema.js",
|
|
82
85
|
"./resources/dynamodb-global/schema": "./dist/resources/dynamodb-global/index.schema.js",
|
|
83
86
|
"./resources/dynamodb/schema": "./dist/resources/dynamodb/index.schema.js",
|
|
84
87
|
"./resources/ecr-image-tag/schema": "./dist/resources/ecr-image-tag/index.schema.js",
|
|
@@ -156,7 +159,7 @@
|
|
|
156
159
|
},
|
|
157
160
|
"type": "module",
|
|
158
161
|
"types": "./dist/index.d.ts",
|
|
159
|
-
"version": "0.
|
|
162
|
+
"version": "0.2.0",
|
|
160
163
|
"scripts": {
|
|
161
164
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
162
165
|
"check:circular-dependency": "dpdm --no-tree --exit-code circular:1 --no-warning ./dist/**/*.js",
|