@composurecdk/cloudfront 0.1.2
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/defaults.d.ts +12 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +56 -0
- package/dist/defaults.js.map +1 -0
- package/dist/distribution-builder.d.ts +128 -0
- package/dist/distribution-builder.d.ts.map +1 -0
- package/dist/distribution-builder.js +90 -0
- package/dist/distribution-builder.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DistributionBuilderProps } from "./distribution-builder.js";
|
|
2
|
+
/**
|
|
3
|
+
* Secure, AWS-recommended defaults applied to every CloudFront distribution
|
|
4
|
+
* built with {@link createDistributionBuilder}. Each property can be individually
|
|
5
|
+
* overridden via the builder's fluent API.
|
|
6
|
+
*
|
|
7
|
+
* The `defaultBehavior` defaults (viewer protocol policy, response headers
|
|
8
|
+
* policy) are deep-merged with user-provided behavior options in `build()`,
|
|
9
|
+
* then the resolved origin is injected.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DISTRIBUTION_DEFAULTS: Partial<DistributionBuilderProps>;
|
|
12
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,wBAAwB,CAkDnE,CAAC"}
|
package/dist/defaults.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { HttpVersion, PriceClass, ResponseHeadersPolicy, SecurityPolicyProtocol, ViewerProtocolPolicy, } from "aws-cdk-lib/aws-cloudfront";
|
|
2
|
+
/**
|
|
3
|
+
* Secure, AWS-recommended defaults applied to every CloudFront distribution
|
|
4
|
+
* built with {@link createDistributionBuilder}. Each property can be individually
|
|
5
|
+
* overridden via the builder's fluent API.
|
|
6
|
+
*
|
|
7
|
+
* The `defaultBehavior` defaults (viewer protocol policy, response headers
|
|
8
|
+
* policy) are deep-merged with user-provided behavior options in `build()`,
|
|
9
|
+
* then the resolved origin is injected.
|
|
10
|
+
*/
|
|
11
|
+
export const DISTRIBUTION_DEFAULTS = {
|
|
12
|
+
/**
|
|
13
|
+
* Automatically create an S3 logging bucket for CloudFront standard access logs.
|
|
14
|
+
* Access logging provides an audit trail of all viewer requests for security
|
|
15
|
+
* monitoring and troubleshooting.
|
|
16
|
+
* @see https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/sec_detect_investigate_events_app_service_logging.html
|
|
17
|
+
*/
|
|
18
|
+
accessLogging: true,
|
|
19
|
+
/**
|
|
20
|
+
* Use the cheapest price class — edge locations in North America and Europe.
|
|
21
|
+
* Sufficient for most small websites and avoids costs from global edge locations.
|
|
22
|
+
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html
|
|
23
|
+
*/
|
|
24
|
+
priceClass: PriceClass.PRICE_CLASS_100,
|
|
25
|
+
/**
|
|
26
|
+
* Enable HTTP/2 and HTTP/3 (QUIC) for improved performance. HTTP/3 is
|
|
27
|
+
* backwards-compatible — viewers that don't support it fall back to HTTP/2.
|
|
28
|
+
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesSupportedHTTPVersions
|
|
29
|
+
*/
|
|
30
|
+
httpVersion: HttpVersion.HTTP2_AND_3,
|
|
31
|
+
/**
|
|
32
|
+
* Serve index.html for the root path.
|
|
33
|
+
* Standard for static website hosting.
|
|
34
|
+
*/
|
|
35
|
+
defaultRootObject: "index.html",
|
|
36
|
+
/**
|
|
37
|
+
* Require TLS 1.2 (2021 policy) as the minimum protocol version.
|
|
38
|
+
* Prevents negotiation of older, less secure TLS versions.
|
|
39
|
+
* @see https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/protecting-data-in-transit.html
|
|
40
|
+
*/
|
|
41
|
+
minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
42
|
+
defaultBehavior: {
|
|
43
|
+
/**
|
|
44
|
+
* Redirect HTTP to HTTPS — ensures all viewer traffic is encrypted in transit.
|
|
45
|
+
* @see https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/protecting-data-in-transit.html
|
|
46
|
+
*/
|
|
47
|
+
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
48
|
+
/**
|
|
49
|
+
* Apply the managed security headers policy (HSTS, X-Content-Type-Options,
|
|
50
|
+
* X-Frame-Options, etc.).
|
|
51
|
+
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html
|
|
52
|
+
*/
|
|
53
|
+
responseHeadersPolicy: ResponseHeadersPolicy.SECURITY_HEADERS,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsC;IACtE;;;;;OAKG;IACH,aAAa,EAAE,IAAI;IAEnB;;;;OAIG;IACH,UAAU,EAAE,UAAU,CAAC,eAAe;IAEtC;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW;IAEpC;;;OAGG;IACH,iBAAiB,EAAE,YAAY;IAE/B;;;;OAIG;IACH,sBAAsB,EAAE,sBAAsB,CAAC,aAAa;IAE5D,eAAe,EAAE;QACf;;;WAGG;QACH,oBAAoB,EAAE,oBAAoB,CAAC,iBAAiB;QAE5D;;;;WAIG;QACH,qBAAqB,EAAE,qBAAqB,CAAC,gBAAgB;KAC9D;CACF,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Distribution, type DistributionProps, type IOrigin, type AddBehaviorOptions } from "aws-cdk-lib/aws-cloudfront";
|
|
2
|
+
import { type Bucket } from "aws-cdk-lib/aws-s3";
|
|
3
|
+
import { type IConstruct } from "constructs";
|
|
4
|
+
import { type IBuilder, type Lifecycle, type Resolvable } from "@composurecdk/core";
|
|
5
|
+
/**
|
|
6
|
+
* Configuration properties for the CloudFront distribution builder.
|
|
7
|
+
*
|
|
8
|
+
* Extends the CDK {@link DistributionProps} with additional builder-specific
|
|
9
|
+
* options. The `defaultBehavior` field is replaced with {@link AddBehaviorOptions}
|
|
10
|
+
* (which excludes `origin`) because the origin is set separately via the
|
|
11
|
+
* {@link IDistributionBuilder.origin | origin()} method, which supports
|
|
12
|
+
* {@link Resolvable} for cross-component wiring.
|
|
13
|
+
*
|
|
14
|
+
* The `enableLogging` CDK prop is replaced by {@link accessLogging}, which
|
|
15
|
+
* auto-creates a logging bucket with secure defaults when enabled.
|
|
16
|
+
*/
|
|
17
|
+
export interface DistributionBuilderProps extends Omit<DistributionProps, "defaultBehavior" | "enableLogging"> {
|
|
18
|
+
/**
|
|
19
|
+
* Whether to automatically create an S3 bucket for CloudFront standard
|
|
20
|
+
* access logging.
|
|
21
|
+
*
|
|
22
|
+
* When `true`, the builder creates a logging bucket using
|
|
23
|
+
* {@link createBucketBuilder} (with its secure defaults) and configures it
|
|
24
|
+
* as the distribution's log destination. The created bucket is returned in
|
|
25
|
+
* the build result as `accessLogsBucket`.
|
|
26
|
+
*
|
|
27
|
+
* When `false`, no logging bucket is created. You can still provide your
|
|
28
|
+
* own bucket via `logBucket`.
|
|
29
|
+
*
|
|
30
|
+
* This setting is ignored when `logBucket` is provided — the user-supplied
|
|
31
|
+
* bucket takes precedence.
|
|
32
|
+
*/
|
|
33
|
+
accessLogging?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Options for the default cache behavior, excluding `origin`.
|
|
36
|
+
*
|
|
37
|
+
* The origin is set via the {@link IDistributionBuilder.origin | origin()}
|
|
38
|
+
* method and injected at build time. All other behavior options (cache
|
|
39
|
+
* policy, function associations, viewer protocol policy, etc.) can be
|
|
40
|
+
* configured here.
|
|
41
|
+
*/
|
|
42
|
+
defaultBehavior?: AddBehaviorOptions;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The build output of a {@link IDistributionBuilder}. Contains the CDK constructs
|
|
46
|
+
* created during {@link Lifecycle.build}, keyed by role.
|
|
47
|
+
*/
|
|
48
|
+
export interface DistributionBuilderResult {
|
|
49
|
+
/** The CloudFront distribution construct created by the builder. */
|
|
50
|
+
distribution: Distribution;
|
|
51
|
+
/**
|
|
52
|
+
* The S3 bucket created for access logging, or `undefined` if access
|
|
53
|
+
* logging was disabled or the user provided their own bucket.
|
|
54
|
+
*/
|
|
55
|
+
accessLogsBucket?: Bucket;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A fluent builder for configuring and creating a CloudFront distribution.
|
|
59
|
+
*
|
|
60
|
+
* Configuration properties from CDK {@link DistributionProps} are exposed as
|
|
61
|
+
* overloaded getter/setter methods via the builder proxy. The origin is set
|
|
62
|
+
* via the {@link origin} method, which accepts a concrete {@link IOrigin} or
|
|
63
|
+
* a {@link Ref} for cross-component wiring.
|
|
64
|
+
*
|
|
65
|
+
* The builder implements {@link Lifecycle}, so it can be used directly as a
|
|
66
|
+
* component in a {@link compose | composed system}. When built, it creates
|
|
67
|
+
* a CloudFront distribution with the configured properties and returns a
|
|
68
|
+
* {@link DistributionBuilderResult}.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const cdn = createDistributionBuilder()
|
|
73
|
+
* .origin(ref("site", (r: BucketBuilderResult) =>
|
|
74
|
+
* S3BucketOrigin.withOriginAccessControl(r.bucket)))
|
|
75
|
+
* .errorResponses([{
|
|
76
|
+
* httpStatus: 404,
|
|
77
|
+
* responsePagePath: "/index.html",
|
|
78
|
+
* responseHttpStatus: 200,
|
|
79
|
+
* }]);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export type IDistributionBuilder = IBuilder<DistributionBuilderProps, DistributionBuilder>;
|
|
83
|
+
declare class DistributionBuilder implements Lifecycle<DistributionBuilderResult> {
|
|
84
|
+
props: Partial<DistributionBuilderProps>;
|
|
85
|
+
private _origin?;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the default origin for the distribution.
|
|
88
|
+
*
|
|
89
|
+
* Accepts a concrete {@link IOrigin} or a {@link Ref} that resolves to one
|
|
90
|
+
* at build time — enabling cross-component wiring with S3 buckets.
|
|
91
|
+
*
|
|
92
|
+
* @param origin - The origin or a Ref to one.
|
|
93
|
+
* @returns This builder for chaining.
|
|
94
|
+
*/
|
|
95
|
+
origin(origin: Resolvable<IOrigin>): this;
|
|
96
|
+
build(scope: IConstruct, id: string, context?: Record<string, object>): DistributionBuilderResult;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Creates a new {@link IDistributionBuilder} for configuring a CloudFront distribution.
|
|
100
|
+
*
|
|
101
|
+
* This is the entry point for defining a CloudFront distribution component.
|
|
102
|
+
* The returned builder exposes every {@link DistributionBuilderProps} property
|
|
103
|
+
* as a fluent setter/getter, plus {@link IDistributionBuilder.origin | origin()}
|
|
104
|
+
* for setting the default origin with Ref support. It implements {@link Lifecycle}
|
|
105
|
+
* for use with {@link compose}.
|
|
106
|
+
*
|
|
107
|
+
* @returns A fluent builder for a CloudFront distribution.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const cdn = createDistributionBuilder()
|
|
112
|
+
* .origin(ref("site", (r: BucketBuilderResult) =>
|
|
113
|
+
* S3BucketOrigin.withOriginAccessControl(r.bucket)))
|
|
114
|
+
* .comment("Community website CDN");
|
|
115
|
+
*
|
|
116
|
+
* // Use standalone:
|
|
117
|
+
* const result = cdn.build(stack, "CDN");
|
|
118
|
+
*
|
|
119
|
+
* // Or compose into a system:
|
|
120
|
+
* const system = compose(
|
|
121
|
+
* { site: createBucketBuilder(), cdn },
|
|
122
|
+
* { site: [], cdn: ["site"] },
|
|
123
|
+
* );
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function createDistributionBuilder(): IDistributionBuilder;
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=distribution-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distribution-builder.d.ts","sourceRoot":"","sources":["../src/distribution-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,iBAAiB,EACjB,iBAAiB,GAAG,eAAe,CACpC;IACC;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,YAAY,EAAE,YAAY,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC;AAE3F,cAAM,mBAAoB,YAAW,SAAS,CAAC,yBAAyB,CAAC;IACvE,KAAK,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAM;IAC9C,OAAO,CAAC,OAAO,CAAC,CAAsB;IAEtC;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI;IAKzC,KAAK,CACH,KAAK,EAAE,UAAU,EACjB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,yBAAyB;CAgD7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,yBAAyB,IAAI,oBAAoB,CAEhE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Distribution, } from "aws-cdk-lib/aws-cloudfront";
|
|
2
|
+
import { RemovalPolicy } from "aws-cdk-lib";
|
|
3
|
+
import { Builder, resolve, } from "@composurecdk/core";
|
|
4
|
+
import { createBucketBuilder } from "@composurecdk/s3";
|
|
5
|
+
import { DISTRIBUTION_DEFAULTS } from "./defaults.js";
|
|
6
|
+
class DistributionBuilder {
|
|
7
|
+
props = {};
|
|
8
|
+
_origin;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the default origin for the distribution.
|
|
11
|
+
*
|
|
12
|
+
* Accepts a concrete {@link IOrigin} or a {@link Ref} that resolves to one
|
|
13
|
+
* at build time — enabling cross-component wiring with S3 buckets.
|
|
14
|
+
*
|
|
15
|
+
* @param origin - The origin or a Ref to one.
|
|
16
|
+
* @returns This builder for chaining.
|
|
17
|
+
*/
|
|
18
|
+
origin(origin) {
|
|
19
|
+
this._origin = origin;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
build(scope, id, context) {
|
|
23
|
+
const resolvedOrigin = this._origin ? resolve(this._origin, context ?? {}) : undefined;
|
|
24
|
+
if (!resolvedOrigin) {
|
|
25
|
+
throw new Error(`DistributionBuilder "${id}" requires an origin. ` +
|
|
26
|
+
`Call .origin() with an IOrigin or a Ref to one.`);
|
|
27
|
+
}
|
|
28
|
+
const { accessLogging, defaultBehavior: userBehavior, ...distProps } = this.props;
|
|
29
|
+
const { accessLogging: defaultAccessLogging, defaultBehavior: defaultBehavior, ...cdkDefaults } = DISTRIBUTION_DEFAULTS;
|
|
30
|
+
const autoAccessLog = (accessLogging ?? defaultAccessLogging) && !distProps.logBucket;
|
|
31
|
+
let accessLogsBucket;
|
|
32
|
+
let accessLogProps = {};
|
|
33
|
+
if (autoAccessLog) {
|
|
34
|
+
accessLogsBucket = createBucketBuilder()
|
|
35
|
+
.accessLogging(false)
|
|
36
|
+
.removalPolicy(RemovalPolicy.RETAIN)
|
|
37
|
+
.build(scope, `${id}AccessLogs`).bucket;
|
|
38
|
+
accessLogProps = {
|
|
39
|
+
enableLogging: true,
|
|
40
|
+
logBucket: accessLogsBucket,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const mergedProps = {
|
|
44
|
+
...cdkDefaults,
|
|
45
|
+
...accessLogProps,
|
|
46
|
+
...distProps,
|
|
47
|
+
defaultBehavior: {
|
|
48
|
+
...defaultBehavior,
|
|
49
|
+
...userBehavior,
|
|
50
|
+
origin: resolvedOrigin,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
distribution: new Distribution(scope, id, mergedProps),
|
|
55
|
+
accessLogsBucket,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a new {@link IDistributionBuilder} for configuring a CloudFront distribution.
|
|
61
|
+
*
|
|
62
|
+
* This is the entry point for defining a CloudFront distribution component.
|
|
63
|
+
* The returned builder exposes every {@link DistributionBuilderProps} property
|
|
64
|
+
* as a fluent setter/getter, plus {@link IDistributionBuilder.origin | origin()}
|
|
65
|
+
* for setting the default origin with Ref support. It implements {@link Lifecycle}
|
|
66
|
+
* for use with {@link compose}.
|
|
67
|
+
*
|
|
68
|
+
* @returns A fluent builder for a CloudFront distribution.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const cdn = createDistributionBuilder()
|
|
73
|
+
* .origin(ref("site", (r: BucketBuilderResult) =>
|
|
74
|
+
* S3BucketOrigin.withOriginAccessControl(r.bucket)))
|
|
75
|
+
* .comment("Community website CDN");
|
|
76
|
+
*
|
|
77
|
+
* // Use standalone:
|
|
78
|
+
* const result = cdn.build(stack, "CDN");
|
|
79
|
+
*
|
|
80
|
+
* // Or compose into a system:
|
|
81
|
+
* const system = compose(
|
|
82
|
+
* { site: createBucketBuilder(), cdn },
|
|
83
|
+
* { site: [], cdn: ["site"] },
|
|
84
|
+
* );
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export function createDistributionBuilder() {
|
|
88
|
+
return Builder(DistributionBuilder);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=distribution-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distribution-builder.js","sourceRoot":"","sources":["../src/distribution-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAIb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAwFtD,MAAM,mBAAmB;IACvB,KAAK,GAAsC,EAAE,CAAC;IACtC,OAAO,CAAuB;IAEtC;;;;;;;;OAQG;IACH,MAAM,CAAC,MAA2B;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CACH,KAAiB,EACjB,EAAU,EACV,OAAgC;QAEhC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEvF,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,wBAAwB,EAAE,wBAAwB;gBAChD,iDAAiD,CACpD,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAClF,MAAM,EACJ,aAAa,EAAE,oBAAoB,EACnC,eAAe,EAAE,eAAe,EAChC,GAAG,WAAW,EACf,GAAG,qBAAqB,CAAC;QAC1B,MAAM,aAAa,GAAG,CAAC,aAAa,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;QAEtF,IAAI,gBAAoC,CAAC;QACzC,IAAI,cAAc,GAAG,EAAE,CAAC;QAExB,IAAI,aAAa,EAAE,CAAC;YAClB,gBAAgB,GAAG,mBAAmB,EAAE;iBACrC,aAAa,CAAC,KAAK,CAAC;iBACpB,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC;iBACnC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC;YAC1C,cAAc,GAAG;gBACf,aAAa,EAAE,IAAI;gBACnB,SAAS,EAAE,gBAAgB;aAC5B,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG;YAClB,GAAG,WAAW;YACd,GAAG,cAAc;YACjB,GAAG,SAAS;YACZ,eAAe,EAAE;gBACf,GAAG,eAAe;gBAClB,GAAG,YAAY;gBACf,MAAM,EAAE,cAAc;aACvB;SACmB,CAAC;QAEvB,OAAO;YACL,YAAY,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC;YACtD,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,OAAO,CAAgD,mBAAmB,CAAC,CAAC;AACrF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@composurecdk/cloudfront",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Composable CloudFront distribution builder with well-architected defaults",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/laazyj/composureCDK",
|
|
8
|
+
"directory": "packages/cloudfront"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"build": "tsc -p tsconfig.build.json",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"test": "vitest run --passWithNoTests",
|
|
28
|
+
"test:watch": "vitest"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [],
|
|
31
|
+
"author": "Jason Duffett (https://github.com/laazyj)",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"type": "module",
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@composurecdk/core": "^0.1.0",
|
|
39
|
+
"@composurecdk/s3": "^0.1.0",
|
|
40
|
+
"aws-cdk-lib": "^2.0.0",
|
|
41
|
+
"constructs": "^10.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^25.5.0",
|
|
45
|
+
"aws-cdk-lib": "^2.245.0",
|
|
46
|
+
"constructs": "^10.6.0",
|
|
47
|
+
"typescript": "^6.0.2",
|
|
48
|
+
"vitest": "^4.1.2"
|
|
49
|
+
}
|
|
50
|
+
}
|