@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.
Files changed (49) hide show
  1. package/dist/factories/aws-client.factory.d.ts +28 -0
  2. package/dist/factories/aws-client.factory.js +36 -0
  3. package/dist/factories/aws-client.factory.js.map +1 -1
  4. package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.d.ts +6 -0
  5. package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.js +11 -1
  6. package/dist/modules/service/aws-s3-static-website-service/aws-s3-static-website-service.module.js.map +1 -1
  7. package/dist/modules/service/aws-s3-static-website-service/index.schema.d.ts +58 -0
  8. package/dist/modules/service/aws-s3-static-website-service/index.schema.js +96 -0
  9. package/dist/modules/service/aws-s3-static-website-service/index.schema.js.map +1 -1
  10. package/dist/modules/service/aws-s3-static-website-service/models/service/actions/add-aws-s3-static-website-service.model.action.js +89 -4
  11. package/dist/modules/service/aws-s3-static-website-service/models/service/actions/add-aws-s3-static-website-service.model.action.js.map +1 -1
  12. 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
  13. 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
  14. package/dist/modules/service/aws-s3-static-website-service/models/service/aws-s3-static-website-service.model.js +6 -3
  15. package/dist/modules/service/aws-s3-static-website-service/models/service/aws-s3-static-website-service.model.js.map +1 -1
  16. package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.d.ts +97 -0
  17. package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.js +613 -0
  18. package/dist/resources/cloudfront-distribution/cloudfront-distribution.resource.js.map +1 -0
  19. package/dist/resources/cloudfront-distribution/index.d.ts +1 -0
  20. package/dist/resources/cloudfront-distribution/index.js +2 -0
  21. package/dist/resources/cloudfront-distribution/index.js.map +1 -0
  22. package/dist/resources/cloudfront-distribution/index.schema.d.ts +522 -0
  23. package/dist/resources/cloudfront-distribution/index.schema.js +754 -0
  24. package/dist/resources/cloudfront-distribution/index.schema.js.map +1 -0
  25. package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.d.ts +36 -0
  26. package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.js +90 -0
  27. package/dist/resources/cloudfront-invalidation/actions/add-cloudfront-invalidation.resource.action.js.map +1 -0
  28. package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.d.ts +39 -0
  29. package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.js +69 -0
  30. package/dist/resources/cloudfront-invalidation/actions/delete-cloudfront-invalidation.resource.action.js.map +1 -0
  31. package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.d.ts +37 -0
  32. package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.js +91 -0
  33. package/dist/resources/cloudfront-invalidation/actions/update-cloudfront-invalidation.resource.action.js.map +1 -0
  34. package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.d.ts +62 -0
  35. package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.js +89 -0
  36. package/dist/resources/cloudfront-invalidation/cloudfront-invalidation.resource.js.map +1 -0
  37. package/dist/resources/cloudfront-invalidation/index.d.ts +5 -0
  38. package/dist/resources/cloudfront-invalidation/index.js +6 -0
  39. package/dist/resources/cloudfront-invalidation/index.js.map +1 -0
  40. package/dist/resources/cloudfront-invalidation/index.schema.d.ts +61 -0
  41. package/dist/resources/cloudfront-invalidation/index.schema.js +110 -0
  42. package/dist/resources/cloudfront-invalidation/index.schema.js.map +1 -0
  43. package/dist/resources/s3-website/index.schema.d.ts +20 -0
  44. package/dist/resources/s3-website/index.schema.js +38 -0
  45. package/dist/resources/s3-website/index.schema.js.map +1 -1
  46. package/dist/resources/s3-website/s3-website.resource.d.ts +20 -3
  47. package/dist/resources/s3-website/s3-website.resource.js +82 -26
  48. package/dist/resources/s3-website/s3-website.resource.js.map +1 -1
  49. package/package.json +4 -1
