@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 @@
|
|
|
1
|
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 +1,36 @@
|
|
|
1
|
+
import { ANodeAction, type Diff, type IResourceAction } from '@quadnix/octo';
|
|
2
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
3
|
+
import type { CloudFrontInvalidationSchema } from '../index.schema.js';
|
|
4
|
+
/**
|
|
5
|
+
* Drops what the distribution's edge locations are holding, the first time.
|
|
6
|
+
*
|
|
7
|
+
* Terraform runs this mid-apply, through the `local-exec` provisioner octo generates for an external
|
|
8
|
+
* resource, once the distribution it depends on exists and every object behind it has been written.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare class AddCloudFrontInvalidationResourceAction extends ANodeAction implements IResourceAction<CloudFrontInvalidation> {
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
filter(diff: Diff): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* @throws If CloudFront rejects the invalidation, or accepts it without reporting an id.
|
|
24
|
+
*/
|
|
25
|
+
handle(diff: Diff<CloudFrontInvalidation>): Promise<CloudFrontInvalidationSchema['response']>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare class AddCloudFrontInvalidationResourceActionFactory {
|
|
31
|
+
private static instance;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
static create(): Promise<AddCloudFrontInvalidationResourceAction>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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 { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';
|
|
11
|
+
import { ANodeAction, Action, DiffAction, Factory, hasNodeName } from '@quadnix/octo';
|
|
12
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
13
|
+
/**
|
|
14
|
+
* Drops what the distribution's edge locations are holding, the first time.
|
|
15
|
+
*
|
|
16
|
+
* Terraform runs this mid-apply, through the `local-exec` provisioner octo generates for an external
|
|
17
|
+
* resource, once the distribution it depends on exists and every object behind it has been written.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
let AddCloudFrontInvalidationResourceAction = class AddCloudFrontInvalidationResourceAction extends ANodeAction {
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
filter(diff) {
|
|
32
|
+
return (diff.action === DiffAction.ADD &&
|
|
33
|
+
diff.node instanceof CloudFrontInvalidation &&
|
|
34
|
+
hasNodeName(diff.node, 'cloudfront-invalidation') &&
|
|
35
|
+
diff.field === 'resourceId');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @throws If CloudFront rejects the invalidation, or accepts it without reporting an id.
|
|
40
|
+
*/
|
|
41
|
+
async handle(diff) {
|
|
42
|
+
// Get properties.
|
|
43
|
+
const cloudFrontInvalidation = diff.node;
|
|
44
|
+
const properties = cloudFrontInvalidation.properties;
|
|
45
|
+
const { response: distributionResponse } = cloudFrontInvalidation.parents[0].getSchemaInstanceInResourceAction();
|
|
46
|
+
// Get instances.
|
|
47
|
+
const cloudFrontClient = await this.container.get(CloudFrontClient, { args: [properties.awsAccountId], metadata: { package: '@octo' } });
|
|
48
|
+
// Drop what the edges are holding. This does not wait for the invalidation to finish: AWS takes
|
|
49
|
+
// minutes to propagate one, the API answers as soon as it is accepted, and nothing downstream
|
|
50
|
+
// reads the result, so holding an apply open for it would buy nothing.
|
|
51
|
+
this.log(`Invalidating ${properties.paths.join(', ')} on "${distributionResponse.DistributionId}"`);
|
|
52
|
+
const { Invalidation } = await cloudFrontClient.send(new CreateInvalidationCommand({
|
|
53
|
+
DistributionId: distributionResponse.DistributionId,
|
|
54
|
+
InvalidationBatch: {
|
|
55
|
+
// Unique per call, and the only thing stopping AWS from quietly returning an older
|
|
56
|
+
// invalidation instead of running this one.
|
|
57
|
+
CallerReference: `${cloudFrontInvalidation.resourceId}-${properties.contentVersion}`,
|
|
58
|
+
Paths: { Items: [...properties.paths], Quantity: properties.paths.length },
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
if (!Invalidation?.Id) {
|
|
62
|
+
throw new Error(`CloudFront accepted no invalidation for "${distributionResponse.DistributionId}"!`);
|
|
63
|
+
}
|
|
64
|
+
return { InvalidationId: Invalidation.Id };
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
AddCloudFrontInvalidationResourceAction = __decorate([
|
|
68
|
+
Action(CloudFrontInvalidation),
|
|
69
|
+
__metadata("design:paramtypes", [])
|
|
70
|
+
], AddCloudFrontInvalidationResourceAction);
|
|
71
|
+
export { AddCloudFrontInvalidationResourceAction };
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
let AddCloudFrontInvalidationResourceActionFactory = class AddCloudFrontInvalidationResourceActionFactory {
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
static async create() {
|
|
80
|
+
if (!this.instance) {
|
|
81
|
+
this.instance = new AddCloudFrontInvalidationResourceAction();
|
|
82
|
+
}
|
|
83
|
+
return this.instance;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
AddCloudFrontInvalidationResourceActionFactory = __decorate([
|
|
87
|
+
Factory(AddCloudFrontInvalidationResourceAction)
|
|
88
|
+
], AddCloudFrontInvalidationResourceActionFactory);
|
|
89
|
+
export { AddCloudFrontInvalidationResourceActionFactory };
|
|
90
|
+
//# sourceMappingURL=add-cloudfront-invalidation.resource.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-cloudfront-invalidation.resource.action.js","sourceRoot":"","sources":["../../../../src/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAa,UAAU,EAAE,OAAO,EAAwB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAGhF;;;;;;;GAOG;AAEI,IAAM,uCAAuC,GAA7C,MAAM,uCACX,SAAQ,WAAW;IAGnB;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAU;QACf,OAAO,CACL,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,GAAG;YAC9B,IAAI,CAAC,IAAI,YAAY,sBAAsB;YAC3C,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC;YACjD,IAAI,CAAC,KAAK,KAAK,YAAY,CAC5B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,IAA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E,CAAC;IAC7C,CAAC;CACF,CAAA;AA7DY,uCAAuC;IADnD,MAAM,CAAC,sBAAsB,CAAC;;GAClB,uCAAuC,CA6DnD;;AAED;;GAEG;AAEI,IAAM,8CAA8C,GAApD,MAAM,8CAA8C;IAGzD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,uCAAuC,EAAE,CAAC;QAChE,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AAZY,8CAA8C;IAD1D,OAAO,CAA0C,uCAAuC,CAAC;GAC7E,8CAA8C,CAY1D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ANodeAction, type Diff, type IResourceAction } from '@quadnix/octo';
|
|
2
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
3
|
+
/**
|
|
4
|
+
* Retires an invalidation, which takes no work.
|
|
5
|
+
*
|
|
6
|
+
* An invalidation is a call, not a thing. By the time this runs, the edges have already dropped what
|
|
7
|
+
* they were holding and there is nothing left to undo - un-invalidating is not an operation AWS
|
|
8
|
+
* offers, and would be meaningless if it were.
|
|
9
|
+
*
|
|
10
|
+
* The action exists because the diff that re-runs an invalidation is a replacement, and a
|
|
11
|
+
* replacement is a delete followed by an add. Without it, changing what is published would fail
|
|
12
|
+
* before it could issue the new invalidation.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare class DeleteCloudFrontInvalidationResourceAction extends ANodeAction implements IResourceAction<CloudFrontInvalidation> {
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
filter(diff: Diff): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
handle(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare class DeleteCloudFrontInvalidationResourceActionFactory {
|
|
34
|
+
private static instance;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
static create(): Promise<DeleteCloudFrontInvalidationResourceAction>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { ANodeAction, Action, DiffAction, Factory, hasNodeName } from '@quadnix/octo';
|
|
11
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
12
|
+
/**
|
|
13
|
+
* Retires an invalidation, which takes no work.
|
|
14
|
+
*
|
|
15
|
+
* An invalidation is a call, not a thing. By the time this runs, the edges have already dropped what
|
|
16
|
+
* they were holding and there is nothing left to undo - un-invalidating is not an operation AWS
|
|
17
|
+
* offers, and would be meaningless if it were.
|
|
18
|
+
*
|
|
19
|
+
* The action exists because the diff that re-runs an invalidation is a replacement, and a
|
|
20
|
+
* replacement is a delete followed by an add. Without it, changing what is published would fail
|
|
21
|
+
* before it could issue the new invalidation.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
let DeleteCloudFrontInvalidationResourceAction = class DeleteCloudFrontInvalidationResourceAction extends ANodeAction {
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
filter(diff) {
|
|
36
|
+
return (diff.action === DiffAction.DELETE &&
|
|
37
|
+
diff.node instanceof CloudFrontInvalidation &&
|
|
38
|
+
hasNodeName(diff.node, 'cloudfront-invalidation') &&
|
|
39
|
+
diff.field === 'resourceId');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
async handle() { }
|
|
45
|
+
};
|
|
46
|
+
DeleteCloudFrontInvalidationResourceAction = __decorate([
|
|
47
|
+
Action(CloudFrontInvalidation),
|
|
48
|
+
__metadata("design:paramtypes", [])
|
|
49
|
+
], DeleteCloudFrontInvalidationResourceAction);
|
|
50
|
+
export { DeleteCloudFrontInvalidationResourceAction };
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
let DeleteCloudFrontInvalidationResourceActionFactory = class DeleteCloudFrontInvalidationResourceActionFactory {
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
static async create() {
|
|
59
|
+
if (!this.instance) {
|
|
60
|
+
this.instance = new DeleteCloudFrontInvalidationResourceAction();
|
|
61
|
+
}
|
|
62
|
+
return this.instance;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
DeleteCloudFrontInvalidationResourceActionFactory = __decorate([
|
|
66
|
+
Factory(DeleteCloudFrontInvalidationResourceAction)
|
|
67
|
+
], DeleteCloudFrontInvalidationResourceActionFactory);
|
|
68
|
+
export { DeleteCloudFrontInvalidationResourceActionFactory };
|
|
69
|
+
//# sourceMappingURL=delete-cloudfront-invalidation.resource.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-cloudfront-invalidation.resource.action.js","sourceRoot":"","sources":["../../../../src/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAa,UAAU,EAAE,OAAO,EAAwB,WAAW,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;;;;;;;;;GAYG;AAEI,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,WAAW;IAGnB;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAU;QACf,OAAO,CACL,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM;YACjC,IAAI,CAAC,IAAI,YAAY,sBAAsB;YAC3C,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC;YACjD,IAAI,CAAC,KAAK,KAAK,YAAY,CAC5B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,KAAmB,CAAC;CACjC,CAAA;AA3BY,0CAA0C;IADtD,MAAM,CAAC,sBAAsB,CAAC;;GAClB,0CAA0C,CA2BtD;;AAED;;GAEG;AAEI,IAAM,iDAAiD,GAAvD,MAAM,iDAAiD;IAG5D;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,0CAA0C,EAAE,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AAZY,iDAAiD;IAD7D,OAAO,CAA6C,0CAA0C,CAAC;GACnF,iDAAiD,CAY7D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ANodeAction, type Diff, type IResourceAction } from '@quadnix/octo';
|
|
2
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
3
|
+
import type { CloudFrontInvalidationSchema } from '../index.schema.js';
|
|
4
|
+
/**
|
|
5
|
+
* Issues an invalidation for content that has moved since the last one.
|
|
6
|
+
*
|
|
7
|
+
* The work is identical to the add action's - an invalidation is never edited, only issued - and the
|
|
8
|
+
* two are separate because octo asks a different question of each: whether this distribution has
|
|
9
|
+
* ever been invalidated, and whether what it serves has changed since it last was.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class UpdateCloudFrontInvalidationResourceAction extends ANodeAction implements IResourceAction<CloudFrontInvalidation> {
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
filter(diff: Diff): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* @throws If CloudFront rejects the invalidation, or accepts it without reporting an id.
|
|
25
|
+
*/
|
|
26
|
+
handle(diff: Diff<CloudFrontInvalidation>): Promise<CloudFrontInvalidationSchema['response']>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare class UpdateCloudFrontInvalidationResourceActionFactory {
|
|
32
|
+
private static instance;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
static create(): Promise<UpdateCloudFrontInvalidationResourceAction>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';
|
|
11
|
+
import { ANodeAction, Action, DiffAction, Factory, hasNodeName } from '@quadnix/octo';
|
|
12
|
+
import { CloudFrontInvalidation } from '../cloudfront-invalidation.resource.js';
|
|
13
|
+
/**
|
|
14
|
+
* Issues an invalidation for content that has moved since the last one.
|
|
15
|
+
*
|
|
16
|
+
* The work is identical to the add action's - an invalidation is never edited, only issued - and the
|
|
17
|
+
* two are separate because octo asks a different question of each: whether this distribution has
|
|
18
|
+
* ever been invalidated, and whether what it serves has changed since it last was.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
let UpdateCloudFrontInvalidationResourceAction = class UpdateCloudFrontInvalidationResourceAction extends ANodeAction {
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
filter(diff) {
|
|
33
|
+
return (diff.action === DiffAction.UPDATE &&
|
|
34
|
+
diff.node instanceof CloudFrontInvalidation &&
|
|
35
|
+
hasNodeName(diff.node, 'cloudfront-invalidation') &&
|
|
36
|
+
diff.field === 'update-content-version');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* @throws If CloudFront rejects the invalidation, or accepts it without reporting an id.
|
|
41
|
+
*/
|
|
42
|
+
async handle(diff) {
|
|
43
|
+
// Get properties.
|
|
44
|
+
const cloudFrontInvalidation = diff.node;
|
|
45
|
+
const properties = cloudFrontInvalidation.properties;
|
|
46
|
+
const { response: distributionResponse } = cloudFrontInvalidation.parents[0].getSchemaInstanceInResourceAction();
|
|
47
|
+
// Get instances.
|
|
48
|
+
const cloudFrontClient = await this.container.get(CloudFrontClient, { args: [properties.awsAccountId], metadata: { package: '@octo' } });
|
|
49
|
+
// Drop what the edges are holding. This does not wait for the invalidation to finish: AWS takes
|
|
50
|
+
// minutes to propagate one, the API answers as soon as it is accepted, and nothing downstream
|
|
51
|
+
// reads the result, so holding an apply open for it would buy nothing.
|
|
52
|
+
this.log(`Invalidating ${properties.paths.join(', ')} on "${distributionResponse.DistributionId}"`);
|
|
53
|
+
const { Invalidation } = await cloudFrontClient.send(new CreateInvalidationCommand({
|
|
54
|
+
DistributionId: distributionResponse.DistributionId,
|
|
55
|
+
InvalidationBatch: {
|
|
56
|
+
// Unique per call, and the only thing stopping AWS from quietly returning an older
|
|
57
|
+
// invalidation instead of running this one.
|
|
58
|
+
CallerReference: `${cloudFrontInvalidation.resourceId}-${properties.contentVersion}`,
|
|
59
|
+
Paths: { Items: [...properties.paths], Quantity: properties.paths.length },
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
62
|
+
if (!Invalidation?.Id) {
|
|
63
|
+
throw new Error(`CloudFront accepted no invalidation for "${distributionResponse.DistributionId}"!`);
|
|
64
|
+
}
|
|
65
|
+
return { InvalidationId: Invalidation.Id };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
UpdateCloudFrontInvalidationResourceAction = __decorate([
|
|
69
|
+
Action(CloudFrontInvalidation),
|
|
70
|
+
__metadata("design:paramtypes", [])
|
|
71
|
+
], UpdateCloudFrontInvalidationResourceAction);
|
|
72
|
+
export { UpdateCloudFrontInvalidationResourceAction };
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
let UpdateCloudFrontInvalidationResourceActionFactory = class UpdateCloudFrontInvalidationResourceActionFactory {
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
static async create() {
|
|
81
|
+
if (!this.instance) {
|
|
82
|
+
this.instance = new UpdateCloudFrontInvalidationResourceAction();
|
|
83
|
+
}
|
|
84
|
+
return this.instance;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
UpdateCloudFrontInvalidationResourceActionFactory = __decorate([
|
|
88
|
+
Factory(UpdateCloudFrontInvalidationResourceAction)
|
|
89
|
+
], UpdateCloudFrontInvalidationResourceActionFactory);
|
|
90
|
+
export { UpdateCloudFrontInvalidationResourceActionFactory };
|
|
91
|
+
//# sourceMappingURL=update-cloudfront-invalidation.resource.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-cloudfront-invalidation.resource.action.js","sourceRoot":"","sources":["../../../../src/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAa,UAAU,EAAE,OAAO,EAAwB,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAGhF;;;;;;;;GAQG;AAEI,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,WAAW;IAGnB;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAU;QACf,OAAO,CACL,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM;YACjC,IAAI,CAAC,IAAI,YAAY,sBAAsB;YAC3C,WAAW,CAAC,IAAI,CAAC,I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MAAM,IAAI,KAAK,CAAC,4CAA4C,oBAAoB,CAAC,cAAc,IAAI,CAAC,CAAC;QACvG,CAAC;QAED,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC;IAC7C,CAAC;CACF,CAAA;AA7DY,0CAA0C;IADtD,MAAM,CAAC,sBAAsB,CAAC;;GAClB,0CAA0C,CA6DtD;;AAED;;GAEG;AAEI,IAAM,iDAAiD,GAAvD,MAAM,iDAAiD;IAG5D;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,0CAA0C,EAAE,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AAZY,iDAAiD;IAD7D,OAAO,CAA6C,0CAA0C,CAAC;GACnF,iDAAiD,CAY7D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AResource, Diff, type MatchingResource } from '@quadnix/octo';
|
|
2
|
+
import { CloudFrontInvalidationSchema, type InvalidationDistributionSchema } from './index.schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* One invalidation issued against a distribution.
|
|
5
|
+
*
|
|
6
|
+
* This is an external resource: its lifecycle runs outside terraform, in the actions under
|
|
7
|
+
* `./actions`. Terraform has no managed resource for an invalidation, because there is nothing to
|
|
8
|
+
* manage - the call runs, the edges drop what they were holding, and nothing remains to be edited or
|
|
9
|
+
* destroyed later.
|
|
10
|
+
*
|
|
11
|
+
* That is also why it never updates. Octo re-runs it whenever its properties move, which terraform
|
|
12
|
+
* sees as replacing the shell around it: the delete half has nothing to undo, and the add half
|
|
13
|
+
* issues a fresh invalidation.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare class CloudFrontInvalidation extends AResource<CloudFrontInvalidationSchema, CloudFrontInvalidation> {
|
|
18
|
+
parents: [MatchingResource<InvalidationDistributionSchema>];
|
|
19
|
+
properties: CloudFrontInvalidationSchema['properties'];
|
|
20
|
+
response: CloudFrontInvalidationSchema['response'];
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
constructor(resourceId: string, properties: CloudFrontInvalidationSchema['properties'], parents: [MatchingResource<InvalidationDistributionSchema>]);
|
|
25
|
+
/**
|
|
26
|
+
* Applying this resource's own diff means taking on the whole of what was invalidated - the
|
|
27
|
+
* version and the paths together. There is no smaller unit: the base implementation walks
|
|
28
|
+
* properties one key at a time, and this resource only ever reports the one diff.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
diffInverse(diff: Diff<CloudFrontInvalidation>, deReferenceResource: (resourceId: string) => Promise<never>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* A change of any kind means the edges are holding something stale, and the answer is always the
|
|
35
|
+
* same: issue an invalidation. So there is one diff here rather than one per property.
|
|
36
|
+
*
|
|
37
|
+
* It reports an update rather than a replacement even though nothing about the previous
|
|
38
|
+
* invalidation is edited, because a replacement would have to destroy something first and there is
|
|
39
|
+
* nothing to destroy - an invalidation that ran is over. What persists between runs is octo's
|
|
40
|
+
* record of which content version the edges were last told about, and that is what an update moves.
|
|
41
|
+
*
|
|
42
|
+
* Every property counts, which is what keeps this in step with the trigger hash terraform holds:
|
|
43
|
+
* that hash defaults to every property too, and a property this ignored would have terraform
|
|
44
|
+
* re-run an invalidation octo reported no change for.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
diffProperties(previous: CloudFrontInvalidation): Promise<Diff[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Two diffs survive: this resource arriving or leaving, and the content version moving. Everything
|
|
51
|
+
* else a resource can diff describes something an invalidation does not own.
|
|
52
|
+
*
|
|
53
|
+
* A changed parent is the one worth naming. If the distribution is merely reconfigured, its ARN
|
|
54
|
+
* and id do not move, terraform's triggers do not move, and terraform re-runs nothing - so octo
|
|
55
|
+
* acting here would invalidate on a change terraform considers no change at all. If the
|
|
56
|
+
* distribution is instead replaced, its outputs do move, and terraform calls back on its own.
|
|
57
|
+
* Either way the parent diff is not this resource's to answer.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
diffUnpack(diff: Diff): Diff[];
|
|
62
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 { AResource, Diff, DiffAction, DiffUtility, Resource } from '@quadnix/octo';
|
|
11
|
+
import { CloudFrontInvalidationSchema } from './index.schema.js';
|
|
12
|
+
/**
|
|
13
|
+
* One invalidation issued against a distribution.
|
|
14
|
+
*
|
|
15
|
+
* This is an external resource: its lifecycle runs outside terraform, in the actions under
|
|
16
|
+
* `./actions`. Terraform has no managed resource for an invalidation, because there is nothing to
|
|
17
|
+
* manage - the call runs, the edges drop what they were holding, and nothing remains to be edited or
|
|
18
|
+
* destroyed later.
|
|
19
|
+
*
|
|
20
|
+
* That is also why it never updates. Octo re-runs it whenever its properties move, which terraform
|
|
21
|
+
* sees as replacing the shell around it: the delete half has nothing to undo, and the add half
|
|
22
|
+
* issues a fresh invalidation.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
let CloudFrontInvalidation = class CloudFrontInvalidation extends AResource {
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
constructor(resourceId, properties, parents) {
|
|
31
|
+
super(resourceId, properties, parents);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Applying this resource's own diff means taking on the whole of what was invalidated - the
|
|
35
|
+
* version and the paths together. There is no smaller unit: the base implementation walks
|
|
36
|
+
* properties one key at a time, and this resource only ever reports the one diff.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
async diffInverse(diff, deReferenceResource) {
|
|
41
|
+
if (diff.action === DiffAction.UPDATE && diff.field === 'update-content-version') {
|
|
42
|
+
await this.cloneResourceInPlace(diff.node, deReferenceResource);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
await super.diffInverse(diff, deReferenceResource);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A change of any kind means the edges are holding something stale, and the answer is always the
|
|
50
|
+
* same: issue an invalidation. So there is one diff here rather than one per property.
|
|
51
|
+
*
|
|
52
|
+
* It reports an update rather than a replacement even though nothing about the previous
|
|
53
|
+
* invalidation is edited, because a replacement would have to destroy something first and there is
|
|
54
|
+
* nothing to destroy - an invalidation that ran is over. What persists between runs is octo's
|
|
55
|
+
* record of which content version the edges were last told about, and that is what an update moves.
|
|
56
|
+
*
|
|
57
|
+
* Every property counts, which is what keeps this in step with the trigger hash terraform holds:
|
|
58
|
+
* that hash defaults to every property too, and a property this ignored would have terraform
|
|
59
|
+
* re-run an invalidation octo reported no change for.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
async diffProperties(previous) {
|
|
64
|
+
return DiffUtility.isObjectDeepEquals(previous.properties, this.properties)
|
|
65
|
+
? []
|
|
66
|
+
: [new Diff(this, DiffAction.UPDATE, 'update-content-version', this.properties.contentVersion)];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Two diffs survive: this resource arriving or leaving, and the content version moving. Everything
|
|
70
|
+
* else a resource can diff describes something an invalidation does not own.
|
|
71
|
+
*
|
|
72
|
+
* A changed parent is the one worth naming. If the distribution is merely reconfigured, its ARN
|
|
73
|
+
* and id do not move, terraform's triggers do not move, and terraform re-runs nothing - so octo
|
|
74
|
+
* acting here would invalidate on a change terraform considers no change at all. If the
|
|
75
|
+
* distribution is instead replaced, its outputs do move, and terraform calls back on its own.
|
|
76
|
+
* Either way the parent diff is not this resource's to answer.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
diffUnpack(diff) {
|
|
81
|
+
return diff.field === 'resourceId' || diff.field === 'update-content-version' ? [diff] : [];
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
CloudFrontInvalidation = __decorate([
|
|
85
|
+
Resource('@octo', 'cloudfront-invalidation', CloudFrontInvalidationSchema),
|
|
86
|
+
__metadata("design:paramtypes", [String, Object, Array])
|
|
87
|
+
], CloudFrontInvalidation);
|
|
88
|
+
export { CloudFrontInvalidation };
|
|
89
|
+
//# sourceMappingURL=cloudfront-invalidation.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudfront-invalidation.resource.js","sourceRoot":"","sources":["../../../src/resources/cloudfront-invalidation/cloudfront-invalidation.resource.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAyB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,4BAA4B,EAAuC,MAAM,mBAAmB,CAAC;AAEtG;;;;;;;;;;;;;GAaG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,SAA+D;IAKzG;;OAEG;IACH,YACE,U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
3
|
+
import './actions/delete-cloudfront-invalidation.resource.action.js';
|
|
4
|
+
import './actions/update-cloudfront-invalidation.resource.action.js';
|
|
5
|
+
export { CloudFrontInvalidation } from './cloudfront-invalidation.resource.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import '../../factories/aws-client.factory.js';
|
|
2
|
+
import './actions/add-cloudfront-invalidation.resource.action.js';
|
|
3
|
+
import './actions/delete-cloudfront-invalidation.resource.action.js';
|
|
4
|
+
import './actions/update-cloudfront-invalidation.resource.action.js';
|
|
5
|
+
export { CloudFrontInvalidation } from './cloudfront-invalidation.resource.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/cloudfront-invalidation/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0DAA0D,CAAC;AAClE,OAAO,6DAA6D,CAAC;AACrE,OAAO,6DAA6D,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseResourceSchema } from '@quadnix/octo';
|
|
2
|
+
/**
|
|
3
|
+
* The distribution an invalidation is issued against. Structural, so any resource publishing a
|
|
4
|
+
* distribution id satisfies it.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class InvalidationDistributionSchema extends BaseResourceSchema {
|
|
9
|
+
response: {
|
|
10
|
+
DistributionId?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The `CloudFrontInvalidationSchema` class is the schema for the `CloudFrontInvalidation` resource,
|
|
15
|
+
* which drops what CloudFront's edge locations are holding for a distribution.
|
|
16
|
+
*
|
|
17
|
+
* Terraform provisions no part of it. There is no managed resource in the AWS provider for an
|
|
18
|
+
* invalidation, because an invalidation is not a thing that exists - it is a call that runs and
|
|
19
|
+
* finishes. So this is an external resource: octo issues `CreateInvalidation` itself, through the
|
|
20
|
+
* `octo run-action` callback terraform makes mid-apply.
|
|
21
|
+
*
|
|
22
|
+
* It exists because the alternative is silent. A distribution serving a bucket caches an object for
|
|
23
|
+
* as long as its cache policy says, which for `Managed-CachingOptimized` is a day, and an S3 object
|
|
24
|
+
* carries no `Cache-Control` of its own. Without this, uploading a new version of a site reports
|
|
25
|
+
* success and changes nothing a visitor can see until the next day.
|
|
26
|
+
*
|
|
27
|
+
* @group Resources/CloudFrontInvalidation
|
|
28
|
+
*
|
|
29
|
+
* @hideconstructor
|
|
30
|
+
*
|
|
31
|
+
* @overrideProperty parents - The distribution whose edge caches are dropped.
|
|
32
|
+
* ```mermaid
|
|
33
|
+
* graph TD;
|
|
34
|
+
* cloudfront_distribution((CloudFront<br>Distribution)) --> cloudfront_invalidation((CloudFront<br>Invalidation))
|
|
35
|
+
* ```
|
|
36
|
+
* @overrideProperty resourceId - The resource id is of format `cloudfront-invalidation-<distribution-name>`.
|
|
37
|
+
*/
|
|
38
|
+
export declare class CloudFrontInvalidationSchema extends BaseResourceSchema {
|
|
39
|
+
/**
|
|
40
|
+
* Input properties.
|
|
41
|
+
* * `properties.awsAccountId` - The AWS account id.
|
|
42
|
+
* * `properties.contentVersion` - What the distribution is currently serving. It is not read by
|
|
43
|
+
* the call; it is the whole trigger. Octo re-runs this resource when this value moves, and does
|
|
44
|
+
* nothing when it does not, so whoever owns the content decides when an invalidation happens by
|
|
45
|
+
* deciding what this says. A digest over the published files is the usual answer.
|
|
46
|
+
* * `properties.paths` - The paths to drop, e.g. `/*`. AWS bills per path beyond the first
|
|
47
|
+
* thousand a month, and `/*` counts as one.
|
|
48
|
+
*/
|
|
49
|
+
properties: {
|
|
50
|
+
awsAccountId: string;
|
|
51
|
+
contentVersion: string;
|
|
52
|
+
paths: string[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Saved response.
|
|
56
|
+
* * `response.InvalidationId` - The id AWS assigned the invalidation that ran.
|
|
57
|
+
*/
|
|
58
|
+
response: {
|
|
59
|
+
InvalidationId?: string;
|
|
60
|
+
};
|
|
61
|
+
}
|