@jaypie/constructs 1.1.62 → 1.1.63
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/cjs/JaypieStaticWebBucket.d.ts +22 -0
- package/dist/cjs/JaypieWebDeploymentBucket.d.ts +2 -1
- package/dist/cjs/__tests__/JaypieStaticWebBucket.spec.d.ts +1 -0
- package/dist/cjs/index.cjs +58 -16
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/esm/JaypieStaticWebBucket.d.ts +22 -0
- package/dist/esm/JaypieWebDeploymentBucket.d.ts +2 -1
- package/dist/esm/__tests__/JaypieStaticWebBucket.spec.d.ts +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +58 -17
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Construct } from "constructs";
|
|
2
|
+
import { JaypieWebDeploymentBucket, JaypieWebDeploymentBucketProps } from "./JaypieWebDeploymentBucket";
|
|
3
|
+
export interface JaypieStaticWebBucketProps extends Omit<JaypieWebDeploymentBucketProps, "host" | "name" | "roleTag"> {
|
|
4
|
+
/**
|
|
5
|
+
* The domain name for the website
|
|
6
|
+
* @default envHostname({ subdomain: "static" })
|
|
7
|
+
*/
|
|
8
|
+
host?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional bucket name
|
|
11
|
+
* @default constructEnvName("static")
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Role tag for tagging resources
|
|
16
|
+
* @default CDK.ROLE.HOSTING
|
|
17
|
+
*/
|
|
18
|
+
roleTag?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class JaypieStaticWebBucket extends JaypieWebDeploymentBucket {
|
|
21
|
+
constructor(scope: Construct, id?: string | JaypieStaticWebBucketProps, props?: JaypieStaticWebBucketProps);
|
|
22
|
+
}
|
|
@@ -6,6 +6,7 @@ import * as route53 from "aws-cdk-lib/aws-route53";
|
|
|
6
6
|
import * as s3 from "aws-cdk-lib/aws-s3";
|
|
7
7
|
import * as kms from "aws-cdk-lib/aws-kms";
|
|
8
8
|
import { Construct } from "constructs";
|
|
9
|
+
import { JaypieHostedZone } from "./JaypieHostedZone";
|
|
9
10
|
export interface JaypieWebDeploymentBucketProps extends s3.BucketProps {
|
|
10
11
|
/**
|
|
11
12
|
* SSL certificate for the CloudFront distribution
|
|
@@ -30,7 +31,7 @@ export interface JaypieWebDeploymentBucketProps extends s3.BucketProps {
|
|
|
30
31
|
* The hosted zone for DNS records
|
|
31
32
|
* @default CDK_ENV_WEB_HOSTED_ZONE || CDK_ENV_HOSTED_ZONE
|
|
32
33
|
*/
|
|
33
|
-
zone?: string | route53.IHostedZone;
|
|
34
|
+
zone?: string | route53.IHostedZone | JaypieHostedZone;
|
|
34
35
|
}
|
|
35
36
|
export declare class JaypieWebDeploymentBucket extends Construct implements s3.IBucket {
|
|
36
37
|
readonly bucket: s3.Bucket;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2963,18 +2963,6 @@ class JaypieSsoSyncApplication extends constructs.Construct {
|
|
|
2963
2963
|
}
|
|
2964
2964
|
}
|
|
2965
2965
|
|
|
2966
|
-
class JaypieTraceSigningKeySecret extends JaypieEnvSecret {
|
|
2967
|
-
constructor(scope, id = "TraceSigningKey", props) {
|
|
2968
|
-
const defaultProps = {
|
|
2969
|
-
envKey: "TRACE_SIGNING_KEY",
|
|
2970
|
-
roleTag: CDK$2.ROLE.API,
|
|
2971
|
-
vendorTag: CDK$2.VENDOR.KNOWTRACE,
|
|
2972
|
-
...props,
|
|
2973
|
-
};
|
|
2974
|
-
super(scope, id, defaultProps);
|
|
2975
|
-
}
|
|
2976
|
-
}
|
|
2977
|
-
|
|
2978
2966
|
class JaypieWebDeploymentBucket extends constructs.Construct {
|
|
2979
2967
|
constructor(scope, id, props = {}) {
|
|
2980
2968
|
super(scope, id);
|
|
@@ -3087,11 +3075,18 @@ class JaypieWebDeploymentBucket extends constructs.Construct {
|
|
|
3087
3075
|
}
|
|
3088
3076
|
// Create CloudFront distribution and certificate if host and zone are provided
|
|
3089
3077
|
if (host && zone) {
|
|
3090
|
-
|
|
3091
|
-
|
|
3078
|
+
let hostedZone;
|
|
3079
|
+
if (typeof zone === "string") {
|
|
3080
|
+
hostedZone = route53__namespace.HostedZone.fromLookup(this, "HostedZone", {
|
|
3092
3081
|
domainName: zone,
|
|
3093
|
-
})
|
|
3094
|
-
|
|
3082
|
+
});
|
|
3083
|
+
}
|
|
3084
|
+
else if (zone instanceof JaypieHostedZone) {
|
|
3085
|
+
hostedZone = zone.hostedZone;
|
|
3086
|
+
}
|
|
3087
|
+
else {
|
|
3088
|
+
hostedZone = zone;
|
|
3089
|
+
}
|
|
3095
3090
|
// Create certificate if not provided
|
|
3096
3091
|
if (props.certificate !== false) {
|
|
3097
3092
|
this.certificate =
|
|
@@ -3232,6 +3227,52 @@ class JaypieWebDeploymentBucket extends constructs.Construct {
|
|
|
3232
3227
|
}
|
|
3233
3228
|
}
|
|
3234
3229
|
|
|
3230
|
+
class JaypieStaticWebBucket extends JaypieWebDeploymentBucket {
|
|
3231
|
+
constructor(scope, id, props = {}) {
|
|
3232
|
+
// Handle overloaded signatures: (scope), (scope, props), (scope, id, props)
|
|
3233
|
+
let resolvedId;
|
|
3234
|
+
let resolvedProps;
|
|
3235
|
+
if (typeof id === "string") {
|
|
3236
|
+
resolvedId = id;
|
|
3237
|
+
resolvedProps = props;
|
|
3238
|
+
}
|
|
3239
|
+
else if (typeof id === "object") {
|
|
3240
|
+
resolvedId = "JaypieStaticWebBucket";
|
|
3241
|
+
resolvedProps = id;
|
|
3242
|
+
}
|
|
3243
|
+
else {
|
|
3244
|
+
resolvedId = "JaypieStaticWebBucket";
|
|
3245
|
+
resolvedProps = props;
|
|
3246
|
+
}
|
|
3247
|
+
const host = resolvedProps.host ?? envHostname({ subdomain: "static" });
|
|
3248
|
+
const name = resolvedProps.name ?? constructEnvName("static");
|
|
3249
|
+
const roleTag = resolvedProps.roleTag ?? CDK$2.ROLE.HOSTING;
|
|
3250
|
+
// Only use default zone if zone is not explicitly provided (including undefined)
|
|
3251
|
+
const zone = "zone" in resolvedProps
|
|
3252
|
+
? resolvedProps.zone
|
|
3253
|
+
: process.env.CDK_ENV_DOMAIN || process.env.CDK_ENV_HOSTED_ZONE;
|
|
3254
|
+
super(scope, resolvedId, {
|
|
3255
|
+
...resolvedProps,
|
|
3256
|
+
host,
|
|
3257
|
+
name,
|
|
3258
|
+
roleTag,
|
|
3259
|
+
zone,
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
class JaypieTraceSigningKeySecret extends JaypieEnvSecret {
|
|
3265
|
+
constructor(scope, id = "TraceSigningKey", props) {
|
|
3266
|
+
const defaultProps = {
|
|
3267
|
+
envKey: "TRACE_SIGNING_KEY",
|
|
3268
|
+
roleTag: CDK$2.ROLE.API,
|
|
3269
|
+
vendorTag: CDK$2.VENDOR.KNOWTRACE,
|
|
3270
|
+
...props,
|
|
3271
|
+
};
|
|
3272
|
+
super(scope, id, defaultProps);
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3235
3276
|
exports.CDK = CDK$2;
|
|
3236
3277
|
exports.JaypieAccountLoggingBucket = JaypieAccountLoggingBucket;
|
|
3237
3278
|
exports.JaypieApiGateway = JaypieApiGateway;
|
|
@@ -3257,6 +3298,7 @@ exports.JaypieQueuedLambda = JaypieQueuedLambda;
|
|
|
3257
3298
|
exports.JaypieSsoPermissions = JaypieSsoPermissions;
|
|
3258
3299
|
exports.JaypieSsoSyncApplication = JaypieSsoSyncApplication;
|
|
3259
3300
|
exports.JaypieStack = JaypieStack;
|
|
3301
|
+
exports.JaypieStaticWebBucket = JaypieStaticWebBucket;
|
|
3260
3302
|
exports.JaypieTraceSigningKeySecret = JaypieTraceSigningKeySecret;
|
|
3261
3303
|
exports.JaypieWebDeploymentBucket = JaypieWebDeploymentBucket;
|
|
3262
3304
|
exports.addDatadogLayers = addDatadogLayers;
|