@@ -0,0 +1,613 @@
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
+ var CloudFrontDistribution_1;
11
+ import { ATerraformResource, Diff, DiffAction, DiffUtility, Resource, } from '@quadnix/octo';
12
+ import { CommonUtility } from '../../utilities/common/common.utility.js';
13
+ import { PolicyUtility } from '../../utilities/policy/policy.utility.js';
14
+ import { CloudFrontDistributionSchema, } from './index.schema.js';
15
+ /**
16
+ * The only region CloudFront reads a certificate or a web ACL from, whichever region the origins
17
+ * behind it live in. AWS rejects anything else at apply, so it is worth catching here.
18
+ *
19
+ * @internal
20
+ */
21
+ const CLOUD_FRONT_GLOBAL_REGION = 'us-east-1';
22
+ /**
23
+ * The longest name AWS accepts for an origin access control.
24
+ *
25
+ * @internal
26
+ */
27
+ const ORIGIN_ACCESS_CONTROL_NAME_MAX_LENGTH = 64;
28
+ /**
29
+ * What an unset optional field means at render time.
30
+ *
31
+ * A schema default only fires for a value octo instantiated through the schema, and the nested
32
+ * members of `properties` are plain objects a module author wrote by hand. So the renderer supplies
33
+ * its own values rather than trusting a default that would never run - otherwise a policy
34
+ * declared as `{ name: 'x' }`, which the schema says is legal, renders as `undefined`.
35
+ *
36
+ * @internal
37
+ */
38
+ const RENDER_DEFAULTS = {
39
+ behavior: {
40
+ allowedMethods: ['GET', 'HEAD'],
41
+ cachedMethods: ['GET', 'HEAD'],
42
+ compress: true,
43
+ functionAssociations: [],
44
+ viewerProtocolPolicy: 'redirect-to-https',
45
+ },
46
+ cachePolicy: { defaultTtl: 86400, enableBrotli: true, enableGzip: true, maxTtl: 31536000, minTtl: 1 },
47
+ errorCachingMinTtl: 10,
48
+ origin: { connectionAttempts: 3, connectionTimeout: 10, customHeaders: {}, originPath: '' },
49
+ securityHeaders: { contentTypeOptions: true, frameOptions: 'SAMEORIGIN', strictTransportSecurityMaxAge: 31536000 },
50
+ valueSelection: { kind: 'none' },
51
+ };
52
+ /**
53
+ * @internal
54
+ */
55
+ let CloudFrontDistribution = CloudFrontDistribution_1 = class CloudFrontDistribution extends ATerraformResource {
56
+ /**
57
+ * @internal
58
+ */
59
+ constructor(resourceId, properties, parents = []) {
60
+ super(resourceId, properties, parents);
61
+ this.validateReferences();
62
+ }
63
+ /**
64
+ * A name AWS will accept, that still says which thing it belongs to.
65
+ *
66
+ * A distribution's name and an origin's are each free-form, so their join is what overflows a
67
+ * limit neither of them knew about. Cutting the tail off alone would let two origins collide, so
68
+ * what is cut is replaced by a digest of the whole name: two names that differ anywhere still
69
+ * differ here, and the same name always renders the same way.
70
+ *
71
+ * @internal
72
+ */
73
+ static boundedName(name, maxLength) {
74
+ if (name.length <= maxLength) {
75
+ return name;
76
+ }
77
+ const digest = CommonUtility.hash(name).substring(0, 8);
78
+ return `${name.substring(0, maxLength - digest.length - 1)}-${digest}`;
79
+ }
80
+ /**
81
+ * How a policy reference is looked up once every policy has been emitted.
82
+ *
83
+ * @internal
84
+ */
85
+ static policyKey(slot, reference) {
86
+ return `${slot}/${reference.kind}/${reference.name}`;
87
+ }
88
+ /**
89
+ * Nothing about a distribution is force-new. Origins, behaviors, aliases, the certificate, the WAF
90
+ * association - AWS edits all of them in place on a live distribution, so every change is an
91
+ * update. What is left is identity, and the distribution's name is already in the resource id, so
92
+ * only the account can move a distribution to being a different one.
93
+ *
94
+ * @internal
95
+ */
96
+ async diffProperties(previous) {
97
+ if (previous.properties.awsAccountId !== this.properties.awsAccountId) {
98
+ return [
99
+ new Diff(this, DiffAction.REPLACE, 'resourceId', this.getContext(), 'a distribution belongs to one account; a change recreates it'),
100
+ ];
101
+ }
102
+ if (!DiffUtility.isObjectDeepEquals(previous.properties, this.properties)) {
103
+ return [new Diff(this, DiffAction.UPDATE, 'properties', this.properties)];
104
+ }
105
+ return [];
106
+ }
107
+ /**
108
+ * @internal
109
+ */
110
+ async toHCL(terraform) {
111
+ const distributionOctoResource = terraform.addOctoTerraformResource(this, {
112
+ provider: { accountId: this.properties.awsAccountId },
113
+ });
114
+ const providerRef = terraform.getProviderAliasRef(this.properties.awsAccountId);
115
+ const policyIdByReference = this.renderPolicies(terraform, distributionOctoResource, providerRef);
116
+ const originAccessControlIdByOriginId = this.renderOriginAccessControls(terraform, distributionOctoResource);
117
+ const distributionTFResource = distributionOctoResource.addTerraformResource('aws_cloudfront_distribution', `${this.resourceId}_distribution`, {
118
+ ...(this.properties.aliases.length > 0 ? { aliases: this.properties.aliases } : {}),
119
+ comment: this.properties.comment,
120
+ ...(this.properties.customErrorResponses.length > 0
121
+ ? {
122
+ custom_error_response: this.properties.customErrorResponses.map((customErrorResponse) => ({
123
+ error_caching_min_ttl: customErrorResponse.errorCachingMinTtl ?? RENDER_DEFAULTS.errorCachingMinTtl,
124
+ error_code: customErrorResponse.errorCode,
125
+ response_code: customErrorResponse.responseCode,
126
+ response_page_path: customErrorResponse.responsePagePath,
127
+ })),
128
+ }
129
+ : {}),
130
+ default_cache_behavior: this.renderBehavior(this.getDefaultBehavior(), policyIdByReference),
131
+ ...(this.properties.defaultRootObject ? { default_root_object: this.properties.defaultRootObject } : {}),
132
+ enabled: this.properties.enabled,
133
+ http_version: this.properties.httpVersion,
134
+ is_ipv6_enabled: this.properties.isIpv6Enabled,
135
+ ...(this.properties.logging
136
+ ? {
137
+ logging_config: {
138
+ bucket: this.properties.logging.bucketDomainName,
139
+ include_cookies: this.properties.logging.includeCookies,
140
+ prefix: this.properties.logging.prefix,
141
+ },
142
+ }
143
+ : {}),
144
+ ...(this.getOrderedBehaviors().length > 0
145
+ ? {
146
+ ordered_cache_behavior: this.getOrderedBehaviors().map((behavior) => ({
147
+ ...this.renderBehavior(behavior, policyIdByReference),
148
+ path_pattern: behavior.pathPattern,
149
+ })),
150
+ }
151
+ : {}),
152
+ origin: this.properties.origins.map((origin) => this.renderOrigin(terraform, origin, originAccessControlIdByOriginId)),
153
+ ...(this.properties.originGroups.length > 0
154
+ ? {
155
+ origin_group: this.properties.originGroups.map((originGroup) => ({
156
+ failover_criteria: { status_codes: originGroup.failoverStatusCodes },
157
+ member: [{ origin_id: originGroup.primaryOriginId }, { origin_id: originGroup.failoverOriginId }],
158
+ origin_id: originGroup.originGroupId,
159
+ })),
160
+ }
161
+ : {}),
162
+ price_class: this.properties.priceClass,
163
+ restrictions: {
164
+ geo_restriction: this.properties.geoRestriction.kind === 'none'
165
+ ? { restriction_type: 'none' }
166
+ : {
167
+ locations: this.properties.geoRestriction.countries,
168
+ restriction_type: this.properties.geoRestriction.kind === 'allow' ? 'whitelist' : 'blacklist',
169
+ },
170
+ },
171
+ viewer_certificate: this.properties.viewerCertificate.kind === 'acm'
172
+ ? {
173
+ acm_certificate_arn: this.properties.viewerCertificate.certificateArn,
174
+ minimum_protocol_version: this.properties.viewerCertificate.minimumProtocolVersion,
175
+ // eslint-disable-next-line spellcheck/spell-checker
176
+ ssl_support_method: 'sni-only',
177
+ }
178
+ : { cloudfront_default_certificate: true },
179
+ ...(this.properties.webAclArn ? { web_acl_id: this.properties.webAclArn } : {}),
180
+ });
181
+ distributionOctoResource.output({
182
+ Arn: terraform.raw(`${distributionTFResource.address}.arn`),
183
+ DistributionId: terraform.raw(`${distributionTFResource.address}.id`),
184
+ DomainName: terraform.raw(`${distributionTFResource.address}.domain_name`),
185
+ HostedZoneId: terraform.raw(`${distributionTFResource.address}.hosted_zone_id`),
186
+ });
187
+ if (Object.keys(this.tags).length > 0) {
188
+ distributionTFResource.attribute('tags', this.tags);
189
+ }
190
+ }
191
+ /**
192
+ * Every managed policy a behavior names, paired with the slot it fills.
193
+ *
194
+ * @internal
195
+ */
196
+ collectManagedPolicyReferences() {
197
+ const references = [];
198
+ for (const behavior of this.properties.behaviors) {
199
+ if (behavior.cachePolicy.kind === 'managed') {
200
+ references.push(['cache', behavior.cachePolicy]);
201
+ }
202
+ if (behavior.originRequestPolicy?.kind === 'managed') {
203
+ references.push(['originRequest', behavior.originRequestPolicy]);
204
+ }
205
+ if (behavior.responseHeadersPolicy?.kind === 'managed') {
206
+ references.push(['responseHeaders', behavior.responseHeadersPolicy]);
207
+ }
208
+ }
209
+ return references;
210
+ }
211
+ /**
212
+ * The behavior claiming everything no other behavior did.
213
+ *
214
+ * @internal
215
+ */
216
+ getDefaultBehavior() {
217
+ return this.properties.behaviors.find((behavior) => !behavior.pathPattern);
218
+ }
219
+ /**
220
+ * The behaviors matched, in order, before the default one.
221
+ *
222
+ * @internal
223
+ */
224
+ getOrderedBehaviors() {
225
+ return this.properties.behaviors.filter((behavior) => !!behavior.pathPattern);
226
+ }
227
+ /**
228
+ * @internal
229
+ */
230
+ renderBehavior(behavior, policyIdByReference) {
231
+ const functionAssociations = behavior.functionAssociations ?? RENDER_DEFAULTS.behavior.functionAssociations;
232
+ const cloudFrontFunctions = functionAssociations.filter((f) => f.kind === 'cloudfront-function');
233
+ const lambdaEdgeFunctions = functionAssociations.filter((f) => f.kind === 'lambda-edge');
234
+ return {
235
+ allowed_methods: behavior.allowedMethods ?? RENDER_DEFAULTS.behavior.allowedMethods,
236
+ cache_policy_id: policyIdByReference.get(CloudFrontDistribution_1.policyKey('cache', behavior.cachePolicy)),
237
+ cached_methods: behavior.cachedMethods ?? RENDER_DEFAULTS.behavior.cachedMethods,
238
+ compress: behavior.compress ?? RENDER_DEFAULTS.behavior.compress,
239
+ ...(cloudFrontFunctions.length > 0
240
+ ? {
241
+ function_association: cloudFrontFunctions.map((f) => ({
242
+ event_type: f.eventType,
243
+ function_arn: f.arn,
244
+ })),
245
+ }
246
+ : {}),
247
+ ...(lambdaEdgeFunctions.length > 0
248
+ ? {
249
+ lambda_function_association: lambdaEdgeFunctions.map((f) => ({
250
+ event_type: f.eventType,
251
+ lambda_arn: f.arn,
252
+ })),
253
+ }
254
+ : {}),
255
+ ...(behavior.originRequestPolicy
256
+ ? {
257
+ origin_request_policy_id: policyIdByReference.get(CloudFrontDistribution_1.policyKey('originRequest', behavior.originRequestPolicy)),
258
+ }
259
+ : {}),
260
+ ...(behavior.responseHeadersPolicy
261
+ ? {
262
+ response_headers_policy_id: policyIdByReference.get(CloudFrontDistribution_1.policyKey('responseHeaders', behavior.responseHeadersPolicy)),
263
+ }
264
+ : {}),
265
+ target_origin_id: behavior.targetOriginId,
266
+ viewer_protocol_policy: behavior.viewerProtocolPolicy ?? RENDER_DEFAULTS.behavior.viewerProtocolPolicy,
267
+ };
268
+ }
269
+ /**
270
+ * @internal
271
+ */
272
+ renderOrigin(terraform, origin, originAccessControlIdByOriginId) {
273
+ const customHeaders = Object.entries(origin.customHeaders ?? RENDER_DEFAULTS.origin.customHeaders);
274
+ return {
275
+ connection_attempts: origin.connectionAttempts ?? RENDER_DEFAULTS.origin.connectionAttempts,
276
+ connection_timeout: origin.connectionTimeout ?? RENDER_DEFAULTS.origin.connectionTimeout,
277
+ ...(customHeaders.length > 0 ? { custom_header: customHeaders.map(([name, value]) => ({ name, value })) } : {}),
278
+ ...(origin.kind.kind === 'custom'
279
+ ? {
280
+ custom_origin_config: {
281
+ http_port: origin.kind.httpPort,
282
+ https_port: origin.kind.httpsPort,
283
+ origin_keepalive_timeout: origin.kind.keepaliveTimeout,
284
+ origin_protocol_policy: origin.kind.originProtocolPolicy,
285
+ origin_read_timeout: origin.kind.readTimeout,
286
+ origin_ssl_protocols: origin.kind.sslProtocols,
287
+ },
288
+ }
289
+ : { origin_access_control_id: originAccessControlIdByOriginId.get(origin.originId) }),
290
+ // An S3 origin's hostname is written down rather than referenced, because the bucket's own
291
+ // policy already references this distribution's ARN. Referencing it back would close a cycle
292
+ // between the two folders, which terragrunt cannot order.
293
+ domain_name: origin.kind.kind === 's3'
294
+ ? `${origin.kind.bucketName}.s3.${origin.kind.bucketRegion}.amazonaws.com`
295
+ : origin.kind.source.kind === 'literal'
296
+ ? origin.kind.source.domainName
297
+ : terraform.getRef(this.parents.find((p) => p.getSchemaInstanceInResourceAction().resourceId ===
298
+ origin.kind.source.resourceId), origin.kind.source.responseKey),
299
+ origin_id: origin.originId,
300
+ ...(origin.originPath ? { origin_path: origin.originPath } : {}),
301
+ };
302
+ }
303
+ /**
304
+ * One origin access control per S3 origin. It is what lets the distribution sign its requests to
305
+ * a bucket that admits nothing else.
306
+ *
307
+ * @internal
308
+ */
309
+ renderOriginAccessControls(terraform, distributionOctoResource) {
310
+ const originAccessControlIdByOriginId = new Map();
311
+ for (const origin of this.properties.origins) {
312
+ if (origin.kind.kind !== 's3') {
313
+ continue;
314
+ }
315
+ const label = PolicyUtility.getSafeSid(origin.originId);
316
+ const originAccessControlTFResource = distributionOctoResource.addTerraformResource('aws_cloudfront_origin_access_control', `${this.resourceId}_origin_access_control_${label}`, {
317
+ name: CloudFrontDistribution_1.boundedName(`${this.resourceId}-${origin.originId}`, ORIGIN_ACCESS_CONTROL_NAME_MAX_LENGTH),
318
+ origin_access_control_origin_type: 's3',
319
+ signing_behavior: 'always',
320
+ // eslint-disable-next-line spellcheck/spell-checker
321
+ signing_protocol: 'sigv4',
322
+ });
323
+ originAccessControlIdByOriginId.set(origin.originId, terraform.raw(`${originAccessControlTFResource.address}.id`));
324
+ }
325
+ return originAccessControlIdByOriginId;
326
+ }
327
+ /**
328
+ * Emits every policy the behaviors reach for, and returns the id expression each reference
329
+ * resolves to.
330
+ *
331
+ * A managed policy is read by name through a `data` block, so the id AWS assigns is never written
332
+ * down here. A custom policy is created, and only the behaviors of this distribution can name it.
333
+ *
334
+ * @internal
335
+ */
336
+ renderPolicies(terraform, distributionOctoResource, providerRef) {
337
+ const policyIdByReference = new Map();
338
+ for (const cachePolicy of this.properties.cachePolicies) {
339
+ const tfResource = distributionOctoResource.addTerraformResource('aws_cloudfront_cache_policy', `${this.resourceId}_cache_policy_${PolicyUtility.getSafeSid(cachePolicy.name)}`, {
340
+ default_ttl: cachePolicy.defaultTtl ?? RENDER_DEFAULTS.cachePolicy.defaultTtl,
341
+ max_ttl: cachePolicy.maxTtl ?? RENDER_DEFAULTS.cachePolicy.maxTtl,
342
+ min_ttl: cachePolicy.minTtl ?? RENDER_DEFAULTS.cachePolicy.minTtl,
343
+ name: cachePolicy.name,
344
+ parameters_in_cache_key_and_forwarded_to_origin: {
345
+ cookies_config: renderCookiesConfig(cachePolicy.cookies),
346
+ enable_accept_encoding_brotli: cachePolicy.enableBrotli ?? RENDER_DEFAULTS.cachePolicy.enableBrotli,
347
+ enable_accept_encoding_gzip: cachePolicy.enableGzip ?? RENDER_DEFAULTS.cachePolicy.enableGzip,
348
+ headers_config: renderHeadersConfig(cachePolicy.headers),
349
+ query_strings_config: renderQueryStringsConfig(cachePolicy.queryStrings),
350
+ },
351
+ });
352
+ policyIdByReference.set(CloudFrontDistribution_1.policyKey('cache', { kind: 'custom', name: cachePolicy.name }), terraform.raw(`${tfResource.address}.id`));
353
+ }
354
+ for (const originRequestPolicy of this.properties.originRequestPolicies) {
355
+ const tfResource = distributionOctoResource.addTerraformResource('aws_cloudfront_origin_request_policy', `${this.resourceId}_origin_request_policy_${PolicyUtility.getSafeSid(originRequestPolicy.name)}`, {
356
+ cookies_config: renderCookiesConfig(originRequestPolicy.cookies),
357
+ headers_config: renderHeadersConfig(originRequestPolicy.headers),
358
+ name: originRequestPolicy.name,
359
+ query_strings_config: renderQueryStringsConfig(originRequestPolicy.queryStrings),
360
+ });
361
+ policyIdByReference.set(CloudFrontDistribution_1.policyKey('originRequest', { kind: 'custom', name: originRequestPolicy.name }), terraform.raw(`${tfResource.address}.id`));
362
+ }
363
+ for (const responseHeadersPolicy of this.properties.responseHeadersPolicies) {
364
+ const tfResource = distributionOctoResource.addTerraformResource('aws_cloudfront_response_headers_policy', `${this.resourceId}_response_headers_policy_${PolicyUtility.getSafeSid(responseHeadersPolicy.name)}`, renderResponseHeadersPolicy(responseHeadersPolicy));
365
+ policyIdByReference.set(CloudFrontDistribution_1.policyKey('responseHeaders', { kind: 'custom', name: responseHeadersPolicy.name }), terraform.raw(`${tfResource.address}.id`));
366
+ }
367
+ const managedDataTypes = {
368
+ cache: 'aws_cloudfront_cache_policy',
369
+ originRequest: 'aws_cloudfront_origin_request_policy',
370
+ responseHeaders: 'aws_cloudfront_response_headers_policy',
371
+ };
372
+ for (const [slot, reference] of this.collectManagedPolicyReferences()) {
373
+ const key = CloudFrontDistribution_1.policyKey(slot, reference);
374
+ if (policyIdByReference.has(key)) {
375
+ continue;
376
+ }
377
+ const dataSource = terraform.addTerraformData(managedDataTypes[slot], `${this.resourceId}_managed_${slot}_${PolicyUtility.getSafeSid(reference.name)}`, { name: reference.name, provider: providerRef });
378
+ policyIdByReference.set(key, dataSource.ref('id'));
379
+ }
380
+ return policyIdByReference;
381
+ }
382
+ /**
383
+ * Everything a distribution says about itself that terraform would only reject later, or that AWS
384
+ * would accept and then serve wrongly.
385
+ *
386
+ * @internal
387
+ * @throws If ids collide or do not resolve, if an alias has no certificate to serve it, if a
388
+ * certificate or web ACL is not one CloudFront can read, or if a CloudFront Function is bound to
389
+ * an event it cannot run on.
390
+ */
391
+ validateReferences() {
392
+ const originIds = this.properties.origins.map((origin) => origin.originId);
393
+ const originGroupIds = this.properties.originGroups.map((originGroup) => originGroup.originGroupId);
394
+ const targetIds = [...originIds, ...originGroupIds];
395
+ // Behaviors and origin groups name origins out of one namespace, so a duplicate would silently
396
+ // resolve to whichever came first.
397
+ const duplicateIds = targetIds.filter((id, index) => targetIds.indexOf(id) !== index);
398
+ if (duplicateIds.length > 0) {
399
+ throw new Error(`CloudFront origin id "${duplicateIds[0]}" is declared more than once!`);
400
+ }
401
+ const s3BucketNames = this.properties.origins
402
+ .filter((origin) => origin.kind.kind === 's3')
403
+ .map((origin) => origin.kind.bucketName);
404
+ const duplicateBucketNames = s3BucketNames.filter((name, index) => s3BucketNames.indexOf(name) !== index);
405
+ if (duplicateBucketNames.length > 0) {
406
+ throw new Error(`CloudFront bucket "${duplicateBucketNames[0]}" is claimed by more than one origin!`);
407
+ }
408
+ // An S3 origin is reached over HTTPS at `<bucket>.s3.<region>.amazonaws.com`, and the certificate
409
+ // AWS serves there covers one label in front of `s3`. A bucket named with a dot is accepted by
410
+ // every step up to the first request, which then fails the handshake and answers 502.
411
+ const dottedBucketName = s3BucketNames.find((name) => name.includes('.'));
412
+ if (dottedBucketName) {
413
+ throw new Error(`CloudFront cannot reach an S3 origin whose bucket name holds a dot, "${dottedBucketName}"!`);
414
+ }
415
+ for (const originGroup of this.properties.originGroups) {
416
+ for (const memberId of [originGroup.primaryOriginId, originGroup.failoverOriginId]) {
417
+ if (!originIds.includes(memberId)) {
418
+ throw new Error(`CloudFront origin group "${originGroup.originGroupId}" names unknown origin "${memberId}"!`);
419
+ }
420
+ }
421
+ }
422
+ const defaultBehaviors = this.properties.behaviors.filter((behavior) => !behavior.pathPattern);
423
+ if (defaultBehaviors.length !== 1) {
424
+ throw new Error('A CloudFront distribution needs exactly one behavior without a path pattern!');
425
+ }
426
+ const customPolicyNames = {
427
+ cache: this.properties.cachePolicies.map((p) => p.name),
428
+ originRequest: this.properties.originRequestPolicies.map((p) => p.name),
429
+ responseHeaders: this.properties.responseHeadersPolicies.map((p) => p.name),
430
+ };
431
+ for (const behavior of this.properties.behaviors) {
432
+ if (!targetIds.includes(behavior.targetOriginId)) {
433
+ throw new Error(`CloudFront behavior names unknown origin "${behavior.targetOriginId}"!`);
434
+ }
435
+ const referenced = [
436
+ ['cache', behavior.cachePolicy],
437
+ ['originRequest', behavior.originRequestPolicy],
438
+ ['responseHeaders', behavior.responseHeadersPolicy],
439
+ ];
440
+ for (const [slot, reference] of referenced) {
441
+ if (reference?.kind === 'custom' && !customPolicyNames[slot].includes(reference.name)) {
442
+ throw new Error(`CloudFront behavior names unknown custom policy "${reference.name}"!`);
443
+ }
444
+ }
445
+ for (const functionAssociation of behavior.functionAssociations ?? []) {
446
+ if (functionAssociation.kind === 'cloudfront-function' &&
447
+ !functionAssociation.eventType.startsWith('viewer-')) {
448
+ throw new Error(`A CloudFront Function cannot run on "${functionAssociation.eventType}"! Use Lambda@Edge instead.`);
449
+ }
450
+ }
451
+ }
452
+ if (this.properties.aliases.length > 0 && this.properties.viewerCertificate.kind !== 'acm') {
453
+ throw new Error('A CloudFront alias needs a certificate covering it!');
454
+ }
455
+ // CloudFront reads both of these from us-east-1 alone, wherever the origins live. Left to AWS,
456
+ // this surfaces as a failed apply rather than as anything a caller can act on.
457
+ const globalArns = [
458
+ [
459
+ 'certificate',
460
+ this.properties.viewerCertificate.kind === 'acm' ? this.properties.viewerCertificate.certificateArn : null,
461
+ ],
462
+ ['web ACL', this.properties.webAclArn],
463
+ ];
464
+ for (const [subject, arn] of globalArns) {
465
+ if (arn && arn.split(':')[3] !== CLOUD_FRONT_GLOBAL_REGION) {
466
+ throw new Error(`CloudFront only reads a ${subject} from "${CLOUD_FRONT_GLOBAL_REGION}"!`);
467
+ }
468
+ }
469
+ }
470
+ };
471
+ CloudFrontDistribution = CloudFrontDistribution_1 = __decorate([
472
+ Resource('@octo', 'cloudfront-distribution', CloudFrontDistributionSchema),
473
+ __metadata("design:paramtypes", [String, Object, Array])
474
+ ], CloudFrontDistribution);
475
+ export { CloudFrontDistribution };
476
+ /**
477
+ * @internal
478
+ */
479
+ function renderCookiesConfig(input) {
480
+ const selection = input ?? RENDER_DEFAULTS.valueSelection;
481
+ return {
482
+ cookie_behavior: cookieBehavior(selection),
483
+ ...(selection.kind === 'allowList' ? { cookies: { items: selection.values } } : {}),
484
+ };
485
+ }
486
+ /**
487
+ * @internal
488
+ */
489
+ function renderHeadersConfig(input) {
490
+ const selection = input ?? RENDER_DEFAULTS.valueSelection;
491
+ return {
492
+ header_behavior: headerBehavior(selection),
493
+ ...(selection.kind === 'allowList' ? { headers: { items: selection.values } } : {}),
494
+ };
495
+ }
496
+ /**
497
+ * @internal
498
+ */
499
+ function renderQueryStringsConfig(input) {
500
+ const selection = input ?? RENDER_DEFAULTS.valueSelection;
501
+ return {
502
+ query_string_behavior: cookieBehavior(selection),
503
+ ...(selection.kind === 'allowList' ? { query_strings: { items: selection.values } } : {}),
504
+ };
505
+ }
506
+ /**
507
+ * Cookies and query strings share a vocabulary; headers do not, because only a header selection can
508
+ * mean "everything the viewer sent".
509
+ *
510
+ * @internal
511
+ */
512
+ function cookieBehavior(selection) {
513
+ switch (selection.kind) {
514
+ case 'all':
515
+ case 'allViewerAndWhitelistCloudFront':
516
+ return 'all';
517
+ case 'allowList':
518
+ return 'whitelist';
519
+ default:
520
+ return 'none';
521
+ }
522
+ }
523
+ /**
524
+ * @internal
525
+ */
526
+ function headerBehavior(selection) {
527
+ switch (selection.kind) {
528
+ case 'all':
529
+ return 'allViewer';
530
+ case 'allViewerAndWhitelistCloudFront':
531
+ return 'allViewerAndWhitelistCloudFront';
532
+ case 'allowList':
533
+ return 'whitelist';
534
+ default:
535
+ return 'none';
536
+ }
537
+ }
538
+ /**
539
+ * @internal
540
+ */
541
+ function renderResponseHeadersPolicy(policy) {
542
+ const securityHeaders = policy.securityHeaders;
543
+ return {
544
+ ...(policy.cors
545
+ ? {
546
+ cors_config: {
547
+ access_control_allow_credentials: policy.cors.allowCredentials,
548
+ access_control_allow_headers: { items: policy.cors.allowHeaders },
549
+ access_control_allow_methods: { items: policy.cors.allowMethods },
550
+ access_control_allow_origins: { items: policy.cors.allowOrigins },
551
+ access_control_max_age_sec: policy.cors.maxAgeSeconds,
552
+ origin_override: true,
553
+ },
554
+ }
555
+ : {}),
556
+ ...((policy.customHeaders ?? []).length > 0
557
+ ? {
558
+ custom_headers_config: {
559
+ items: (policy.customHeaders ?? []).map((h) => ({
560
+ header: h.header,
561
+ override: h.override,
562
+ value: h.value,
563
+ })),
564
+ },
565
+ }
566
+ : {}),
567
+ name: policy.name,
568
+ ...((policy.removeHeaders ?? []).length > 0
569
+ ? { remove_headers_config: { items: (policy.removeHeaders ?? []).map((header) => ({ header })) } }
570
+ : {}),
571
+ ...(securityHeaders
572
+ ? {
573
+ security_headers_config: {
574
+ ...(securityHeaders.contentSecurityPolicy
575
+ ? {
576
+ content_security_policy: {
577
+ content_security_policy: securityHeaders.contentSecurityPolicy,
578
+ override: true,
579
+ },
580
+ }
581
+ : {}),
582
+ ...((securityHeaders.contentTypeOptions ?? RENDER_DEFAULTS.securityHeaders.contentTypeOptions)
583
+ ? { content_type_options: { override: true } }
584
+ : {}),
585
+ ...(securityHeaders.frameOptions === null
586
+ ? {}
587
+ : {
588
+ frame_options: {
589
+ frame_option: securityHeaders.frameOptions ?? RENDER_DEFAULTS.securityHeaders.frameOptions,
590
+ override: true,
591
+ },
592
+ }),
593
+ ...(securityHeaders.referrerPolicy
594
+ ? { referrer_policy: { override: true, referrer_policy: securityHeaders.referrerPolicy } }
595
+ : {}),
596
+ ...(securityHeaders.strictTransportSecurityMaxAge !== null
597
+ ? {
598
+ strict_transport_security: {
599
+ access_control_max_age_sec: securityHeaders.strictTransportSecurityMaxAge ??
600
+ RENDER_DEFAULTS.securityHeaders.strictTransportSecurityMaxAge,
601
+ // eslint-disable-next-line spellcheck/spell-checker
602
+ include_subdomains: true,
603
+ override: true,
604
+ preload: false,
605
+ },
606
+ }
607
+ : {}),
608
+ },
609
+ }
610
+ : {}),
611
+ };
612
+ }
613
+ //# sourceMappingURL=cloudfront-distribution.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudfront-distribution.resource.js","sourceRoot":"","sources":["../../../src/resources/cloudfront-distribution/cloudfront-distribution.resource.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACL,kBAAk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
+ export { CloudFrontDistribution } from './cloudfront-distribution.resource.js';
2
+ //# sourceMappingURL=index.js.map