@jaypie/constructs 1.2.6 → 1.2.7
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 +5 -2
- package/dist/cjs/JaypieStreamingLambda.d.ts +44 -0
- package/dist/cjs/__tests__/JaypieStreamingLambda.spec.d.ts +1 -0
- package/dist/cjs/constants.d.ts +14 -0
- package/dist/cjs/index.cjs +122 -23
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +5 -4
- package/dist/esm/JaypieDistribution.d.ts +5 -2
- package/dist/esm/JaypieStreamingLambda.d.ts +44 -0
- package/dist/esm/__tests__/JaypieStreamingLambda.spec.d.ts +1 -0
- package/dist/esm/constants.d.ts +14 -0
- package/dist/esm/index.d.ts +5 -4
- package/dist/esm/index.js +121 -24
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { CDK } from "./constants";
|
|
1
|
+
export { CDK, LAMBDA_WEB_ADAPTER } from "./constants";
|
|
2
2
|
export { JaypieAccountLoggingBucket, JaypieAccountLoggingBucketProps, } from "./JaypieAccountLoggingBucket";
|
|
3
3
|
export { JaypieApiGateway } from "./JaypieApiGateway";
|
|
4
4
|
export { JaypieAppStack } from "./JaypieAppStack";
|
|
5
5
|
export { JaypieBucketQueuedLambda } from "./JaypieBucketQueuedLambda";
|
|
6
6
|
export { JaypieDatadogBucket, JaypieDatadogBucketProps, } from "./JaypieDatadogBucket";
|
|
7
7
|
export { JaypieDatadogForwarder, JaypieDatadogForwarderProps, } from "./JaypieDatadogForwarder";
|
|
8
|
-
export { JaypieDistribution, JaypieDistributionProps, } from "./JaypieDistribution";
|
|
9
8
|
export { JaypieDatadogSecret } from "./JaypieDatadogSecret";
|
|
9
|
+
export { JaypieDistribution, JaypieDistributionProps, } from "./JaypieDistribution";
|
|
10
10
|
export { JaypieDnsRecord, JaypieDnsRecordProps } from "./JaypieDnsRecord";
|
|
11
11
|
export { JaypieDynamoDb, JaypieDynamoDbProps } from "./JaypieDynamoDb";
|
|
12
12
|
export { JaypieEnvSecret } from "./JaypieEnvSecret";
|
|
13
13
|
export { JaypieEventsRule, JaypieEventsRuleProps } from "./JaypieEventsRule";
|
|
14
|
-
export { JaypieGitHubDeployRole, JaypieGitHubDeployRoleProps, } from "./JaypieGitHubDeployRole";
|
|
15
14
|
export { JaypieExpressLambda } from "./JaypieExpressLambda";
|
|
15
|
+
export { JaypieGitHubDeployRole, JaypieGitHubDeployRoleProps, } from "./JaypieGitHubDeployRole";
|
|
16
16
|
export { JaypieHostedZone, JaypieHostedZoneRecordProps, } from "./JaypieHostedZone";
|
|
17
17
|
export { JaypieInfrastructureStack } from "./JaypieInfrastructureStack";
|
|
18
18
|
export { JaypieLambda, JaypieLambdaProps } from "./JaypieLambda";
|
|
@@ -20,11 +20,12 @@ export { JaypieMongoDbSecret } from "./JaypieMongoDbSecret";
|
|
|
20
20
|
export { DomainNameConfig, JaypieNextJs, JaypieNextjsProps, } from "./JaypieNextJs";
|
|
21
21
|
export { JaypieOpenAiSecret } from "./JaypieOpenAiSecret";
|
|
22
22
|
export { JaypieOrganizationTrail, JaypieOrganizationTrailProps, } from "./JaypieOrganizationTrail";
|
|
23
|
+
export { JaypieQueuedLambda } from "./JaypieQueuedLambda";
|
|
23
24
|
export { AccountAssignments, JaypieSsoPermissions, JaypieSsoPermissionsProps, } from "./JaypieSsoPermissions";
|
|
24
25
|
export { JaypieSsoSyncApplication, JaypieSsoSyncApplicationProps, } from "./JaypieSsoSyncApplication";
|
|
25
|
-
export { JaypieQueuedLambda } from "./JaypieQueuedLambda";
|
|
26
26
|
export { JaypieStack, JaypieStackProps } from "./JaypieStack";
|
|
27
27
|
export { JaypieStaticWebBucket, JaypieStaticWebBucketProps, } from "./JaypieStaticWebBucket";
|
|
28
|
+
export { JaypieStreamingLambda, JaypieStreamingLambdaProps, } from "./JaypieStreamingLambda";
|
|
28
29
|
export { JaypieTraceSigningKeySecret } from "./JaypieTraceSigningKeySecret";
|
|
29
30
|
export { JaypieWebDeploymentBucket } from "./JaypieWebDeploymentBucket";
|
|
30
31
|
export * from "./helpers";
|
|
@@ -35,8 +35,10 @@ export interface JaypieDistributionProps extends Omit<cloudfront.DistributionPro
|
|
|
35
35
|
*/
|
|
36
36
|
host?: string;
|
|
37
37
|
/**
|
|
38
|
-
* Invoke mode for Lambda Function URLs
|
|
39
|
-
*
|
|
38
|
+
* Invoke mode for Lambda Function URLs.
|
|
39
|
+
* If not provided, auto-detects from handler if it has an invokeMode property
|
|
40
|
+
* (e.g., JaypieStreamingLambda).
|
|
41
|
+
* @default InvokeMode.BUFFERED (or auto-detected from handler)
|
|
40
42
|
*/
|
|
41
43
|
invokeMode?: lambda.InvokeMode;
|
|
42
44
|
/**
|
|
@@ -64,6 +66,7 @@ export declare class JaypieDistribution extends Construct implements cloudfront.
|
|
|
64
66
|
private isIOrigin;
|
|
65
67
|
private isIFunctionUrl;
|
|
66
68
|
private isIFunction;
|
|
69
|
+
private hasInvokeMode;
|
|
67
70
|
get env(): {
|
|
68
71
|
account: string;
|
|
69
72
|
region: string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Construct } from "constructs";
|
|
2
|
+
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
3
|
+
import { JaypieLambda, JaypieLambdaProps } from "./JaypieLambda.js";
|
|
4
|
+
export interface JaypieStreamingLambdaProps extends JaypieLambdaProps {
|
|
5
|
+
/**
|
|
6
|
+
* The port your application listens on.
|
|
7
|
+
* @default 8000
|
|
8
|
+
*/
|
|
9
|
+
port?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Enable response streaming mode.
|
|
12
|
+
* When true, uses RESPONSE_STREAM invoke mode.
|
|
13
|
+
* When false, uses BUFFERED invoke mode.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
streaming?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A Lambda construct that uses AWS Lambda Web Adapter for streaming support.
|
|
20
|
+
* This allows running web applications (Express, Fastify, etc.) with streaming responses.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const streamingLambda = new JaypieStreamingLambda(this, "StreamingApi", {
|
|
25
|
+
* code: "dist/api",
|
|
26
|
+
* handler: "run.sh",
|
|
27
|
+
* streaming: true,
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Use with JaypieDistribution
|
|
31
|
+
* new JaypieDistribution(this, "Distribution", {
|
|
32
|
+
* handler: streamingLambda,
|
|
33
|
+
* invokeMode: streamingLambda.invokeMode,
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare class JaypieStreamingLambda extends JaypieLambda {
|
|
38
|
+
/**
|
|
39
|
+
* The invoke mode for this Lambda function.
|
|
40
|
+
* Use this when configuring JaypieDistribution.
|
|
41
|
+
*/
|
|
42
|
+
readonly invokeMode: lambda.InvokeMode;
|
|
43
|
+
constructor(scope: Construct, id: string, props: JaypieStreamingLambdaProps);
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
export declare const LAMBDA_WEB_ADAPTER: {
|
|
2
|
+
ACCOUNT: string;
|
|
3
|
+
DEFAULT_PORT: number;
|
|
4
|
+
EXEC_WRAPPER: string;
|
|
5
|
+
INVOKE_MODE: {
|
|
6
|
+
BUFFERED: string;
|
|
7
|
+
RESPONSE_STREAM: string;
|
|
8
|
+
};
|
|
9
|
+
LAYER: {
|
|
10
|
+
ARM64: string;
|
|
11
|
+
X86: string;
|
|
12
|
+
};
|
|
13
|
+
VERSION: number;
|
|
14
|
+
};
|
|
1
15
|
export declare const CDK: {
|
|
2
16
|
ACCOUNT: {
|
|
3
17
|
DEVELOPMENT: string;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { CDK } from "./constants";
|
|
1
|
+
export { CDK, LAMBDA_WEB_ADAPTER } from "./constants";
|
|
2
2
|
export { JaypieAccountLoggingBucket, JaypieAccountLoggingBucketProps, } from "./JaypieAccountLoggingBucket";
|
|
3
3
|
export { JaypieApiGateway } from "./JaypieApiGateway";
|
|
4
4
|
export { JaypieAppStack } from "./JaypieAppStack";
|
|
5
5
|
export { JaypieBucketQueuedLambda } from "./JaypieBucketQueuedLambda";
|
|
6
6
|
export { JaypieDatadogBucket, JaypieDatadogBucketProps, } from "./JaypieDatadogBucket";
|
|
7
7
|
export { JaypieDatadogForwarder, JaypieDatadogForwarderProps, } from "./JaypieDatadogForwarder";
|
|
8
|
-
export { JaypieDistribution, JaypieDistributionProps, } from "./JaypieDistribution";
|
|
9
8
|
export { JaypieDatadogSecret } from "./JaypieDatadogSecret";
|
|
9
|
+
export { JaypieDistribution, JaypieDistributionProps, } from "./JaypieDistribution";
|
|
10
10
|
export { JaypieDnsRecord, JaypieDnsRecordProps } from "./JaypieDnsRecord";
|
|
11
11
|
export { JaypieDynamoDb, JaypieDynamoDbProps } from "./JaypieDynamoDb";
|
|
12
12
|
export { JaypieEnvSecret } from "./JaypieEnvSecret";
|
|
13
13
|
export { JaypieEventsRule, JaypieEventsRuleProps } from "./JaypieEventsRule";
|
|
14
|
-
export { JaypieGitHubDeployRole, JaypieGitHubDeployRoleProps, } from "./JaypieGitHubDeployRole";
|
|
15
14
|
export { JaypieExpressLambda } from "./JaypieExpressLambda";
|
|
15
|
+
export { JaypieGitHubDeployRole, JaypieGitHubDeployRoleProps, } from "./JaypieGitHubDeployRole";
|
|
16
16
|
export { JaypieHostedZone, JaypieHostedZoneRecordProps, } from "./JaypieHostedZone";
|
|
17
17
|
export { JaypieInfrastructureStack } from "./JaypieInfrastructureStack";
|
|
18
18
|
export { JaypieLambda, JaypieLambdaProps } from "./JaypieLambda";
|
|
@@ -20,11 +20,12 @@ export { JaypieMongoDbSecret } from "./JaypieMongoDbSecret";
|
|
|
20
20
|
export { DomainNameConfig, JaypieNextJs, JaypieNextjsProps, } from "./JaypieNextJs";
|
|
21
21
|
export { JaypieOpenAiSecret } from "./JaypieOpenAiSecret";
|
|
22
22
|
export { JaypieOrganizationTrail, JaypieOrganizationTrailProps, } from "./JaypieOrganizationTrail";
|
|
23
|
+
export { JaypieQueuedLambda } from "./JaypieQueuedLambda";
|
|
23
24
|
export { AccountAssignments, JaypieSsoPermissions, JaypieSsoPermissionsProps, } from "./JaypieSsoPermissions";
|
|
24
25
|
export { JaypieSsoSyncApplication, JaypieSsoSyncApplicationProps, } from "./JaypieSsoSyncApplication";
|
|
25
|
-
export { JaypieQueuedLambda } from "./JaypieQueuedLambda";
|
|
26
26
|
export { JaypieStack, JaypieStackProps } from "./JaypieStack";
|
|
27
27
|
export { JaypieStaticWebBucket, JaypieStaticWebBucketProps, } from "./JaypieStaticWebBucket";
|
|
28
|
+
export { JaypieStreamingLambda, JaypieStreamingLambdaProps, } from "./JaypieStreamingLambda";
|
|
28
29
|
export { JaypieTraceSigningKeySecret } from "./JaypieTraceSigningKeySecret";
|
|
29
30
|
export { JaypieWebDeploymentBucket } from "./JaypieWebDeploymentBucket";
|
|
30
31
|
export * from "./helpers";
|
package/dist/esm/index.js
CHANGED
|
@@ -31,6 +31,20 @@ import { Trail, ReadWriteType } from 'aws-cdk-lib/aws-cloudtrail';
|
|
|
31
31
|
import { CfnPermissionSet, CfnAssignment } from 'aws-cdk-lib/aws-sso';
|
|
32
32
|
import { CfnApplication } from 'aws-cdk-lib/aws-sam';
|
|
33
33
|
|
|
34
|
+
const LAMBDA_WEB_ADAPTER = {
|
|
35
|
+
ACCOUNT: "753240598075",
|
|
36
|
+
DEFAULT_PORT: 8000,
|
|
37
|
+
EXEC_WRAPPER: "/opt/bootstrap",
|
|
38
|
+
INVOKE_MODE: {
|
|
39
|
+
BUFFERED: "BUFFERED",
|
|
40
|
+
RESPONSE_STREAM: "RESPONSE_STREAM",
|
|
41
|
+
},
|
|
42
|
+
LAYER: {
|
|
43
|
+
ARM64: "LambdaAdapterLayerArm64",
|
|
44
|
+
X86: "LambdaAdapterLayerX86",
|
|
45
|
+
},
|
|
46
|
+
VERSION: 25,
|
|
47
|
+
};
|
|
34
48
|
const CDK$2 = {
|
|
35
49
|
ACCOUNT: {
|
|
36
50
|
DEVELOPMENT: "development",
|
|
@@ -1962,6 +1976,18 @@ class JaypieDatadogForwarder extends Construct {
|
|
|
1962
1976
|
}
|
|
1963
1977
|
}
|
|
1964
1978
|
|
|
1979
|
+
class JaypieDatadogSecret extends JaypieEnvSecret {
|
|
1980
|
+
constructor(scope, id = "MongoConnectionString", props) {
|
|
1981
|
+
const defaultProps = {
|
|
1982
|
+
envKey: "DATADOG_API_KEY",
|
|
1983
|
+
roleTag: CDK$2.ROLE.MONITORING,
|
|
1984
|
+
vendorTag: CDK$2.VENDOR.DATADOG,
|
|
1985
|
+
...props,
|
|
1986
|
+
};
|
|
1987
|
+
super(scope, id, defaultProps);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1965
1991
|
class JaypieDistribution extends Construct {
|
|
1966
1992
|
constructor(scope, id, props) {
|
|
1967
1993
|
super(scope, id);
|
|
@@ -2007,12 +2033,19 @@ class JaypieDistribution extends Construct {
|
|
|
2007
2033
|
// IFunction before IFunctionUrl (IFunction doesn't have functionUrlId)
|
|
2008
2034
|
let origin;
|
|
2009
2035
|
if (handler) {
|
|
2036
|
+
// Auto-detect invoke mode from handler (e.g., JaypieStreamingLambda)
|
|
2037
|
+
// Explicit invokeMode prop takes precedence over auto-detection
|
|
2038
|
+
const resolvedInvokeMode = invokeMode !== lambda.InvokeMode.BUFFERED
|
|
2039
|
+
? invokeMode // Explicit non-default value, use it
|
|
2040
|
+
: this.hasInvokeMode(handler)
|
|
2041
|
+
? handler.invokeMode // Auto-detect from handler
|
|
2042
|
+
: invokeMode; // Use default BUFFERED
|
|
2010
2043
|
if (this.isIFunction(handler)) {
|
|
2011
2044
|
// Create FunctionUrl for the Lambda function
|
|
2012
2045
|
const functionUrl = new lambda.FunctionUrl(this, "FunctionUrl", {
|
|
2013
2046
|
function: handler,
|
|
2014
2047
|
authType: lambda.FunctionUrlAuthType.NONE,
|
|
2015
|
-
invokeMode,
|
|
2048
|
+
invokeMode: resolvedInvokeMode,
|
|
2016
2049
|
});
|
|
2017
2050
|
this.functionUrl = functionUrl;
|
|
2018
2051
|
origin = new origins.FunctionUrlOrigin(functionUrl);
|
|
@@ -2149,6 +2182,13 @@ class JaypieDistribution extends Construct {
|
|
|
2149
2182
|
"functionName" in handler &&
|
|
2150
2183
|
!("url" in handler));
|
|
2151
2184
|
}
|
|
2185
|
+
hasInvokeMode(handler) {
|
|
2186
|
+
// Check if handler has an invokeMode property (e.g., JaypieStreamingLambda)
|
|
2187
|
+
return (typeof handler === "object" &&
|
|
2188
|
+
handler !== null &&
|
|
2189
|
+
"invokeMode" in handler &&
|
|
2190
|
+
typeof handler.invokeMode === "string");
|
|
2191
|
+
}
|
|
2152
2192
|
// Implement IDistribution interface
|
|
2153
2193
|
get env() {
|
|
2154
2194
|
return {
|
|
@@ -2175,18 +2215,6 @@ class JaypieDistribution extends Construct {
|
|
|
2175
2215
|
}
|
|
2176
2216
|
}
|
|
2177
2217
|
|
|
2178
|
-
class JaypieDatadogSecret extends JaypieEnvSecret {
|
|
2179
|
-
constructor(scope, id = "MongoConnectionString", props) {
|
|
2180
|
-
const defaultProps = {
|
|
2181
|
-
envKey: "DATADOG_API_KEY",
|
|
2182
|
-
roleTag: CDK$2.ROLE.MONITORING,
|
|
2183
|
-
vendorTag: CDK$2.VENDOR.DATADOG,
|
|
2184
|
-
...props,
|
|
2185
|
-
};
|
|
2186
|
-
super(scope, id, defaultProps);
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
2218
|
class JaypieDnsRecord extends Construct {
|
|
2191
2219
|
constructor(scope, id, props) {
|
|
2192
2220
|
super(scope, id);
|
|
@@ -2586,6 +2614,16 @@ class JaypieEventsRule extends Construct {
|
|
|
2586
2614
|
}
|
|
2587
2615
|
}
|
|
2588
2616
|
|
|
2617
|
+
class JaypieExpressLambda extends JaypieLambda {
|
|
2618
|
+
constructor(scope, id, props) {
|
|
2619
|
+
super(scope, id, {
|
|
2620
|
+
timeout: Duration.seconds(CDK$2.DURATION.EXPRESS_API),
|
|
2621
|
+
roleTag: CDK$2.ROLE.API,
|
|
2622
|
+
...props,
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2589
2627
|
class JaypieGitHubDeployRole extends Construct {
|
|
2590
2628
|
constructor(scope, id = "GitHubDeployRole", props = {}) {
|
|
2591
2629
|
super(scope, id);
|
|
@@ -2668,16 +2706,6 @@ class JaypieGitHubDeployRole extends Construct {
|
|
|
2668
2706
|
}
|
|
2669
2707
|
}
|
|
2670
2708
|
|
|
2671
|
-
class JaypieExpressLambda extends JaypieLambda {
|
|
2672
|
-
constructor(scope, id, props) {
|
|
2673
|
-
super(scope, id, {
|
|
2674
|
-
timeout: Duration.seconds(CDK$2.DURATION.EXPRESS_API),
|
|
2675
|
-
roleTag: CDK$2.ROLE.API,
|
|
2676
|
-
...props,
|
|
2677
|
-
});
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
2709
|
const SERVICE = {
|
|
2682
2710
|
ROUTE53: "route53.amazonaws.com",
|
|
2683
2711
|
};
|
|
@@ -3722,6 +3750,75 @@ class JaypieStaticWebBucket extends JaypieWebDeploymentBucket {
|
|
|
3722
3750
|
}
|
|
3723
3751
|
}
|
|
3724
3752
|
|
|
3753
|
+
/**
|
|
3754
|
+
* A Lambda construct that uses AWS Lambda Web Adapter for streaming support.
|
|
3755
|
+
* This allows running web applications (Express, Fastify, etc.) with streaming responses.
|
|
3756
|
+
*
|
|
3757
|
+
* @example
|
|
3758
|
+
* ```typescript
|
|
3759
|
+
* const streamingLambda = new JaypieStreamingLambda(this, "StreamingApi", {
|
|
3760
|
+
* code: "dist/api",
|
|
3761
|
+
* handler: "run.sh",
|
|
3762
|
+
* streaming: true,
|
|
3763
|
+
* });
|
|
3764
|
+
*
|
|
3765
|
+
* // Use with JaypieDistribution
|
|
3766
|
+
* new JaypieDistribution(this, "Distribution", {
|
|
3767
|
+
* handler: streamingLambda,
|
|
3768
|
+
* invokeMode: streamingLambda.invokeMode,
|
|
3769
|
+
* });
|
|
3770
|
+
* ```
|
|
3771
|
+
*/
|
|
3772
|
+
class JaypieStreamingLambda extends JaypieLambda {
|
|
3773
|
+
constructor(scope, id, props) {
|
|
3774
|
+
const { architecture = lambda.Architecture.X86_64, environment: propsEnvironment, layers: propsLayers = [], port = LAMBDA_WEB_ADAPTER.DEFAULT_PORT, streaming = false, ...restProps } = props;
|
|
3775
|
+
// Determine the Lambda Web Adapter layer ARN based on architecture
|
|
3776
|
+
const region = Stack.of(scope).region;
|
|
3777
|
+
const layerArn = architecture === lambda.Architecture.ARM_64
|
|
3778
|
+
? `arn:aws:lambda:${region}:${LAMBDA_WEB_ADAPTER.ACCOUNT}:layer:${LAMBDA_WEB_ADAPTER.LAYER.ARM64}:${LAMBDA_WEB_ADAPTER.VERSION}`
|
|
3779
|
+
: `arn:aws:lambda:${region}:${LAMBDA_WEB_ADAPTER.ACCOUNT}:layer:${LAMBDA_WEB_ADAPTER.LAYER.X86}:${LAMBDA_WEB_ADAPTER.VERSION}`;
|
|
3780
|
+
// Create the Lambda Web Adapter layer
|
|
3781
|
+
const webAdapterLayer = lambda.LayerVersion.fromLayerVersionArn(scope, `${id}WebAdapterLayer`, layerArn);
|
|
3782
|
+
// Build environment variables with Lambda Web Adapter configuration
|
|
3783
|
+
const lwaInvokeMode = streaming
|
|
3784
|
+
? LAMBDA_WEB_ADAPTER.INVOKE_MODE.RESPONSE_STREAM
|
|
3785
|
+
: LAMBDA_WEB_ADAPTER.INVOKE_MODE.BUFFERED;
|
|
3786
|
+
const webAdapterEnvironment = {
|
|
3787
|
+
AWS_LAMBDA_EXEC_WRAPPER: LAMBDA_WEB_ADAPTER.EXEC_WRAPPER,
|
|
3788
|
+
AWS_LWA_INVOKE_MODE: lwaInvokeMode,
|
|
3789
|
+
PORT: String(port),
|
|
3790
|
+
};
|
|
3791
|
+
// Merge environment variables - props environment takes precedence
|
|
3792
|
+
let mergedEnvironment;
|
|
3793
|
+
if (Array.isArray(propsEnvironment)) {
|
|
3794
|
+
// Array syntax: prepend our object to the array
|
|
3795
|
+
mergedEnvironment = [webAdapterEnvironment, ...propsEnvironment];
|
|
3796
|
+
}
|
|
3797
|
+
else if (propsEnvironment && typeof propsEnvironment === "object") {
|
|
3798
|
+
// Object syntax: merge objects
|
|
3799
|
+
mergedEnvironment = {
|
|
3800
|
+
...webAdapterEnvironment,
|
|
3801
|
+
...propsEnvironment,
|
|
3802
|
+
};
|
|
3803
|
+
}
|
|
3804
|
+
else {
|
|
3805
|
+
mergedEnvironment = webAdapterEnvironment;
|
|
3806
|
+
}
|
|
3807
|
+
super(scope, id, {
|
|
3808
|
+
architecture,
|
|
3809
|
+
environment: mergedEnvironment,
|
|
3810
|
+
layers: [webAdapterLayer, ...propsLayers],
|
|
3811
|
+
roleTag: CDK$2.ROLE.API,
|
|
3812
|
+
timeout: Duration.seconds(CDK$2.DURATION.EXPRESS_API),
|
|
3813
|
+
...restProps,
|
|
3814
|
+
});
|
|
3815
|
+
// Set invoke mode for use with JaypieDistribution
|
|
3816
|
+
this.invokeMode = streaming
|
|
3817
|
+
? lambda.InvokeMode.RESPONSE_STREAM
|
|
3818
|
+
: lambda.InvokeMode.BUFFERED;
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3725
3822
|
class JaypieTraceSigningKeySecret extends JaypieEnvSecret {
|
|
3726
3823
|
constructor(scope, id = "TraceSigningKey", props) {
|
|
3727
3824
|
const defaultProps = {
|
|
@@ -3734,5 +3831,5 @@ class JaypieTraceSigningKeySecret extends JaypieEnvSecret {
|
|
|
3734
3831
|
}
|
|
3735
3832
|
}
|
|
3736
3833
|
|
|
3737
|
-
export { CDK$2 as CDK, JaypieAccountLoggingBucket, JaypieApiGateway, JaypieAppStack, JaypieBucketQueuedLambda, JaypieDatadogBucket, JaypieDatadogForwarder, JaypieDatadogSecret, JaypieDistribution, JaypieDnsRecord, JaypieDynamoDb, JaypieEnvSecret, JaypieEventsRule, JaypieExpressLambda, JaypieGitHubDeployRole, JaypieHostedZone, JaypieInfrastructureStack, JaypieLambda, JaypieMongoDbSecret, JaypieNextJs, JaypieOpenAiSecret, JaypieOrganizationTrail, JaypieQueuedLambda, JaypieSsoPermissions, JaypieSsoSyncApplication, JaypieStack, JaypieStaticWebBucket, JaypieTraceSigningKeySecret, JaypieWebDeploymentBucket, addDatadogLayers, clearAllSecretsCaches, clearSecretsCache, constructEnvName, constructStackName, constructTagger, envHostname, extendDatadogRole, isEnv, isProductionEnv, isSandboxEnv, isValidHostname$1 as isValidHostname, isValidSubdomain, jaypieLambdaEnv, mergeDomain, resolveDatadogForwarderFunction, resolveDatadogLayers, resolveDatadogLoggingDestination, resolveEnvironment, resolveHostedZone, resolveParamsAndSecrets, resolveSecrets };
|
|
3834
|
+
export { CDK$2 as CDK, JaypieAccountLoggingBucket, JaypieApiGateway, JaypieAppStack, JaypieBucketQueuedLambda, JaypieDatadogBucket, JaypieDatadogForwarder, JaypieDatadogSecret, JaypieDistribution, JaypieDnsRecord, JaypieDynamoDb, JaypieEnvSecret, JaypieEventsRule, JaypieExpressLambda, JaypieGitHubDeployRole, JaypieHostedZone, JaypieInfrastructureStack, JaypieLambda, JaypieMongoDbSecret, JaypieNextJs, JaypieOpenAiSecret, JaypieOrganizationTrail, JaypieQueuedLambda, JaypieSsoPermissions, JaypieSsoSyncApplication, JaypieStack, JaypieStaticWebBucket, JaypieStreamingLambda, JaypieTraceSigningKeySecret, JaypieWebDeploymentBucket, LAMBDA_WEB_ADAPTER, addDatadogLayers, clearAllSecretsCaches, clearSecretsCache, constructEnvName, constructStackName, constructTagger, envHostname, extendDatadogRole, isEnv, isProductionEnv, isSandboxEnv, isValidHostname$1 as isValidHostname, isValidSubdomain, jaypieLambdaEnv, mergeDomain, resolveDatadogForwarderFunction, resolveDatadogLayers, resolveDatadogLoggingDestination, resolveEnvironment, resolveHostedZone, resolveParamsAndSecrets, resolveSecrets };
|
|
3738
3835
|
//# sourceMappingURL=index.js.map
|