@jaypie/constructs 1.2.7 → 1.2.8
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/JaypieDistribution.d.ts +8 -1
- package/dist/cjs/constants.d.ts +1 -0
- package/dist/cjs/index.cjs +8 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/JaypieDistribution.d.ts +8 -1
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/index.js +8 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RemovalPolicy, Stack } from "aws-cdk-lib";
|
|
1
|
+
import { Duration, RemovalPolicy, Stack } from "aws-cdk-lib";
|
|
2
2
|
import * as acm from "aws-cdk-lib/aws-certificatemanager";
|
|
3
3
|
import * as cloudfront from "aws-cdk-lib/aws-cloudfront";
|
|
4
4
|
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
@@ -41,6 +41,13 @@ export interface JaypieDistributionProps extends Omit<cloudfront.DistributionPro
|
|
|
41
41
|
* @default InvokeMode.BUFFERED (or auto-detected from handler)
|
|
42
42
|
*/
|
|
43
43
|
invokeMode?: lambda.InvokeMode;
|
|
44
|
+
/**
|
|
45
|
+
* Origin read timeout - how long CloudFront waits for a response from the origin.
|
|
46
|
+
* This is the maximum time allowed for the origin to respond.
|
|
47
|
+
* @default CDK.DURATION.CLOUDFRONT_API (180 seconds)
|
|
48
|
+
* @max Duration.seconds(180)
|
|
49
|
+
*/
|
|
50
|
+
originReadTimeout?: Duration;
|
|
44
51
|
/**
|
|
45
52
|
* Role tag for tagging resources
|
|
46
53
|
* @default CDK.ROLE.HOSTING
|
package/dist/cjs/constants.d.ts
CHANGED
package/dist/cjs/index.cjs
CHANGED
|
@@ -135,6 +135,7 @@ const CDK$2 = {
|
|
|
135
135
|
},
|
|
136
136
|
DURATION: {
|
|
137
137
|
EXPRESS_API: 30,
|
|
138
|
+
CLOUDFRONT_API: 180,
|
|
138
139
|
LAMBDA_MAXIMUM: 900,
|
|
139
140
|
LAMBDA_WORKER: 900,
|
|
140
141
|
},
|
|
@@ -2023,7 +2024,7 @@ class JaypieDatadogSecret extends JaypieEnvSecret {
|
|
|
2023
2024
|
class JaypieDistribution extends constructs.Construct {
|
|
2024
2025
|
constructor(scope, id, props) {
|
|
2025
2026
|
super(scope, id);
|
|
2026
|
-
const { certificate: certificateProp = true, defaultBehavior: propsDefaultBehavior, destination: destinationProp = true, handler, host: propsHost, invokeMode = lambda__namespace.InvokeMode.BUFFERED, roleTag = CDK$2.ROLE.API, zone: propsZone, ...distributionProps } = props;
|
|
2027
|
+
const { certificate: certificateProp = true, defaultBehavior: propsDefaultBehavior, destination: destinationProp = true, handler, host: propsHost, invokeMode = lambda__namespace.InvokeMode.BUFFERED, originReadTimeout = cdk.Duration.seconds(CDK$2.DURATION.CLOUDFRONT_API), roleTag = CDK$2.ROLE.API, zone: propsZone, ...distributionProps } = props;
|
|
2027
2028
|
// Validate environment variables
|
|
2028
2029
|
if (process.env.CDK_ENV_API_SUBDOMAIN &&
|
|
2029
2030
|
!isValidSubdomain(process.env.CDK_ENV_API_SUBDOMAIN)) {
|
|
@@ -2080,10 +2081,14 @@ class JaypieDistribution extends constructs.Construct {
|
|
|
2080
2081
|
invokeMode: resolvedInvokeMode,
|
|
2081
2082
|
});
|
|
2082
2083
|
this.functionUrl = functionUrl;
|
|
2083
|
-
origin = new origins__namespace.FunctionUrlOrigin(functionUrl
|
|
2084
|
+
origin = new origins__namespace.FunctionUrlOrigin(functionUrl, {
|
|
2085
|
+
readTimeout: originReadTimeout,
|
|
2086
|
+
});
|
|
2084
2087
|
}
|
|
2085
2088
|
else if (this.isIFunctionUrl(handler)) {
|
|
2086
|
-
origin = new origins__namespace.FunctionUrlOrigin(handler
|
|
2089
|
+
origin = new origins__namespace.FunctionUrlOrigin(handler, {
|
|
2090
|
+
readTimeout: originReadTimeout,
|
|
2091
|
+
});
|
|
2087
2092
|
}
|
|
2088
2093
|
else if (this.isIOrigin(handler)) {
|
|
2089
2094
|
origin = handler;
|