@gradientedge/cdk-utils-aws 2.5.0 → 2.7.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.
- package/dist/src/construct/api-to-any-target/main.d.ts +11 -0
- package/dist/src/construct/api-to-any-target/main.js +11 -2
- package/dist/src/construct/api-to-any-target/target.d.ts +16 -1
- package/dist/src/construct/api-to-any-target/target.js +16 -1
- package/dist/src/construct/api-to-any-target/types.d.ts +52 -0
- package/dist/src/construct/api-to-eventbridge-target/api.d.ts +18 -0
- package/dist/src/construct/api-to-eventbridge-target/api.js +18 -0
- package/dist/src/construct/api-to-eventbridge-target/event.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target/event.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target/main.d.ts +12 -0
- package/dist/src/construct/api-to-eventbridge-target/main.js +12 -3
- package/dist/src/construct/api-to-eventbridge-target/types.d.ts +67 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +7 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.d.ts +13 -0
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.js +13 -4
- package/dist/src/construct/api-to-eventbridge-target-with-sns/types.d.ts +12 -0
- package/dist/src/construct/api-to-lambda-target/api.d.ts +19 -0
- package/dist/src/construct/api-to-lambda-target/api.js +19 -0
- package/dist/src/construct/api-to-lambda-target/main.d.ts +24 -0
- package/dist/src/construct/api-to-lambda-target/main.js +24 -2
- package/dist/src/construct/api-to-lambda-target/types.d.ts +41 -0
- package/dist/src/construct/application-configuration/main.d.ts +29 -1
- package/dist/src/construct/application-configuration/main.js +28 -1
- package/dist/src/construct/application-configuration/types.d.ts +5 -0
- package/dist/src/construct/event-handler/handler.d.ts +23 -1
- package/dist/src/construct/event-handler/handler.js +23 -1
- package/dist/src/construct/event-handler/main.d.ts +13 -0
- package/dist/src/construct/event-handler/main.js +13 -0
- package/dist/src/construct/event-handler/types.d.ts +35 -0
- package/dist/src/construct/lambda-with-iam-access/main.d.ts +21 -0
- package/dist/src/construct/lambda-with-iam-access/main.js +21 -2
- package/dist/src/construct/lambda-with-iam-access/types.d.ts +18 -0
- package/dist/src/construct/piped-event-handler/main.d.ts +9 -0
- package/dist/src/construct/piped-event-handler/main.js +9 -0
- package/dist/src/construct/piped-event-handler/types.d.ts +7 -0
- package/dist/src/construct/rest-api-lambda/main.d.ts +23 -0
- package/dist/src/construct/rest-api-lambda/main.js +19 -2
- package/dist/src/construct/rest-api-lambda/types.d.ts +14 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.d.ts +12 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.js +12 -2
- package/dist/src/construct/rest-api-lambda-with-cache/types.d.ts +6 -0
- package/dist/src/construct/site-with-ecs-backend/constants.d.ts +5 -0
- package/dist/src/construct/site-with-ecs-backend/constants.js +5 -0
- package/dist/src/construct/site-with-ecs-backend/main.d.ts +37 -0
- package/dist/src/construct/site-with-ecs-backend/main.js +37 -2
- package/dist/src/construct/site-with-ecs-backend/types.d.ts +45 -0
- package/dist/src/construct/site-with-lambda-backend/constants.d.ts +8 -0
- package/dist/src/construct/site-with-lambda-backend/constants.js +8 -0
- package/dist/src/construct/site-with-lambda-backend/main.d.ts +31 -0
- package/dist/src/construct/site-with-lambda-backend/main.js +31 -2
- package/dist/src/construct/site-with-lambda-backend/types.d.ts +42 -0
- package/dist/src/construct/static-asset-deployment/main.d.ts +10 -0
- package/dist/src/construct/static-asset-deployment/main.js +10 -1
- package/dist/src/construct/static-asset-deployment/types.d.ts +14 -0
- package/dist/src/construct/static-site/main.d.ts +17 -0
- package/dist/src/construct/static-site/main.js +17 -2
- package/dist/src/construct/static-site/types.d.ts +18 -0
- package/dist/src/services/api-gateway/main.d.ts +20 -20
- package/dist/src/services/api-gateway/main.js +20 -20
- package/dist/src/services/api-gateway/types.d.ts +7 -0
- package/dist/src/services/appconfig/constants.d.ts +2 -2
- package/dist/src/services/appconfig/constants.js +2 -2
- package/dist/src/services/appconfig/main.d.ts +5 -5
- package/dist/src/services/appconfig/main.js +5 -5
- package/dist/src/services/appconfig/types.d.ts +11 -1
- package/dist/src/services/certificate-manager/types.d.ts +8 -0
- package/dist/src/services/cloudfront/main.d.ts +28 -28
- package/dist/src/services/cloudfront/main.js +28 -28
- package/dist/src/services/cloudfront/types.d.ts +8 -0
- package/dist/src/services/cloudwatch/logs.d.ts +4 -4
- package/dist/src/services/cloudwatch/logs.js +4 -4
- package/dist/src/services/cloudwatch/main.d.ts +24 -24
- package/dist/src/services/cloudwatch/main.js +25 -24
- package/dist/src/services/cloudwatch/types.d.ts +66 -0
- package/dist/src/services/dynamodb/main.d.ts +2 -2
- package/dist/src/services/dynamodb/main.js +2 -2
- package/dist/src/services/dynamodb/types.d.ts +8 -0
- package/dist/src/services/elastic-container-registry/main.d.ts +1 -1
- package/dist/src/services/elastic-container-registry/main.js +1 -1
- package/dist/src/services/elastic-container-service/main.d.ts +13 -13
- package/dist/src/services/elastic-container-service/main.js +16 -13
- package/dist/src/services/elastic-container-service/types.d.ts +30 -1
- package/dist/src/services/elastic-file-system/types.d.ts +9 -0
- package/dist/src/services/elastic-kubernetes-service/main.d.ts +3 -3
- package/dist/src/services/elastic-kubernetes-service/main.js +7 -3
- package/dist/src/services/elastic-kubernetes-service/types.d.ts +4 -0
- package/dist/src/services/elasticache/main.d.ts +14 -14
- package/dist/src/services/elasticache/main.js +18 -14
- package/dist/src/services/elasticache/types.d.ts +4 -0
- package/dist/src/services/eventbridge/main.d.ts +11 -11
- package/dist/src/services/eventbridge/main.js +19 -11
- package/dist/src/services/eventbridge/target.d.ts +5 -1
- package/dist/src/services/eventbridge/target.js +6 -1
- package/dist/src/services/eventbridge/types.d.ts +27 -1
- package/dist/src/services/evidently/types.d.ts +10 -0
- package/dist/src/services/identity-access-management/main.d.ts +42 -42
- package/dist/src/services/identity-access-management/main.js +42 -42
- package/dist/src/services/key-management-service/types.d.ts +2 -0
- package/dist/src/services/lambda/main.d.ts +25 -25
- package/dist/src/services/lambda/main.js +26 -25
- package/dist/src/services/lambda/types.d.ts +34 -0
- package/dist/src/services/route53/main.js +2 -0
- package/dist/src/services/route53/types.d.ts +3 -0
- package/dist/src/services/secrets-manager/main.js +2 -0
- package/dist/src/services/secrets-manager/types.d.ts +4 -0
- package/dist/src/services/simple-notification-service/types.d.ts +2 -0
- package/dist/src/services/simple-queue-service/main.js +2 -0
- package/dist/src/services/simple-queue-service/types.d.ts +11 -0
- package/dist/src/services/simple-storage-service/main.d.ts +1 -1
- package/dist/src/services/simple-storage-service/main.js +5 -1
- package/dist/src/services/simple-storage-service/types.d.ts +16 -0
- package/dist/src/services/step-function/types.d.ts +54 -0
- package/dist/src/services/systems-manager/main.d.ts +15 -4
- package/dist/src/services/systems-manager/main.js +17 -4
- package/dist/src/services/systems-manager/types.d.ts +8 -0
- package/dist/src/services/virtual-private-cloud/ipv6.d.ts +19 -1
- package/dist/src/services/virtual-private-cloud/ipv6.js +26 -1
- package/dist/src/services/virtual-private-cloud/main.js +1 -2
- package/dist/src/services/virtual-private-cloud/types.d.ts +5 -0
- package/dist/src/services/web-application-firewall/types.d.ts +4 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts +9 -3
- package/dist/src/utils/index.js +10 -3
- package/package.json +5 -5
|
@@ -23,21 +23,42 @@ import { LambdaWithIamAccessEnvironment, LambdaWithIamAccessProps } from './type
|
|
|
23
23
|
* @category Construct
|
|
24
24
|
*/
|
|
25
25
|
export declare class LambdaWithIamAccess extends CommonConstruct {
|
|
26
|
+
/** The Lambda with IAM access properties */
|
|
26
27
|
props: LambdaWithIamAccessProps;
|
|
28
|
+
/** The scoped id of this construct */
|
|
27
29
|
id: string;
|
|
30
|
+
/** The IAM policy for the Lambda function */
|
|
28
31
|
lambdaPolicy: PolicyDocument;
|
|
32
|
+
/** The IAM role for the Lambda function */
|
|
29
33
|
lambdaRole: Role;
|
|
34
|
+
/** The environment variables for the Lambda function */
|
|
30
35
|
lambdaEnvironment: LambdaWithIamAccessEnvironment;
|
|
36
|
+
/** The Lambda layers attached to the function */
|
|
31
37
|
lambdaLayers: ILayerVersion[];
|
|
38
|
+
/** The Lambda function */
|
|
32
39
|
lambdaFunction: IFunction;
|
|
40
|
+
/** The IAM user created for invoking the Lambda function */
|
|
33
41
|
lambdaIamUser: User;
|
|
42
|
+
/** The IAM access key for the Lambda IAM user */
|
|
34
43
|
lambdaUserAccessKey: CfnAccessKey;
|
|
44
|
+
/** The Secrets Manager secret storing the IAM access key credentials */
|
|
35
45
|
lambdaUserAccessSecret: Secret;
|
|
46
|
+
/** The VPC for the Lambda function */
|
|
36
47
|
lambdaVpc: IVpc;
|
|
48
|
+
/** The security groups for the Lambda function */
|
|
37
49
|
lambdaSecurityGroups: ISecurityGroup[];
|
|
50
|
+
/** The EFS access point for the Lambda function */
|
|
38
51
|
lambdaAccessPoint: IAccessPoint;
|
|
52
|
+
/** The EFS mount path for the Lambda function */
|
|
39
53
|
lambdaMountPath: string;
|
|
54
|
+
/** The VPC subnet selection for the Lambda function */
|
|
40
55
|
lambdaVpcSubnets: SubnetSelection;
|
|
56
|
+
/**
|
|
57
|
+
* @summary Create a new LambdaWithIamAccess construct
|
|
58
|
+
* @param parent the parent construct
|
|
59
|
+
* @param id scoped id of the resource
|
|
60
|
+
* @param props the Lambda with IAM access properties
|
|
61
|
+
*/
|
|
41
62
|
constructor(parent: Construct, id: string, props: LambdaWithIamAccessProps);
|
|
42
63
|
/**
|
|
43
64
|
* @summary Initialise and provision resources
|
|
@@ -22,23 +22,42 @@ import { Architecture } from '../../services/index.js';
|
|
|
22
22
|
* @category Construct
|
|
23
23
|
*/
|
|
24
24
|
export class LambdaWithIamAccess extends CommonConstruct {
|
|
25
|
-
|
|
25
|
+
/** The Lambda with IAM access properties */
|
|
26
26
|
props;
|
|
27
|
+
/** The scoped id of this construct */
|
|
27
28
|
id;
|
|
28
|
-
|
|
29
|
+
/** The IAM policy for the Lambda function */
|
|
29
30
|
lambdaPolicy;
|
|
31
|
+
/** The IAM role for the Lambda function */
|
|
30
32
|
lambdaRole;
|
|
33
|
+
/** The environment variables for the Lambda function */
|
|
31
34
|
lambdaEnvironment;
|
|
35
|
+
/** The Lambda layers attached to the function */
|
|
32
36
|
lambdaLayers = [];
|
|
37
|
+
/** The Lambda function */
|
|
33
38
|
lambdaFunction;
|
|
39
|
+
/** The IAM user created for invoking the Lambda function */
|
|
34
40
|
lambdaIamUser;
|
|
41
|
+
/** The IAM access key for the Lambda IAM user */
|
|
35
42
|
lambdaUserAccessKey;
|
|
43
|
+
/** The Secrets Manager secret storing the IAM access key credentials */
|
|
36
44
|
lambdaUserAccessSecret;
|
|
45
|
+
/** The VPC for the Lambda function */
|
|
37
46
|
lambdaVpc;
|
|
47
|
+
/** The security groups for the Lambda function */
|
|
38
48
|
lambdaSecurityGroups;
|
|
49
|
+
/** The EFS access point for the Lambda function */
|
|
39
50
|
lambdaAccessPoint;
|
|
51
|
+
/** The EFS mount path for the Lambda function */
|
|
40
52
|
lambdaMountPath;
|
|
53
|
+
/** The VPC subnet selection for the Lambda function */
|
|
41
54
|
lambdaVpcSubnets;
|
|
55
|
+
/**
|
|
56
|
+
* @summary Create a new LambdaWithIamAccess construct
|
|
57
|
+
* @param parent the parent construct
|
|
58
|
+
* @param id scoped id of the resource
|
|
59
|
+
* @param props the Lambda with IAM access properties
|
|
60
|
+
*/
|
|
42
61
|
constructor(parent, id, props) {
|
|
43
62
|
super(parent, id, props);
|
|
44
63
|
this.props = props;
|
|
@@ -2,21 +2,39 @@ import { AssetCode, LambdaInsightsVersion } from 'aws-cdk-lib/aws-lambda';
|
|
|
2
2
|
import { SecretProps } from 'aws-cdk-lib/aws-secretsmanager';
|
|
3
3
|
import { CommonStackProps } from '../../common/index.js';
|
|
4
4
|
import { LambdaEnvironment, LambdaProps } from '../../services/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Properties for configuring a {@link LambdaWithIamAccess} construct
|
|
7
|
+
*/
|
|
5
8
|
/** @category Interface */
|
|
6
9
|
export interface LambdaWithIamAccessProps extends CommonStackProps {
|
|
10
|
+
/** Whether to enable AppConfig integration for the Lambda function */
|
|
7
11
|
configEnabled?: boolean;
|
|
12
|
+
/** The Lambda function configuration */
|
|
8
13
|
lambda: LambdaProps;
|
|
14
|
+
/** The Lambda handler entry point (defaults to 'index.handler') */
|
|
9
15
|
lambdaHandler?: string;
|
|
16
|
+
/** The Lambda Insights layer version for enhanced monitoring */
|
|
10
17
|
lambdaInsightsVersion?: LambdaInsightsVersion;
|
|
18
|
+
/** The source code assets for Lambda layers */
|
|
11
19
|
lambdaLayerSources: AssetCode[];
|
|
20
|
+
/** The Secrets Manager secret configuration for storing IAM credentials */
|
|
12
21
|
lambdaSecret: SecretProps;
|
|
22
|
+
/** The Lambda function source code asset */
|
|
13
23
|
lambdaSource: AssetCode;
|
|
24
|
+
/** The application log level */
|
|
14
25
|
logLevel: string;
|
|
26
|
+
/** The Node.js environment (e.g. development, production) */
|
|
15
27
|
nodeEnv: string;
|
|
28
|
+
/** CloudFormation export name for an existing security group */
|
|
16
29
|
securityGroupExportName?: string;
|
|
30
|
+
/** The timezone for the application */
|
|
17
31
|
timezone: string;
|
|
32
|
+
/** Name of an existing VPC to look up */
|
|
18
33
|
vpcName?: string;
|
|
19
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Environment variables for the {@link LambdaWithIamAccess} Lambda function
|
|
37
|
+
*/
|
|
20
38
|
/** @category Interface */
|
|
21
39
|
export interface LambdaWithIamAccessEnvironment extends LambdaEnvironment {
|
|
22
40
|
}
|
|
@@ -19,9 +19,18 @@ import { PipedEventHandlerProps } from './types.js';
|
|
|
19
19
|
* @category Construct
|
|
20
20
|
*/
|
|
21
21
|
export declare class PipedEventHandler extends EventHandler {
|
|
22
|
+
/** The piped event handler properties */
|
|
22
23
|
props: PipedEventHandlerProps;
|
|
24
|
+
/** The dead-letter queue for failed piped messages */
|
|
23
25
|
pipedDlq: IQueue;
|
|
26
|
+
/** The SQS queue used as the event pipe source */
|
|
24
27
|
pipedQueue: IQueue;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Create a new PipedEventHandler construct
|
|
30
|
+
* @param parent the parent construct
|
|
31
|
+
* @param id scoped id of the resource
|
|
32
|
+
* @param props the piped event handler properties
|
|
33
|
+
*/
|
|
25
34
|
protected constructor(parent: Construct, id: string, props: PipedEventHandlerProps);
|
|
26
35
|
/**
|
|
27
36
|
* @summary Initialise and provision resources
|
|
@@ -18,9 +18,18 @@ import { EventHandler } from '../event-handler/index.js';
|
|
|
18
18
|
* @category Construct
|
|
19
19
|
*/
|
|
20
20
|
export class PipedEventHandler extends EventHandler {
|
|
21
|
+
/** The piped event handler properties */
|
|
21
22
|
props;
|
|
23
|
+
/** The dead-letter queue for failed piped messages */
|
|
22
24
|
pipedDlq;
|
|
25
|
+
/** The SQS queue used as the event pipe source */
|
|
23
26
|
pipedQueue;
|
|
27
|
+
/**
|
|
28
|
+
* @summary Create a new PipedEventHandler construct
|
|
29
|
+
* @param parent the parent construct
|
|
30
|
+
* @param id scoped id of the resource
|
|
31
|
+
* @param props the piped event handler properties
|
|
32
|
+
*/
|
|
24
33
|
constructor(parent, id, props) {
|
|
25
34
|
super(parent, id, props);
|
|
26
35
|
this.props = props;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { QueueProps } from 'aws-cdk-lib/aws-sqs';
|
|
2
2
|
import { SqsToLambdaPipeProps, SqsToSfnPipeProps } from '../../services/index.js';
|
|
3
3
|
import { EventHandlerProps } from '../event-handler/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Properties for configuring a {@link PipedEventHandler} construct
|
|
6
|
+
*/
|
|
4
7
|
/** @category Interface */
|
|
5
8
|
export interface PipedEventHandlerProps extends EventHandlerProps {
|
|
9
|
+
/** Configuration for the dead-letter queue used by the piped queue */
|
|
6
10
|
pipedDlq: QueueProps;
|
|
11
|
+
/** Configuration for the SQS queue used as the event pipe source */
|
|
7
12
|
pipedQueue: QueueProps;
|
|
13
|
+
/** Configuration for the SQS-to-Lambda EventBridge pipe */
|
|
8
14
|
sqsToLambdaPipe: SqsToLambdaPipeProps;
|
|
15
|
+
/** Configuration for the SQS-to-Step-Functions EventBridge pipe */
|
|
9
16
|
sqsToSfnPipe: SqsToSfnPipeProps;
|
|
10
17
|
}
|
|
@@ -26,19 +26,38 @@ import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types.js';
|
|
|
26
26
|
* @category Construct
|
|
27
27
|
*/
|
|
28
28
|
export declare abstract class RestApiLambda extends CommonConstruct {
|
|
29
|
+
/** The REST API Lambda properties */
|
|
29
30
|
props: RestApiLambdaProps;
|
|
31
|
+
/** The scoped id of this construct */
|
|
30
32
|
id: string;
|
|
33
|
+
/** The resolved application secrets from SecretsManager */
|
|
31
34
|
applicationSecrets: ISecret[];
|
|
35
|
+
/** The IAM policy for the REST API Lambda function */
|
|
32
36
|
restApiLambdaPolicy: PolicyDocument;
|
|
37
|
+
/** The IAM role for the REST API Lambda function */
|
|
33
38
|
restApiLambdaRole: Role;
|
|
39
|
+
/** The environment variables for the REST API Lambda function */
|
|
34
40
|
restApiLambdaEnvironment: RestApiLambdaEnvironment;
|
|
41
|
+
/** The Lambda layers attached to the REST API function */
|
|
35
42
|
restApiLambdaLayers: ILayerVersion[];
|
|
43
|
+
/** The REST API Lambda function */
|
|
36
44
|
restApiLambdaFunction: IFunction;
|
|
45
|
+
/** The API Gateway REST API */
|
|
37
46
|
restApi: RestApi;
|
|
47
|
+
/** The Route53 hosted zone for the API domain */
|
|
38
48
|
restApiHostedZone: IHostedZone;
|
|
49
|
+
/** The SSL/TLS certificate for the API custom domain */
|
|
39
50
|
restApiCertificate: ICertificate;
|
|
51
|
+
/** The API Gateway custom domain */
|
|
40
52
|
restApiDomain: DomainName;
|
|
53
|
+
/** The base path mappings for the API custom domain */
|
|
41
54
|
restApiBasePathMappings: BasePathMapping[];
|
|
55
|
+
/**
|
|
56
|
+
* @summary Create a new RestApiLambda construct
|
|
57
|
+
* @param parent the parent construct
|
|
58
|
+
* @param id scoped id of the resource
|
|
59
|
+
* @param props the REST API Lambda properties
|
|
60
|
+
*/
|
|
42
61
|
protected constructor(parent: Construct, id: string, props: RestApiLambdaProps);
|
|
43
62
|
/**
|
|
44
63
|
* @summary Initialise and provision resources
|
|
@@ -81,6 +100,10 @@ export declare abstract class RestApiLambda extends CommonConstruct {
|
|
|
81
100
|
* @summary Method to create rest restApiLambda for RestApi
|
|
82
101
|
*/
|
|
83
102
|
protected createRestApi(): void;
|
|
103
|
+
/**
|
|
104
|
+
* @summary Abstract method to create REST API resources (routes, methods, integrations)
|
|
105
|
+
* Must be implemented by subclasses to define the API structure
|
|
106
|
+
*/
|
|
84
107
|
protected abstract createRestApiResources(): void;
|
|
85
108
|
/**
|
|
86
109
|
* @summary Method to create custom restApiLambda domain for RestApi
|
|
@@ -21,21 +21,38 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
21
21
|
* @category Construct
|
|
22
22
|
*/
|
|
23
23
|
export class RestApiLambda extends CommonConstruct {
|
|
24
|
-
|
|
24
|
+
/** The REST API Lambda properties */
|
|
25
25
|
props;
|
|
26
|
+
/** The scoped id of this construct */
|
|
26
27
|
id;
|
|
27
|
-
|
|
28
|
+
/** The resolved application secrets from SecretsManager */
|
|
28
29
|
applicationSecrets;
|
|
30
|
+
/** The IAM policy for the REST API Lambda function */
|
|
29
31
|
restApiLambdaPolicy;
|
|
32
|
+
/** The IAM role for the REST API Lambda function */
|
|
30
33
|
restApiLambdaRole;
|
|
34
|
+
/** The environment variables for the REST API Lambda function */
|
|
31
35
|
restApiLambdaEnvironment;
|
|
36
|
+
/** The Lambda layers attached to the REST API function */
|
|
32
37
|
restApiLambdaLayers = [];
|
|
38
|
+
/** The REST API Lambda function */
|
|
33
39
|
restApiLambdaFunction;
|
|
40
|
+
/** The API Gateway REST API */
|
|
34
41
|
restApi;
|
|
42
|
+
/** The Route53 hosted zone for the API domain */
|
|
35
43
|
restApiHostedZone;
|
|
44
|
+
/** The SSL/TLS certificate for the API custom domain */
|
|
36
45
|
restApiCertificate;
|
|
46
|
+
/** The API Gateway custom domain */
|
|
37
47
|
restApiDomain;
|
|
48
|
+
/** The base path mappings for the API custom domain */
|
|
38
49
|
restApiBasePathMappings = [];
|
|
50
|
+
/**
|
|
51
|
+
* @summary Create a new RestApiLambda construct
|
|
52
|
+
* @param parent the parent construct
|
|
53
|
+
* @param id scoped id of the resource
|
|
54
|
+
* @param props the REST API Lambda properties
|
|
55
|
+
*/
|
|
39
56
|
constructor(parent, id, props) {
|
|
40
57
|
super(parent, id, props);
|
|
41
58
|
this.props = props;
|
|
@@ -2,24 +2,38 @@ import { AssetCode } from 'aws-cdk-lib/aws-lambda';
|
|
|
2
2
|
import { AcmProps, LambdaEnvironment, LambdaProps, LambdaRestApiProps } from '../../services/index.js';
|
|
3
3
|
import { CommonStackProps } from '../../common/index.js';
|
|
4
4
|
/**
|
|
5
|
+
* Environment variables for the {@link RestApiLambda} Lambda function
|
|
5
6
|
*/
|
|
6
7
|
/** @category Interface */
|
|
7
8
|
export interface RestApiLambdaEnvironment extends LambdaEnvironment {
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
11
|
+
* Properties for configuring a {@link RestApiLambda} construct
|
|
10
12
|
*/
|
|
11
13
|
/** @category Interface */
|
|
12
14
|
export interface RestApiLambdaProps extends CommonStackProps {
|
|
15
|
+
/** Additional API root paths for base path mappings */
|
|
13
16
|
apiRootPaths?: string[];
|
|
17
|
+
/** The subdomain for the API Gateway custom domain */
|
|
14
18
|
apiSubDomain: string;
|
|
19
|
+
/** The application log level */
|
|
15
20
|
logLevel: string;
|
|
21
|
+
/** The Node.js environment (e.g. development, production) */
|
|
16
22
|
nodeEnv: string;
|
|
23
|
+
/** The API Gateway REST API configuration */
|
|
17
24
|
restApi: LambdaRestApiProps;
|
|
25
|
+
/** The SSL/TLS certificate configuration */
|
|
18
26
|
restApiCertificate: AcmProps;
|
|
27
|
+
/** The Lambda handler entry point */
|
|
19
28
|
restApiHandler: string;
|
|
29
|
+
/** The Lambda function configuration */
|
|
20
30
|
restApiLambda: LambdaProps;
|
|
31
|
+
/** The source code assets for Lambda layers */
|
|
21
32
|
restApiLambdaLayerSources?: AssetCode[];
|
|
33
|
+
/** The Lambda function source code asset */
|
|
22
34
|
restApiSource: AssetCode;
|
|
35
|
+
/** The timezone for the application */
|
|
23
36
|
timezone: string;
|
|
37
|
+
/** Whether to look up an existing hosted zone instead of creating one */
|
|
24
38
|
useExistingHostedZone: boolean;
|
|
25
39
|
}
|
|
@@ -22,12 +22,24 @@ import { RestApiLambdaWithCacheProps } from './types.js';
|
|
|
22
22
|
* @category Construct
|
|
23
23
|
*/
|
|
24
24
|
export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
|
|
25
|
+
/** The REST API Lambda with cache properties */
|
|
25
26
|
props: RestApiLambdaWithCacheProps;
|
|
27
|
+
/** The scoped id of this construct */
|
|
26
28
|
id: string;
|
|
29
|
+
/** The VPC for the Lambda function and ElastiCache cluster */
|
|
27
30
|
restApivpc: IVpc;
|
|
31
|
+
/** The ElastiCache replication group */
|
|
28
32
|
restApiCache: CfnReplicationGroup;
|
|
33
|
+
/** The security group shared by the Lambda function and ElastiCache cluster */
|
|
29
34
|
restApiSecurityGroup: ISecurityGroup;
|
|
35
|
+
/** The CloudFormation export name for the security group */
|
|
30
36
|
restApiSecurityGroupExportName: string;
|
|
37
|
+
/**
|
|
38
|
+
* @summary Create a new RestApiLambdaWithCache construct
|
|
39
|
+
* @param parent the parent construct
|
|
40
|
+
* @param id scoped id of the resource
|
|
41
|
+
* @param props the REST API Lambda with cache properties
|
|
42
|
+
*/
|
|
31
43
|
protected constructor(parent: Construct, id: string, props: RestApiLambdaWithCacheProps);
|
|
32
44
|
/**
|
|
33
45
|
* @summary Initialise and provision resources
|
|
@@ -23,14 +23,24 @@ import { RestApiLambda } from '../rest-api-lambda/index.js';
|
|
|
23
23
|
* @category Construct
|
|
24
24
|
*/
|
|
25
25
|
export class RestApiLambdaWithCache extends RestApiLambda {
|
|
26
|
-
|
|
26
|
+
/** The REST API Lambda with cache properties */
|
|
27
27
|
props;
|
|
28
|
+
/** The scoped id of this construct */
|
|
28
29
|
id;
|
|
29
|
-
|
|
30
|
+
/** The VPC for the Lambda function and ElastiCache cluster */
|
|
30
31
|
restApivpc;
|
|
32
|
+
/** The ElastiCache replication group */
|
|
31
33
|
restApiCache;
|
|
34
|
+
/** The security group shared by the Lambda function and ElastiCache cluster */
|
|
32
35
|
restApiSecurityGroup;
|
|
36
|
+
/** The CloudFormation export name for the security group */
|
|
33
37
|
restApiSecurityGroupExportName;
|
|
38
|
+
/**
|
|
39
|
+
* @summary Create a new RestApiLambdaWithCache construct
|
|
40
|
+
* @param parent the parent construct
|
|
41
|
+
* @param id scoped id of the resource
|
|
42
|
+
* @param props the REST API Lambda with cache properties
|
|
43
|
+
*/
|
|
34
44
|
constructor(parent, id, props) {
|
|
35
45
|
super(parent, id, props);
|
|
36
46
|
this.props = props;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { RestApiLambdaProps } from '../rest-api-lambda/index.js';
|
|
2
2
|
import { ReplicatedElastiCacheProps, VpcProps } from '../../services/index.js';
|
|
3
3
|
/**
|
|
4
|
+
* Properties for configuring a {@link RestApiLambdaWithCache} construct
|
|
4
5
|
*/
|
|
5
6
|
/** @category Interface */
|
|
6
7
|
export interface RestApiLambdaWithCacheProps extends RestApiLambdaProps {
|
|
8
|
+
/** The ElastiCache replication group configuration */
|
|
7
9
|
restApiCache: ReplicatedElastiCacheProps;
|
|
10
|
+
/** The VPC configuration for the Lambda function and cache */
|
|
8
11
|
restApiVpc: VpcProps;
|
|
12
|
+
/** CloudFormation export name for an existing security group */
|
|
9
13
|
securityGroupExportName: string;
|
|
14
|
+
/** Whether to look up an existing VPC instead of creating one */
|
|
10
15
|
useExistingVpc: boolean;
|
|
16
|
+
/** Name of an existing VPC to look up */
|
|
11
17
|
vpcName?: string;
|
|
12
18
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for distinguishing between origin and static response header policy types
|
|
3
|
+
*/
|
|
1
4
|
/** @category Enum */
|
|
2
5
|
export declare enum SiteResponseHeaderPolicyType {
|
|
6
|
+
/** Policy applied to the origin behaviour */
|
|
3
7
|
ORIGIN = "origin",
|
|
8
|
+
/** Policy applied to the static asset behaviour */
|
|
4
9
|
STATIC = "static"
|
|
5
10
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for distinguishing between origin and static response header policy types
|
|
3
|
+
*/
|
|
1
4
|
/** @category Enum */
|
|
2
5
|
export var SiteResponseHeaderPolicyType;
|
|
3
6
|
(function (SiteResponseHeaderPolicyType) {
|
|
7
|
+
/** Policy applied to the origin behaviour */
|
|
4
8
|
SiteResponseHeaderPolicyType["ORIGIN"] = "origin";
|
|
9
|
+
/** Policy applied to the static asset behaviour */
|
|
5
10
|
SiteResponseHeaderPolicyType["STATIC"] = "static";
|
|
6
11
|
})(SiteResponseHeaderPolicyType || (SiteResponseHeaderPolicyType = {}));
|
|
@@ -29,39 +29,76 @@ import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBacken
|
|
|
29
29
|
* @category Construct
|
|
30
30
|
*/
|
|
31
31
|
export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
32
|
+
/** The site with ECS backend properties */
|
|
32
33
|
props: SiteWithEcsBackendProps;
|
|
34
|
+
/** The scoped id of this construct */
|
|
33
35
|
id: string;
|
|
36
|
+
/** The Route53 hosted zone for the site domain */
|
|
34
37
|
siteHostedZone: IHostedZone;
|
|
38
|
+
/** The global (edge) SSL/TLS certificate */
|
|
35
39
|
siteCertificate: ICertificate;
|
|
40
|
+
/** The regional SSL/TLS certificate */
|
|
36
41
|
siteRegionalCertificate: ICertificate;
|
|
42
|
+
/** The IAM policy for the ECS task execution role */
|
|
37
43
|
siteEcsPolicy: PolicyDocument;
|
|
44
|
+
/** The IAM role for the ECS task execution */
|
|
38
45
|
siteEcsRole: Role;
|
|
46
|
+
/** The environment variables passed to the ECS container */
|
|
39
47
|
siteEcsEnvironment: {
|
|
40
48
|
[key: string]: string;
|
|
41
49
|
};
|
|
50
|
+
/** The VPC for the ECS cluster */
|
|
42
51
|
siteVpc: IVpc;
|
|
52
|
+
/** The resolved secrets from SecretsManager */
|
|
43
53
|
siteSecrets: any;
|
|
54
|
+
/** The ECS cluster */
|
|
44
55
|
siteEcsCluster: Cluster;
|
|
56
|
+
/** The CloudWatch log group for ECS task logs */
|
|
45
57
|
siteEcsLogGroup: LogGroup;
|
|
58
|
+
/** Docker build arguments for the ECS container image */
|
|
46
59
|
siteEcsBuildArgs: any;
|
|
60
|
+
/** The Docker container image for the ECS task */
|
|
47
61
|
siteEcsContainerImage: AssetImage;
|
|
62
|
+
/** The ECS Fargate service */
|
|
48
63
|
siteEcsService: FargateService;
|
|
64
|
+
/** The ECS Fargate task definition */
|
|
49
65
|
siteEcsTaskDefinition: FargateTaskDefinition;
|
|
66
|
+
/** The Application Load Balancer listener */
|
|
50
67
|
siteEcsListener: ApplicationListener;
|
|
68
|
+
/** The Application Load Balancer */
|
|
51
69
|
siteEcsLoadBalancer: ApplicationLoadBalancer;
|
|
70
|
+
/** The ALB target group */
|
|
52
71
|
siteEcsTargetGroup: ApplicationTargetGroup;
|
|
72
|
+
/** The EFS file system for persistent storage */
|
|
53
73
|
siteFileSystem: FileSystem;
|
|
74
|
+
/** The S3 bucket used for ALB and CloudFront access logs */
|
|
54
75
|
siteLogBucket: IBucket;
|
|
76
|
+
/** The HTTP origin pointing to the ECS backend */
|
|
55
77
|
siteOrigin: HttpOrigin;
|
|
78
|
+
/** The CloudFront distribution for the site */
|
|
56
79
|
siteDistribution: Distribution;
|
|
80
|
+
/** The internal domain name used by the ECS load balancer */
|
|
57
81
|
siteInternalDomainName: string;
|
|
82
|
+
/** The external domain name exposed to end users via CloudFront */
|
|
58
83
|
siteExternalDomainName: string;
|
|
84
|
+
/** The list of domain names associated with the CloudFront distribution */
|
|
59
85
|
siteDomainNames: string[];
|
|
86
|
+
/** The CloudFront function attached to the distribution */
|
|
60
87
|
siteCloudfrontFunction: IFunction;
|
|
88
|
+
/** The CloudFront function associations for the distribution behaviours */
|
|
61
89
|
siteFunctionAssociations: FunctionAssociation[];
|
|
90
|
+
/** The CloudFront origin request policy */
|
|
62
91
|
siteOriginRequestPolicy: OriginRequestPolicy;
|
|
92
|
+
/** The CloudFront response headers policy */
|
|
63
93
|
siteOriginResponseHeadersPolicy?: ResponseHeadersPolicy;
|
|
94
|
+
/** The CloudFront cache policy */
|
|
64
95
|
siteCachePolicy: CachePolicy;
|
|
96
|
+
/**
|
|
97
|
+
* @summary Create a new SiteWithEcsBackend construct
|
|
98
|
+
* @param parent the parent construct
|
|
99
|
+
* @param id scoped id of the resource
|
|
100
|
+
* @param props the site with ECS backend properties
|
|
101
|
+
*/
|
|
65
102
|
constructor(parent: Construct, id: string, props: SiteWithEcsBackendProps);
|
|
66
103
|
/**
|
|
67
104
|
* @summary Initialise and provision resources
|
|
@@ -23,39 +23,74 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
23
23
|
* @category Construct
|
|
24
24
|
*/
|
|
25
25
|
export class SiteWithEcsBackend extends CommonConstruct {
|
|
26
|
-
|
|
26
|
+
/** The site with ECS backend properties */
|
|
27
27
|
props;
|
|
28
|
+
/** The scoped id of this construct */
|
|
28
29
|
id;
|
|
29
|
-
|
|
30
|
+
/** The Route53 hosted zone for the site domain */
|
|
30
31
|
siteHostedZone;
|
|
32
|
+
/** The global (edge) SSL/TLS certificate */
|
|
31
33
|
siteCertificate;
|
|
34
|
+
/** The regional SSL/TLS certificate */
|
|
32
35
|
siteRegionalCertificate;
|
|
36
|
+
/** The IAM policy for the ECS task execution role */
|
|
33
37
|
siteEcsPolicy;
|
|
38
|
+
/** The IAM role for the ECS task execution */
|
|
34
39
|
siteEcsRole;
|
|
40
|
+
/** The environment variables passed to the ECS container */
|
|
35
41
|
siteEcsEnvironment;
|
|
42
|
+
/** The VPC for the ECS cluster */
|
|
36
43
|
siteVpc;
|
|
44
|
+
/** The resolved secrets from SecretsManager */
|
|
37
45
|
siteSecrets;
|
|
46
|
+
/** The ECS cluster */
|
|
38
47
|
siteEcsCluster;
|
|
48
|
+
/** The CloudWatch log group for ECS task logs */
|
|
39
49
|
siteEcsLogGroup;
|
|
50
|
+
/** Docker build arguments for the ECS container image */
|
|
40
51
|
siteEcsBuildArgs = {};
|
|
52
|
+
/** The Docker container image for the ECS task */
|
|
41
53
|
siteEcsContainerImage;
|
|
54
|
+
/** The ECS Fargate service */
|
|
42
55
|
siteEcsService;
|
|
56
|
+
/** The ECS Fargate task definition */
|
|
43
57
|
siteEcsTaskDefinition;
|
|
58
|
+
/** The Application Load Balancer listener */
|
|
44
59
|
siteEcsListener;
|
|
60
|
+
/** The Application Load Balancer */
|
|
45
61
|
siteEcsLoadBalancer;
|
|
62
|
+
/** The ALB target group */
|
|
46
63
|
siteEcsTargetGroup;
|
|
64
|
+
/** The EFS file system for persistent storage */
|
|
47
65
|
siteFileSystem;
|
|
66
|
+
/** The S3 bucket used for ALB and CloudFront access logs */
|
|
48
67
|
siteLogBucket;
|
|
68
|
+
/** The HTTP origin pointing to the ECS backend */
|
|
49
69
|
siteOrigin;
|
|
70
|
+
/** The CloudFront distribution for the site */
|
|
50
71
|
siteDistribution;
|
|
72
|
+
/** The internal domain name used by the ECS load balancer */
|
|
51
73
|
siteInternalDomainName;
|
|
74
|
+
/** The external domain name exposed to end users via CloudFront */
|
|
52
75
|
siteExternalDomainName;
|
|
76
|
+
/** The list of domain names associated with the CloudFront distribution */
|
|
53
77
|
siteDomainNames;
|
|
78
|
+
/** The CloudFront function attached to the distribution */
|
|
54
79
|
siteCloudfrontFunction;
|
|
80
|
+
/** The CloudFront function associations for the distribution behaviours */
|
|
55
81
|
siteFunctionAssociations;
|
|
82
|
+
/** The CloudFront origin request policy */
|
|
56
83
|
siteOriginRequestPolicy;
|
|
84
|
+
/** The CloudFront response headers policy */
|
|
57
85
|
siteOriginResponseHeadersPolicy;
|
|
86
|
+
/** The CloudFront cache policy */
|
|
58
87
|
siteCachePolicy;
|
|
88
|
+
/**
|
|
89
|
+
* @summary Create a new SiteWithEcsBackend construct
|
|
90
|
+
* @param parent the parent construct
|
|
91
|
+
* @param id scoped id of the resource
|
|
92
|
+
* @param props the site with ECS backend properties
|
|
93
|
+
*/
|
|
59
94
|
constructor(parent, id, props) {
|
|
60
95
|
super(parent, id, props);
|
|
61
96
|
this.props = props;
|