@gradientedge/cdk-utils-aws 2.4.1 → 2.6.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
|
@@ -27,17 +27,26 @@ import { ApiDestinedLambda } from './api-destined-lambda.js';
|
|
|
27
27
|
* @category Construct
|
|
28
28
|
*/
|
|
29
29
|
export class ApiToEventBridgeTargetWithSns extends CommonConstruct {
|
|
30
|
+
/** The API to EventBridge target properties */
|
|
30
31
|
props;
|
|
32
|
+
/** The scoped id of this construct */
|
|
31
33
|
id;
|
|
32
|
-
|
|
34
|
+
/** The resolved application secrets from SecretsManager */
|
|
33
35
|
applicationSecrets;
|
|
34
|
-
|
|
36
|
+
/** The API destined Lambda resources (function, role, destinations) */
|
|
35
37
|
apiDestinedLambda;
|
|
36
|
-
|
|
38
|
+
/** The EventBridge event resources (bus, rules, log groups) */
|
|
37
39
|
apiEvent;
|
|
38
|
-
|
|
40
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
39
41
|
apiDestinedRestApi;
|
|
42
|
+
/** The default API resource path name */
|
|
40
43
|
apiResource;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Create a new ApiToEventBridgeTargetWithSns construct
|
|
46
|
+
* @param parent the parent construct
|
|
47
|
+
* @param id scoped id of the resource
|
|
48
|
+
* @param props the API to EventBridge target properties
|
|
49
|
+
*/
|
|
41
50
|
constructor(parent, id, props) {
|
|
42
51
|
super(parent, id, props);
|
|
43
52
|
this.props = props;
|
|
@@ -3,22 +3,34 @@ import { AssetCode, IFunction, LayerVersion } from 'aws-cdk-lib/aws-lambda';
|
|
|
3
3
|
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
|
|
4
4
|
import { LambdaEnvironment } from '../../services/index.js';
|
|
5
5
|
/**
|
|
6
|
+
* Environment variables for the API destined Lambda function
|
|
6
7
|
*/
|
|
7
8
|
/** @category Interface */
|
|
8
9
|
export interface ApiDestinedLambdaEnvironment extends LambdaEnvironment {
|
|
10
|
+
/** The source identifier for event tracing */
|
|
9
11
|
SOURCE_ID: string;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
14
|
+
* Type definition for API destined Lambda resources used by the {@link ApiToEventBridgeTargetWithSns} construct
|
|
12
15
|
*/
|
|
13
16
|
/** @category Interface */
|
|
14
17
|
export interface ApiDestinedLambdaType {
|
|
18
|
+
/** The EventBridge destination for failed Lambda invocations */
|
|
15
19
|
destinationFailure: EventBridgeDestination;
|
|
20
|
+
/** The EventBridge destination for successful Lambda invocations */
|
|
16
21
|
destinationSuccess: EventBridgeDestination;
|
|
22
|
+
/** The environment variables for the Lambda function */
|
|
17
23
|
environment: ApiDestinedLambdaEnvironment;
|
|
24
|
+
/** The Lambda function */
|
|
18
25
|
function: IFunction;
|
|
26
|
+
/** The Lambda layer source code asset */
|
|
19
27
|
layerSource?: AssetCode;
|
|
28
|
+
/** The Lambda layers attached to the function */
|
|
20
29
|
layers: LayerVersion[];
|
|
30
|
+
/** The IAM policy for the Lambda function */
|
|
21
31
|
policy: PolicyDocument;
|
|
32
|
+
/** The IAM role for the Lambda function */
|
|
22
33
|
role: Role;
|
|
34
|
+
/** The Lambda function source code asset */
|
|
23
35
|
source?: AssetCode;
|
|
24
36
|
}
|
|
@@ -10,27 +10,46 @@ import { ApiToLambdaTargetRestApiType } from './types.js';
|
|
|
10
10
|
* @category Construct
|
|
11
11
|
*/
|
|
12
12
|
export declare class ApiToLambdaTargetRestApi implements ApiToLambdaTargetRestApiType {
|
|
13
|
+
/** The API Gateway REST API */
|
|
13
14
|
api: RestApi;
|
|
15
|
+
/** The base path mappings for the API custom domain */
|
|
14
16
|
basePathMappings: BasePathMapping[];
|
|
17
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
15
18
|
certificate: ICertificate;
|
|
19
|
+
/** The API Gateway custom domain */
|
|
16
20
|
domain: DomainName;
|
|
21
|
+
/** The API Gateway error response model */
|
|
17
22
|
errorResponseModel: Model;
|
|
23
|
+
/** The Route53 hosted zone for the API domain */
|
|
18
24
|
hostedZone: IHostedZone;
|
|
25
|
+
/** The API Gateway Lambda integration */
|
|
19
26
|
integration: Integration;
|
|
27
|
+
/** The integration error response mapping */
|
|
20
28
|
integrationErrorResponse: IntegrationResponse;
|
|
29
|
+
/** The integration request parameter mappings */
|
|
21
30
|
integrationRequestParameters: {
|
|
22
31
|
[p: string]: string;
|
|
23
32
|
};
|
|
33
|
+
/** The integration request template mappings */
|
|
24
34
|
integrationRequestTemplates: {
|
|
25
35
|
[p: string]: string;
|
|
26
36
|
};
|
|
37
|
+
/** The integration success response mapping */
|
|
27
38
|
integrationResponse: IntegrationResponse;
|
|
39
|
+
/** The Lambda function used as the integration target */
|
|
28
40
|
lambda: IFunction;
|
|
41
|
+
/** The API Gateway resource method */
|
|
29
42
|
method: Method;
|
|
43
|
+
/** The method error response */
|
|
30
44
|
methodErrorResponse: MethodResponse;
|
|
45
|
+
/** The method success response */
|
|
31
46
|
methodResponse: MethodResponse;
|
|
47
|
+
/** The API Gateway resource */
|
|
32
48
|
resource: Resource;
|
|
49
|
+
/** The success response model */
|
|
33
50
|
responseModel: Model;
|
|
51
|
+
/** The SNS topic */
|
|
34
52
|
topic: Topic;
|
|
53
|
+
/** The IAM role for the API Gateway integration */
|
|
35
54
|
role: Role;
|
|
36
55
|
}
|
|
@@ -3,23 +3,42 @@
|
|
|
3
3
|
* @category Construct
|
|
4
4
|
*/
|
|
5
5
|
export class ApiToLambdaTargetRestApi {
|
|
6
|
+
/** The API Gateway REST API */
|
|
6
7
|
api;
|
|
8
|
+
/** The base path mappings for the API custom domain */
|
|
7
9
|
basePathMappings = [];
|
|
10
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
8
11
|
certificate;
|
|
12
|
+
/** The API Gateway custom domain */
|
|
9
13
|
domain;
|
|
14
|
+
/** The API Gateway error response model */
|
|
10
15
|
errorResponseModel;
|
|
16
|
+
/** The Route53 hosted zone for the API domain */
|
|
11
17
|
hostedZone;
|
|
18
|
+
/** The API Gateway Lambda integration */
|
|
12
19
|
integration;
|
|
20
|
+
/** The integration error response mapping */
|
|
13
21
|
integrationErrorResponse;
|
|
22
|
+
/** The integration request parameter mappings */
|
|
14
23
|
integrationRequestParameters;
|
|
24
|
+
/** The integration request template mappings */
|
|
15
25
|
integrationRequestTemplates;
|
|
26
|
+
/** The integration success response mapping */
|
|
16
27
|
integrationResponse;
|
|
28
|
+
/** The Lambda function used as the integration target */
|
|
17
29
|
lambda;
|
|
30
|
+
/** The API Gateway resource method */
|
|
18
31
|
method;
|
|
32
|
+
/** The method error response */
|
|
19
33
|
methodErrorResponse;
|
|
34
|
+
/** The method success response */
|
|
20
35
|
methodResponse;
|
|
36
|
+
/** The API Gateway resource */
|
|
21
37
|
resource;
|
|
38
|
+
/** The success response model */
|
|
22
39
|
responseModel;
|
|
40
|
+
/** The SNS topic */
|
|
23
41
|
topic;
|
|
42
|
+
/** The IAM role for the API Gateway integration */
|
|
24
43
|
role;
|
|
25
44
|
}
|
|
@@ -3,14 +3,38 @@ import { Construct } from 'constructs';
|
|
|
3
3
|
import { CommonConstruct } from '../../common/index.js';
|
|
4
4
|
import { ApiToLambdaTargetProps, ApiToLambdaTargetRestApiType } from './types.js';
|
|
5
5
|
/**
|
|
6
|
+
* Provides a construct to create and deploy API Gateway invocations to a Lambda function
|
|
7
|
+
* @example
|
|
8
|
+
* import { ApiToLambdaTarget, ApiToLambdaTargetProps } '@gradientedge/cdk-utils'
|
|
9
|
+
* import { Construct } from 'constructs'
|
|
10
|
+
*
|
|
11
|
+
* class CustomConstruct extends ApiToLambdaTarget {
|
|
12
|
+
* constructor(parent: Construct, id: string, props: ApiToLambdaTargetProps) {
|
|
13
|
+
* super(parent, id, props)
|
|
14
|
+
* this.props = props
|
|
15
|
+
* this.id = id
|
|
16
|
+
* this.initResources()
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
6
19
|
* @category Construct
|
|
7
20
|
*/
|
|
8
21
|
export declare class ApiToLambdaTarget extends CommonConstruct {
|
|
22
|
+
/** The API to Lambda target properties */
|
|
9
23
|
props: ApiToLambdaTargetProps;
|
|
24
|
+
/** The scoped id of this construct */
|
|
10
25
|
id: string;
|
|
26
|
+
/** The resolved application secrets from SecretsManager */
|
|
11
27
|
applicationSecrets: ISecret[];
|
|
28
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
12
29
|
apiToLambdaTargetRestApi: ApiToLambdaTargetRestApiType;
|
|
30
|
+
/** The default API resource path name */
|
|
13
31
|
apiResource: string;
|
|
32
|
+
/**
|
|
33
|
+
* @summary Create a new ApiToLambdaTarget construct
|
|
34
|
+
* @param parent the parent construct
|
|
35
|
+
* @param id scoped id of the resource
|
|
36
|
+
* @param props the API to Lambda target properties
|
|
37
|
+
*/
|
|
14
38
|
constructor(parent: Construct, id: string, props: ApiToLambdaTargetProps);
|
|
15
39
|
/**
|
|
16
40
|
* @summary Initialise and provision resources
|
|
@@ -5,16 +5,38 @@ import { Function } from 'aws-cdk-lib/aws-lambda';
|
|
|
5
5
|
import { CommonConstruct } from '../../common/index.js';
|
|
6
6
|
import { ApiToLambdaTargetRestApi } from './api.js';
|
|
7
7
|
/**
|
|
8
|
+
* Provides a construct to create and deploy API Gateway invocations to a Lambda function
|
|
9
|
+
* @example
|
|
10
|
+
* import { ApiToLambdaTarget, ApiToLambdaTargetProps } '@gradientedge/cdk-utils'
|
|
11
|
+
* import { Construct } from 'constructs'
|
|
12
|
+
*
|
|
13
|
+
* class CustomConstruct extends ApiToLambdaTarget {
|
|
14
|
+
* constructor(parent: Construct, id: string, props: ApiToLambdaTargetProps) {
|
|
15
|
+
* super(parent, id, props)
|
|
16
|
+
* this.props = props
|
|
17
|
+
* this.id = id
|
|
18
|
+
* this.initResources()
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
8
21
|
* @category Construct
|
|
9
22
|
*/
|
|
10
23
|
export class ApiToLambdaTarget extends CommonConstruct {
|
|
24
|
+
/** The API to Lambda target properties */
|
|
11
25
|
props;
|
|
26
|
+
/** The scoped id of this construct */
|
|
12
27
|
id;
|
|
13
|
-
|
|
28
|
+
/** The resolved application secrets from SecretsManager */
|
|
14
29
|
applicationSecrets;
|
|
15
|
-
|
|
30
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
16
31
|
apiToLambdaTargetRestApi;
|
|
32
|
+
/** The default API resource path name */
|
|
17
33
|
apiResource;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Create a new ApiToLambdaTarget construct
|
|
36
|
+
* @param parent the parent construct
|
|
37
|
+
* @param id scoped id of the resource
|
|
38
|
+
* @param props the API to Lambda target properties
|
|
39
|
+
*/
|
|
18
40
|
constructor(parent, id, props) {
|
|
19
41
|
super(parent, id, props);
|
|
20
42
|
this.props = props;
|
|
@@ -7,59 +7,100 @@ import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
|
|
|
7
7
|
import { AcmProps, LambdaRestApiProps } from '../../services/index.js';
|
|
8
8
|
import { CommonStackProps } from '../../common/index.js';
|
|
9
9
|
/**
|
|
10
|
+
* Type definition for REST API resources used by the {@link ApiToLambdaTarget} construct
|
|
10
11
|
*/
|
|
11
12
|
/** @category Interface */
|
|
12
13
|
export interface ApiToLambdaTargetRestApiType {
|
|
14
|
+
/** The API Gateway REST API */
|
|
13
15
|
api: IRestApi;
|
|
16
|
+
/** The optional API Gateway authorizer */
|
|
14
17
|
authoriser?: IAuthorizer;
|
|
18
|
+
/** The base path mappings for the API custom domain */
|
|
15
19
|
basePathMappings: BasePathMapping[];
|
|
20
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
16
21
|
certificate: acm.ICertificate;
|
|
22
|
+
/** The API Gateway custom domain */
|
|
17
23
|
domain: DomainName;
|
|
24
|
+
/** The API Gateway error response model */
|
|
18
25
|
errorResponseModel: Model;
|
|
26
|
+
/** The Route53 hosted zone for the API domain */
|
|
19
27
|
hostedZone: route53.IHostedZone;
|
|
28
|
+
/** The API Gateway Lambda integration */
|
|
20
29
|
integration: Integration;
|
|
30
|
+
/** The integration error response mapping */
|
|
21
31
|
integrationErrorResponse: IntegrationResponse;
|
|
32
|
+
/** The integration request parameter mappings */
|
|
22
33
|
integrationRequestParameters: {
|
|
23
34
|
[p: string]: string;
|
|
24
35
|
};
|
|
36
|
+
/** The integration request template mappings */
|
|
25
37
|
integrationRequestTemplates: {
|
|
26
38
|
[p: string]: string;
|
|
27
39
|
};
|
|
40
|
+
/** The integration success response mapping */
|
|
28
41
|
integrationResponse: IntegrationResponse;
|
|
42
|
+
/** The Lambda function used as the integration target */
|
|
29
43
|
lambda: IFunction;
|
|
44
|
+
/** The API Gateway resource method */
|
|
30
45
|
method: Method;
|
|
46
|
+
/** The method error response */
|
|
31
47
|
methodErrorResponse: MethodResponse;
|
|
48
|
+
/** The method success response */
|
|
32
49
|
methodResponse: MethodResponse;
|
|
50
|
+
/** The IAM policy for the API Gateway integration role */
|
|
33
51
|
policy?: PolicyDocument;
|
|
52
|
+
/** The API Gateway resource */
|
|
34
53
|
resource: Resource;
|
|
54
|
+
/** The success response model */
|
|
35
55
|
responseModel: Model;
|
|
56
|
+
/** The IAM role for the API Gateway integration */
|
|
36
57
|
role?: Role;
|
|
58
|
+
/** The optional SNS topic */
|
|
37
59
|
topic?: ITopic;
|
|
38
60
|
}
|
|
39
61
|
/**
|
|
62
|
+
* Properties for configuring the REST API in the {@link ApiToLambdaTarget} construct
|
|
40
63
|
*/
|
|
41
64
|
/** @category Interface */
|
|
42
65
|
export interface ApiToLambdaTargetRestApiProps {
|
|
66
|
+
/** The SSL/TLS certificate configuration */
|
|
43
67
|
certificate: AcmProps;
|
|
68
|
+
/** CloudFormation export name for an existing REST API ID */
|
|
44
69
|
importedRestApiRef?: string;
|
|
70
|
+
/** CloudFormation export name for an existing REST API root resource ID */
|
|
45
71
|
importedRestApiRootResourceRef?: string;
|
|
72
|
+
/** Custom method error response configuration */
|
|
46
73
|
methodErrorResponse: MethodResponse;
|
|
74
|
+
/** Custom method success response configuration */
|
|
47
75
|
methodResponse: MethodResponse;
|
|
76
|
+
/** The API resource path name */
|
|
48
77
|
resource: string;
|
|
78
|
+
/** REST API configuration properties */
|
|
49
79
|
restApi: LambdaRestApiProps;
|
|
80
|
+
/** Whether to use an existing REST API instead of creating a new one */
|
|
50
81
|
useExisting: boolean;
|
|
82
|
+
/** Whether to create a resource and method on the REST API */
|
|
51
83
|
withResource?: boolean;
|
|
52
84
|
}
|
|
53
85
|
/**
|
|
86
|
+
* Properties for configuring an {@link ApiToLambdaTarget} construct
|
|
54
87
|
*/
|
|
55
88
|
/** @category Interface */
|
|
56
89
|
export interface ApiToLambdaTargetProps extends CommonStackProps {
|
|
90
|
+
/** REST API configuration */
|
|
57
91
|
api: ApiToLambdaTargetRestApiProps;
|
|
92
|
+
/** Additional API root paths for base path mappings */
|
|
58
93
|
apiRootPaths?: string[];
|
|
94
|
+
/** The subdomain for the API Gateway custom domain */
|
|
59
95
|
apiSubDomain: string;
|
|
96
|
+
/** The name of the existing Lambda function to integrate with */
|
|
60
97
|
lambdaFunctionName: string;
|
|
98
|
+
/** The application log level */
|
|
61
99
|
logLevel: string;
|
|
100
|
+
/** The Node.js environment (e.g. development, production) */
|
|
62
101
|
nodeEnv: string;
|
|
102
|
+
/** The timezone for the application */
|
|
63
103
|
timezone: string;
|
|
104
|
+
/** Whether to look up an existing hosted zone instead of creating one */
|
|
64
105
|
useExistingHostedZone: boolean;
|
|
65
106
|
}
|
|
@@ -2,15 +2,43 @@ import { CfnApplication, CfnConfigurationProfile, CfnEnvironment, CfnHostedConfi
|
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
import { CommonConstruct } from '../../common/index.js';
|
|
4
4
|
import { ApplicationConfigurationProps } from './types.js';
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Provides a construct to create and deploy an AWS AppConfig application configuration
|
|
7
|
+
* @example
|
|
8
|
+
* import { ApplicationConfiguration, ApplicationConfigurationProps } '@gradientedge/cdk-utils'
|
|
9
|
+
* import { Construct } from 'constructs'
|
|
10
|
+
*
|
|
11
|
+
* class CustomConstruct extends ApplicationConfiguration {
|
|
12
|
+
* constructor(parent: Construct, id: string, props: ApplicationConfigurationProps) {
|
|
13
|
+
* super(parent, id, props)
|
|
14
|
+
* this.props = props
|
|
15
|
+
* this.id = id
|
|
16
|
+
* this.initResources()
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* @category Construct
|
|
20
|
+
*/
|
|
6
21
|
export declare class ApplicationConfiguration extends CommonConstruct {
|
|
22
|
+
/** The application configuration properties */
|
|
7
23
|
props: ApplicationConfigurationProps;
|
|
24
|
+
/** The scoped id of this construct */
|
|
8
25
|
id: string;
|
|
26
|
+
/** The AppConfig application resource */
|
|
9
27
|
appConfigApplication: CfnApplication;
|
|
28
|
+
/** The AppConfig environment resource */
|
|
10
29
|
appConfigEnvironment: CfnEnvironment;
|
|
30
|
+
/** The AppConfig configuration profile resource */
|
|
11
31
|
appConfigProfile: CfnConfigurationProfile;
|
|
32
|
+
/** The AppConfig hosted configuration version resource */
|
|
12
33
|
appConfigVersion: CfnHostedConfigurationVersion;
|
|
34
|
+
/** The AppConfig deployment strategy */
|
|
13
35
|
appConfigDeploymentStrategy: IDeploymentStrategy;
|
|
36
|
+
/**
|
|
37
|
+
* @summary Create a new ApplicationConfiguration construct
|
|
38
|
+
* @param parent the parent construct
|
|
39
|
+
* @param id scoped id of the resource
|
|
40
|
+
* @param props the application configuration properties
|
|
41
|
+
*/
|
|
14
42
|
constructor(parent: Construct, id: string, props: ApplicationConfigurationProps);
|
|
15
43
|
/**
|
|
16
44
|
* @summary Initialise and provision resources
|
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import { Duration, Fn } from 'aws-cdk-lib';
|
|
2
2
|
import { CfnDeployment, CfnHostedConfigurationVersion, DeploymentStrategy, RolloutStrategy, } from 'aws-cdk-lib/aws-appconfig';
|
|
3
3
|
import { CommonConstruct } from '../../common/index.js';
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Provides a construct to create and deploy an AWS AppConfig application configuration
|
|
6
|
+
* @example
|
|
7
|
+
* import { ApplicationConfiguration, ApplicationConfigurationProps } '@gradientedge/cdk-utils'
|
|
8
|
+
* import { Construct } from 'constructs'
|
|
9
|
+
*
|
|
10
|
+
* class CustomConstruct extends ApplicationConfiguration {
|
|
11
|
+
* constructor(parent: Construct, id: string, props: ApplicationConfigurationProps) {
|
|
12
|
+
* super(parent, id, props)
|
|
13
|
+
* this.props = props
|
|
14
|
+
* this.id = id
|
|
15
|
+
* this.initResources()
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* @category Construct
|
|
19
|
+
*/
|
|
5
20
|
export class ApplicationConfiguration extends CommonConstruct {
|
|
21
|
+
/** The scoped id of this construct */
|
|
6
22
|
id;
|
|
23
|
+
/** The AppConfig application resource */
|
|
7
24
|
appConfigApplication;
|
|
25
|
+
/** The AppConfig environment resource */
|
|
8
26
|
appConfigEnvironment;
|
|
27
|
+
/** The AppConfig configuration profile resource */
|
|
9
28
|
appConfigProfile;
|
|
29
|
+
/** The AppConfig hosted configuration version resource */
|
|
10
30
|
appConfigVersion;
|
|
31
|
+
/** The AppConfig deployment strategy */
|
|
11
32
|
appConfigDeploymentStrategy;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Create a new ApplicationConfiguration construct
|
|
35
|
+
* @param parent the parent construct
|
|
36
|
+
* @param id scoped id of the resource
|
|
37
|
+
* @param props the application configuration properties
|
|
38
|
+
*/
|
|
12
39
|
constructor(parent, id, props) {
|
|
13
40
|
super(parent, id, props);
|
|
14
41
|
this.props = props;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { CommonStackProps } from '../../common/index.js';
|
|
2
2
|
import { AppConfigProps } from '../../services/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Properties for configuring an {@link ApplicationConfiguration} construct
|
|
5
|
+
*/
|
|
3
6
|
/** @category Interface */
|
|
4
7
|
export interface ApplicationConfigurationProps extends CommonStackProps {
|
|
8
|
+
/** The AppConfig application, environment, and profile configuration */
|
|
5
9
|
appConfig: AppConfigProps;
|
|
10
|
+
/** The JSON content for the hosted configuration version */
|
|
6
11
|
appConfigContent: any;
|
|
7
12
|
}
|
|
@@ -6,25 +6,47 @@ import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
|
6
6
|
import { Queue } from 'aws-cdk-lib/aws-sqs';
|
|
7
7
|
import { Chain, Map, StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
|
|
8
8
|
import { EventHandlerType } from './types.js';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Container class to hold all event handler resources including targets, workflow, and rule state
|
|
11
|
+
* @category Construct
|
|
12
|
+
*/
|
|
10
13
|
export declare class Handler implements EventHandlerType {
|
|
14
|
+
/** The EventBridge event archive for replay */
|
|
11
15
|
archive: Archive;
|
|
16
|
+
/** ECS task targets for EventBridge rules */
|
|
12
17
|
ecsTargets: EcsTask[];
|
|
18
|
+
/** The EventBridge event bus */
|
|
13
19
|
eventBus: IEventBus;
|
|
20
|
+
/** The workflow step definition chain to use as the iterator in a Map state */
|
|
14
21
|
eventWorkflowDefinition: Chain;
|
|
22
|
+
/** The Lambda functions created for event processing */
|
|
15
23
|
lambdaFunctions: IFunction[];
|
|
24
|
+
/** Lambda function targets for EventBridge rules */
|
|
16
25
|
lambdaTargets: LambdaFunction[];
|
|
26
|
+
/** CloudWatch log group targets for EventBridge rules */
|
|
17
27
|
logTargets: CloudWatchLogGroup[];
|
|
28
|
+
/** The SQS queue for event buffering */
|
|
18
29
|
queue: Queue;
|
|
30
|
+
/** The EventBridge rule */
|
|
19
31
|
rule: Rule;
|
|
32
|
+
/** The event pattern for the EventBridge rule */
|
|
20
33
|
rulePattern: any;
|
|
34
|
+
/** SQS queue targets for EventBridge rules */
|
|
21
35
|
sqsTargets: SqsQueue[];
|
|
36
|
+
/** Step Functions state machine targets for EventBridge rules */
|
|
22
37
|
stepFunctionTargets: SfnStateMachine[];
|
|
38
|
+
/** All combined rule targets */
|
|
23
39
|
targets: IRuleTarget[];
|
|
40
|
+
/** The Step Functions state machine */
|
|
24
41
|
workflow: StateMachine;
|
|
42
|
+
/** The workflow step definition chain */
|
|
25
43
|
workflowDefinition: Chain;
|
|
44
|
+
/** The CloudWatch log group for workflow execution logs */
|
|
26
45
|
workflowLogGroup: LogGroup;
|
|
46
|
+
/** The Step Functions Map state for parallel processing */
|
|
27
47
|
workflowMapState: Map;
|
|
48
|
+
/** The IAM policy for the workflow execution role */
|
|
28
49
|
workflowPolicy: PolicyDocument;
|
|
50
|
+
/** The IAM role for the workflow execution */
|
|
29
51
|
workflowRole: Role;
|
|
30
52
|
}
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Container class to hold all event handler resources including targets, workflow, and rule state
|
|
3
|
+
* @category Construct
|
|
4
|
+
*/
|
|
2
5
|
export class Handler {
|
|
6
|
+
/** The EventBridge event archive for replay */
|
|
3
7
|
archive;
|
|
8
|
+
/** ECS task targets for EventBridge rules */
|
|
4
9
|
ecsTargets = [];
|
|
10
|
+
/** The EventBridge event bus */
|
|
5
11
|
eventBus;
|
|
12
|
+
/** The workflow step definition chain to use as the iterator in a Map state */
|
|
6
13
|
eventWorkflowDefinition;
|
|
14
|
+
/** The Lambda functions created for event processing */
|
|
7
15
|
lambdaFunctions = [];
|
|
16
|
+
/** Lambda function targets for EventBridge rules */
|
|
8
17
|
lambdaTargets = [];
|
|
18
|
+
/** CloudWatch log group targets for EventBridge rules */
|
|
9
19
|
logTargets = [];
|
|
20
|
+
/** The SQS queue for event buffering */
|
|
10
21
|
queue;
|
|
22
|
+
/** The EventBridge rule */
|
|
11
23
|
rule;
|
|
24
|
+
/** The event pattern for the EventBridge rule */
|
|
12
25
|
rulePattern;
|
|
26
|
+
/** SQS queue targets for EventBridge rules */
|
|
13
27
|
sqsTargets = [];
|
|
28
|
+
/** Step Functions state machine targets for EventBridge rules */
|
|
14
29
|
stepFunctionTargets = [];
|
|
30
|
+
/** All combined rule targets */
|
|
15
31
|
targets = [];
|
|
32
|
+
/** The Step Functions state machine */
|
|
16
33
|
workflow;
|
|
34
|
+
/** The workflow step definition chain */
|
|
17
35
|
workflowDefinition;
|
|
36
|
+
/** The CloudWatch log group for workflow execution logs */
|
|
18
37
|
workflowLogGroup;
|
|
38
|
+
/** The Step Functions Map state for parallel processing */
|
|
19
39
|
workflowMapState;
|
|
40
|
+
/** The IAM policy for the workflow execution role */
|
|
20
41
|
workflowPolicy;
|
|
42
|
+
/** The IAM role for the workflow execution */
|
|
21
43
|
workflowRole;
|
|
22
44
|
}
|
|
@@ -20,13 +20,26 @@ import { EventHandlerProps } from './types.js';
|
|
|
20
20
|
* @category Construct
|
|
21
21
|
*/
|
|
22
22
|
export declare class EventHandler extends CommonConstruct {
|
|
23
|
+
/** The event handler properties */
|
|
23
24
|
props: EventHandlerProps;
|
|
25
|
+
/** The scoped id of this construct */
|
|
24
26
|
id: string;
|
|
27
|
+
/** Container for all event handler resources (targets, workflow, rules) */
|
|
25
28
|
handler: Handler;
|
|
29
|
+
/** Whether to provision the Step Functions target on the EventBridge rule */
|
|
26
30
|
provisionTarget: boolean;
|
|
31
|
+
/** The VPC security group for Lambda functions */
|
|
27
32
|
securityGroup: ISecurityGroup;
|
|
33
|
+
/** Whether to wrap the workflow definition in a Map state for parallel processing */
|
|
28
34
|
useMapState: boolean;
|
|
35
|
+
/** The VPC for Lambda functions that require VPC access */
|
|
29
36
|
vpc: IVpc;
|
|
37
|
+
/**
|
|
38
|
+
* @summary Create a new EventHandler construct
|
|
39
|
+
* @param parent the parent construct
|
|
40
|
+
* @param id scoped id of the resource
|
|
41
|
+
* @param props the event handler properties
|
|
42
|
+
*/
|
|
30
43
|
constructor(parent: Construct, id: string, props: EventHandlerProps);
|
|
31
44
|
/**
|
|
32
45
|
* @summary Initialise and provision resources
|
|
@@ -24,13 +24,26 @@ import { Handler } from './handler.js';
|
|
|
24
24
|
* @category Construct
|
|
25
25
|
*/
|
|
26
26
|
export class EventHandler extends CommonConstruct {
|
|
27
|
+
/** The event handler properties */
|
|
27
28
|
props;
|
|
29
|
+
/** The scoped id of this construct */
|
|
28
30
|
id;
|
|
31
|
+
/** Container for all event handler resources (targets, workflow, rules) */
|
|
29
32
|
handler;
|
|
33
|
+
/** Whether to provision the Step Functions target on the EventBridge rule */
|
|
30
34
|
provisionTarget = true;
|
|
35
|
+
/** The VPC security group for Lambda functions */
|
|
31
36
|
securityGroup;
|
|
37
|
+
/** Whether to wrap the workflow definition in a Map state for parallel processing */
|
|
32
38
|
useMapState;
|
|
39
|
+
/** The VPC for Lambda functions that require VPC access */
|
|
33
40
|
vpc;
|
|
41
|
+
/**
|
|
42
|
+
* @summary Create a new EventHandler construct
|
|
43
|
+
* @param parent the parent construct
|
|
44
|
+
* @param id scoped id of the resource
|
|
45
|
+
* @param props the event handler properties
|
|
46
|
+
*/
|
|
34
47
|
constructor(parent, id, props) {
|
|
35
48
|
super(parent, id, props);
|
|
36
49
|
this.props = props;
|
|
@@ -6,38 +6,73 @@ import { Queue } from 'aws-cdk-lib/aws-sqs';
|
|
|
6
6
|
import { Chain, Map, StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
|
|
7
7
|
import { CommonStackProps } from '../../common/index.js';
|
|
8
8
|
import { EventRuleProps, LogProps, QueueProps, SfnMapProps, SfnStateMachineProps, VpcProps } from '../../services/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Properties for configuring an {@link EventHandler} construct
|
|
11
|
+
*/
|
|
9
12
|
/** @category Interface */
|
|
10
13
|
export interface EventHandlerProps extends CommonStackProps {
|
|
14
|
+
/** The name of the custom EventBridge event bus */
|
|
11
15
|
eventBusName: string;
|
|
16
|
+
/** The number of days to retain archived events */
|
|
12
17
|
eventRetentionInDays: number;
|
|
18
|
+
/** The EventBridge rule configuration */
|
|
13
19
|
eventRule?: EventRuleProps;
|
|
20
|
+
/** Whether to enable event archiving for replay */
|
|
14
21
|
eventRuleArchiveEnabled: boolean;
|
|
22
|
+
/** The cron/rate expression for scheduled rules */
|
|
15
23
|
eventRuleSchedule: string;
|
|
24
|
+
/** The SQS queue configuration for event buffering */
|
|
16
25
|
eventSqs: QueueProps;
|
|
26
|
+
/** CloudFormation export name for an existing security group */
|
|
17
27
|
securityGroupExportName: string;
|
|
28
|
+
/** VPC configuration for Lambda functions that require VPC access */
|
|
18
29
|
vpc: VpcProps;
|
|
30
|
+
/** Name of an existing VPC to look up */
|
|
19
31
|
vpcName?: string;
|
|
32
|
+
/** Step Functions state machine configuration */
|
|
20
33
|
workflow: SfnStateMachineProps;
|
|
34
|
+
/** CloudWatch log group configuration for the workflow */
|
|
21
35
|
workflowLog: LogProps;
|
|
36
|
+
/** Step Functions Map state configuration for parallel processing */
|
|
22
37
|
workflowMapState: SfnMapProps;
|
|
23
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Type definition for event handler resources used by the {@link EventHandler} construct
|
|
41
|
+
*/
|
|
24
42
|
/** @category Interface */
|
|
25
43
|
export interface EventHandlerType {
|
|
44
|
+
/** The EventBridge event archive for replay */
|
|
26
45
|
archive: Archive;
|
|
46
|
+
/** ECS task targets for EventBridge rules */
|
|
27
47
|
ecsTargets: EcsTask[];
|
|
48
|
+
/** The EventBridge event bus */
|
|
28
49
|
eventBus: IEventBus;
|
|
50
|
+
/** Lambda function targets for EventBridge rules */
|
|
29
51
|
lambdaTargets: LambdaFunction[];
|
|
52
|
+
/** CloudWatch log group targets for EventBridge rules */
|
|
30
53
|
logTargets: CloudWatchLogGroup[];
|
|
54
|
+
/** The SQS queue for event buffering */
|
|
31
55
|
queue: Queue;
|
|
56
|
+
/** The EventBridge rule */
|
|
32
57
|
rule: Rule;
|
|
58
|
+
/** The event pattern for the EventBridge rule */
|
|
33
59
|
rulePattern: any;
|
|
60
|
+
/** SQS queue targets for EventBridge rules */
|
|
34
61
|
sqsTargets: SqsQueue[];
|
|
62
|
+
/** Step Functions state machine targets for EventBridge rules */
|
|
35
63
|
stepFunctionTargets: SfnStateMachine[];
|
|
64
|
+
/** All combined rule targets */
|
|
36
65
|
targets: IRuleTarget[];
|
|
66
|
+
/** The Step Functions state machine */
|
|
37
67
|
workflow: StateMachine;
|
|
68
|
+
/** The workflow step definition chain */
|
|
38
69
|
workflowDefinition: Chain;
|
|
70
|
+
/** The CloudWatch log group for workflow execution logs */
|
|
39
71
|
workflowLogGroup: LogGroup;
|
|
72
|
+
/** The Step Functions Map state for parallel processing */
|
|
40
73
|
workflowMapState: Map;
|
|
74
|
+
/** The IAM policy for the workflow execution role */
|
|
41
75
|
workflowPolicy: PolicyDocument;
|
|
76
|
+
/** The IAM role for the workflow execution */
|
|
42
77
|
workflowRole: Role;
|
|
43
78
|
}
|