@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
|
@@ -20,11 +20,22 @@ import { ApiToAnyTargetProps, ApiToAnyTargetRestApiResource, ApiToAnyTargetRestA
|
|
|
20
20
|
* @category Construct
|
|
21
21
|
*/
|
|
22
22
|
export declare class ApiToAnyTarget extends CommonConstruct {
|
|
23
|
+
/** The API to any target properties */
|
|
23
24
|
props: ApiToAnyTargetProps;
|
|
25
|
+
/** The scoped id of this construct */
|
|
24
26
|
id: string;
|
|
27
|
+
/** The resolved application secrets from SecretsManager */
|
|
25
28
|
applicationSecrets: ISecret[];
|
|
29
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
26
30
|
apiToAnyTargetRestApi: ApiToAnyTargetRestApiType;
|
|
31
|
+
/** The default API resource path name */
|
|
27
32
|
apiResource: string;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Create a new ApiToAnyTarget construct
|
|
35
|
+
* @param parent the parent construct
|
|
36
|
+
* @param id scoped id of the resource
|
|
37
|
+
* @param props the API to any target properties
|
|
38
|
+
*/
|
|
28
39
|
constructor(parent: Construct, id: string, props: ApiToAnyTargetProps);
|
|
29
40
|
/**
|
|
30
41
|
* @summary Initialise and provision resources
|
|
@@ -19,13 +19,22 @@ import { ApiToAnyTargetRestApi } from './target.js';
|
|
|
19
19
|
* @category Construct
|
|
20
20
|
*/
|
|
21
21
|
export class ApiToAnyTarget extends CommonConstruct {
|
|
22
|
+
/** The API to any target properties */
|
|
22
23
|
props;
|
|
24
|
+
/** The scoped id of this construct */
|
|
23
25
|
id;
|
|
24
|
-
|
|
26
|
+
/** The resolved application secrets from SecretsManager */
|
|
25
27
|
applicationSecrets;
|
|
26
|
-
|
|
28
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
27
29
|
apiToAnyTargetRestApi;
|
|
30
|
+
/** The default API resource path name */
|
|
28
31
|
apiResource;
|
|
32
|
+
/**
|
|
33
|
+
* @summary Create a new ApiToAnyTarget construct
|
|
34
|
+
* @param parent the parent construct
|
|
35
|
+
* @param id scoped id of the resource
|
|
36
|
+
* @param props the API to any target properties
|
|
37
|
+
*/
|
|
29
38
|
constructor(parent, id, props) {
|
|
30
39
|
super(parent, id, props);
|
|
31
40
|
this.props = props;
|
|
@@ -3,21 +3,36 @@ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
|
3
3
|
import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
4
4
|
import { IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
5
5
|
import { ApiToAnyTargetRestApiType } from './types.js';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Container class to hold all REST API resources for the {@link ApiToAnyTarget} construct
|
|
8
|
+
* @category Construct
|
|
9
|
+
*/
|
|
7
10
|
export declare class ApiToAnyTargetRestApi implements ApiToAnyTargetRestApiType {
|
|
11
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
8
12
|
accessLogGroup: LogGroup;
|
|
13
|
+
/** The API Gateway REST API */
|
|
9
14
|
api: IRestApi;
|
|
15
|
+
/** The optional API Gateway authorizer */
|
|
10
16
|
authoriser?: IAuthorizer;
|
|
17
|
+
/** The base path mappings for the API custom domain */
|
|
11
18
|
basePathMappings: BasePathMapping[];
|
|
19
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
12
20
|
certificate: ICertificate;
|
|
21
|
+
/** The API Gateway custom domain */
|
|
13
22
|
domain: DomainName;
|
|
23
|
+
/** The Route53 hosted zone for the API domain */
|
|
14
24
|
hostedZone: IHostedZone;
|
|
25
|
+
/** The default API Gateway integration */
|
|
15
26
|
integration: Integration;
|
|
27
|
+
/** Map of HTTP methods to their API Gateway Method resources */
|
|
16
28
|
method: {
|
|
17
29
|
[httpMethod: string]: Method;
|
|
18
30
|
};
|
|
31
|
+
/** The default method error response */
|
|
19
32
|
methodErrorResponse: MethodResponse;
|
|
33
|
+
/** The default method success response */
|
|
20
34
|
methodResponse: MethodResponse;
|
|
35
|
+
/** Map of paths to their API Gateway Resource objects */
|
|
21
36
|
resource: {
|
|
22
37
|
[path: string]: Resource;
|
|
23
38
|
};
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Container class to hold all REST API resources for the {@link ApiToAnyTarget} construct
|
|
3
|
+
* @category Construct
|
|
4
|
+
*/
|
|
2
5
|
export class ApiToAnyTargetRestApi {
|
|
6
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
3
7
|
accessLogGroup;
|
|
8
|
+
/** The API Gateway REST API */
|
|
4
9
|
api;
|
|
10
|
+
/** The optional API Gateway authorizer */
|
|
5
11
|
authoriser;
|
|
12
|
+
/** The base path mappings for the API custom domain */
|
|
6
13
|
basePathMappings;
|
|
14
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
7
15
|
certificate;
|
|
16
|
+
/** The API Gateway custom domain */
|
|
8
17
|
domain;
|
|
18
|
+
/** The Route53 hosted zone for the API domain */
|
|
9
19
|
hostedZone;
|
|
20
|
+
/** The default API Gateway integration */
|
|
10
21
|
integration;
|
|
22
|
+
/** Map of HTTP methods to their API Gateway Method resources */
|
|
11
23
|
method;
|
|
24
|
+
/** The default method error response */
|
|
12
25
|
methodErrorResponse;
|
|
26
|
+
/** The default method success response */
|
|
13
27
|
methodResponse;
|
|
28
|
+
/** Map of paths to their API Gateway Resource objects */
|
|
14
29
|
resource;
|
|
15
30
|
}
|
|
@@ -4,61 +4,113 @@ import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
|
4
4
|
import { IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
5
5
|
import { CommonStackProps } from '../../common/index.js';
|
|
6
6
|
import { AcmProps, RestApigProps } from '../../services/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Type definition for REST API resources used by the {@link ApiToAnyTarget} construct
|
|
9
|
+
*/
|
|
7
10
|
/** @category Interface */
|
|
8
11
|
export interface ApiToAnyTargetRestApiType {
|
|
12
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
9
13
|
accessLogGroup: LogGroup;
|
|
14
|
+
/** The API Gateway REST API */
|
|
10
15
|
api: IRestApi;
|
|
16
|
+
/** The optional API Gateway authorizer */
|
|
11
17
|
authoriser?: IAuthorizer;
|
|
18
|
+
/** The base path mappings for the API custom domain */
|
|
12
19
|
basePathMappings: BasePathMapping[];
|
|
20
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
13
21
|
certificate: ICertificate;
|
|
22
|
+
/** The API Gateway custom domain */
|
|
14
23
|
domain: DomainName;
|
|
24
|
+
/** The Route53 hosted zone for the API domain */
|
|
15
25
|
hostedZone: IHostedZone;
|
|
26
|
+
/** The default API Gateway integration */
|
|
16
27
|
integration: Integration;
|
|
28
|
+
/** Map of HTTP methods to their API Gateway Method resources */
|
|
17
29
|
method: {
|
|
18
30
|
[httpMethod: string]: Method;
|
|
19
31
|
};
|
|
32
|
+
/** The default method error response */
|
|
20
33
|
methodErrorResponse: MethodResponse;
|
|
34
|
+
/** The default method success response */
|
|
21
35
|
methodResponse: MethodResponse;
|
|
36
|
+
/** Map of paths to their API Gateway Resource objects */
|
|
22
37
|
resource: {
|
|
23
38
|
[path: string]: Resource;
|
|
24
39
|
};
|
|
25
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Properties for defining an individual API resource with its integration and configuration
|
|
43
|
+
*/
|
|
26
44
|
/** @category Interface */
|
|
27
45
|
export interface ApiToAnyTargetRestApiResource {
|
|
46
|
+
/** Whether to add a proxy resource ({proxy+}) under this resource */
|
|
28
47
|
addProxy: boolean;
|
|
48
|
+
/** The optional API Gateway authorizer for this resource */
|
|
29
49
|
authorizer?: IAuthorizer;
|
|
50
|
+
/** The allowed CORS origins */
|
|
30
51
|
allowedOrigins?: string[];
|
|
52
|
+
/** The allowed CORS HTTP methods */
|
|
31
53
|
allowedMethods?: string[];
|
|
54
|
+
/** The allowed CORS headers */
|
|
32
55
|
allowedHeaders?: string[];
|
|
56
|
+
/** The API Gateway integration for this resource */
|
|
33
57
|
integration: Integration;
|
|
58
|
+
/** Required method request parameters */
|
|
34
59
|
methodRequestParameters?: {
|
|
35
60
|
[param: string]: boolean;
|
|
36
61
|
};
|
|
62
|
+
/** The resource path segment */
|
|
37
63
|
path: string;
|
|
64
|
+
/** The parent resource to attach this resource to */
|
|
38
65
|
parent?: IResource;
|
|
66
|
+
/** The integration to use for the proxy resource */
|
|
39
67
|
proxyIntegration?: Integration;
|
|
68
|
+
/** Whether to enable default CORS preflight configuration */
|
|
40
69
|
enableDefaultCors?: boolean;
|
|
70
|
+
/** The mock integration for testing */
|
|
41
71
|
mockIntegration?: MockIntegration;
|
|
72
|
+
/** The mock method responses */
|
|
42
73
|
mockMethodResponses?: MethodResponse[];
|
|
43
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Properties for configuring the REST API in the {@link ApiToAnyTarget} construct
|
|
77
|
+
*/
|
|
44
78
|
/** @category Interface */
|
|
45
79
|
export interface ApiToAnyTargetRestApiProps {
|
|
80
|
+
/** The SSL/TLS certificate configuration */
|
|
46
81
|
certificate: AcmProps;
|
|
82
|
+
/** CloudFormation export name for an existing REST API ID */
|
|
47
83
|
importedRestApiRef?: string;
|
|
84
|
+
/** CloudFormation export name for an existing REST API root resource ID */
|
|
48
85
|
importedRestApiRootResourceRef?: string;
|
|
86
|
+
/** Custom method error response configuration */
|
|
49
87
|
methodErrorResponse: MethodResponse;
|
|
88
|
+
/** Custom method success response configuration */
|
|
50
89
|
methodResponse: MethodResponse;
|
|
90
|
+
/** REST API configuration properties */
|
|
51
91
|
restApi: RestApigProps;
|
|
92
|
+
/** Whether to use an existing REST API instead of creating a new one */
|
|
52
93
|
useExisting: boolean;
|
|
94
|
+
/** Whether to create resources and methods on the REST API */
|
|
53
95
|
withResource?: boolean;
|
|
54
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Properties for configuring an {@link ApiToAnyTarget} construct
|
|
99
|
+
*/
|
|
55
100
|
/** @category Interface */
|
|
56
101
|
export interface ApiToAnyTargetProps extends CommonStackProps {
|
|
102
|
+
/** REST API configuration */
|
|
57
103
|
api: ApiToAnyTargetRestApiProps;
|
|
104
|
+
/** Additional API root paths for base path mappings */
|
|
58
105
|
apiRootPaths?: string[];
|
|
106
|
+
/** The subdomain for the API Gateway custom domain */
|
|
59
107
|
apiSubDomain: string;
|
|
108
|
+
/** The application log level */
|
|
60
109
|
logLevel: string;
|
|
110
|
+
/** The Node.js environment (e.g. development, production) */
|
|
61
111
|
nodeEnv: string;
|
|
112
|
+
/** The timezone for the application */
|
|
62
113
|
timezone: string;
|
|
114
|
+
/** Whether to look up an existing hosted zone instead of creating one */
|
|
63
115
|
useExistingHostedZone: boolean;
|
|
64
116
|
}
|
|
@@ -10,26 +10,44 @@ import { ApiToEventBridgeTargetRestApiType } from './types.js';
|
|
|
10
10
|
* @category Construct
|
|
11
11
|
*/
|
|
12
12
|
export declare class ApiToEventbridgeTargetRestApi implements ApiToEventBridgeTargetRestApiType {
|
|
13
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
13
14
|
accessLogGroup: LogGroup;
|
|
15
|
+
/** The API Gateway REST API */
|
|
14
16
|
api: RestApi;
|
|
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 integration with the backend service */
|
|
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 API Gateway resource method */
|
|
28
40
|
method: Method;
|
|
41
|
+
/** The method error response */
|
|
29
42
|
methodErrorResponse: MethodResponse;
|
|
43
|
+
/** The method success response */
|
|
30
44
|
methodResponse: MethodResponse;
|
|
45
|
+
/** The API Gateway resource */
|
|
31
46
|
resource: Resource;
|
|
47
|
+
/** The success response model */
|
|
32
48
|
responseModel: Model;
|
|
49
|
+
/** The SNS topic for event forwarding */
|
|
33
50
|
topic: Topic;
|
|
51
|
+
/** The IAM role for the API Gateway integration */
|
|
34
52
|
role: Role;
|
|
35
53
|
}
|
|
@@ -3,22 +3,40 @@
|
|
|
3
3
|
* @category Construct
|
|
4
4
|
*/
|
|
5
5
|
export class ApiToEventbridgeTargetRestApi {
|
|
6
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
6
7
|
accessLogGroup;
|
|
8
|
+
/** The API Gateway REST API */
|
|
7
9
|
api;
|
|
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 integration with the backend service */
|
|
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 API Gateway resource method */
|
|
17
29
|
method;
|
|
30
|
+
/** The method error response */
|
|
18
31
|
methodErrorResponse;
|
|
32
|
+
/** The method success response */
|
|
19
33
|
methodResponse;
|
|
34
|
+
/** The API Gateway resource */
|
|
20
35
|
resource;
|
|
36
|
+
/** The success response model */
|
|
21
37
|
responseModel;
|
|
38
|
+
/** The SNS topic for event forwarding */
|
|
22
39
|
topic;
|
|
40
|
+
/** The IAM role for the API Gateway integration */
|
|
23
41
|
role;
|
|
24
42
|
}
|
|
@@ -6,11 +6,18 @@ import { ApiToEventBridgeTargetEventType } from './types.js';
|
|
|
6
6
|
* @category Construct
|
|
7
7
|
*/
|
|
8
8
|
export declare class ApiToEventbridgeTargetEvent implements ApiToEventBridgeTargetEventType {
|
|
9
|
+
/** The EventBridge event bus */
|
|
9
10
|
eventBus: IEventBus;
|
|
11
|
+
/** The CloudWatch log group for event logging */
|
|
10
12
|
logGroup: LogGroup;
|
|
13
|
+
/** The CloudWatch log group for failed event deliveries */
|
|
11
14
|
logGroupFailure: LogGroup;
|
|
15
|
+
/** The CloudWatch log group for successful event deliveries */
|
|
12
16
|
logGroupSuccess: LogGroup;
|
|
17
|
+
/** The EventBridge rule for routing events */
|
|
13
18
|
rule: Rule;
|
|
19
|
+
/** The EventBridge rule for failed event deliveries */
|
|
14
20
|
ruleFailure: Rule;
|
|
21
|
+
/** The EventBridge rule for successful event deliveries */
|
|
15
22
|
ruleSuccess: Rule;
|
|
16
23
|
}
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* @category Construct
|
|
4
4
|
*/
|
|
5
5
|
export class ApiToEventbridgeTargetEvent {
|
|
6
|
+
/** The EventBridge event bus */
|
|
6
7
|
eventBus;
|
|
8
|
+
/** The CloudWatch log group for event logging */
|
|
7
9
|
logGroup;
|
|
10
|
+
/** The CloudWatch log group for failed event deliveries */
|
|
8
11
|
logGroupFailure;
|
|
12
|
+
/** The CloudWatch log group for successful event deliveries */
|
|
9
13
|
logGroupSuccess;
|
|
14
|
+
/** The EventBridge rule for routing events */
|
|
10
15
|
rule;
|
|
16
|
+
/** The EventBridge rule for failed event deliveries */
|
|
11
17
|
ruleFailure;
|
|
18
|
+
/** The EventBridge rule for successful event deliveries */
|
|
12
19
|
ruleSuccess;
|
|
13
20
|
}
|
|
@@ -21,12 +21,24 @@ import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEven
|
|
|
21
21
|
* @category Construct
|
|
22
22
|
*/
|
|
23
23
|
export declare class ApiToEventBridgeTarget extends CommonConstruct {
|
|
24
|
+
/** The API to EventBridge target properties */
|
|
24
25
|
props: ApiToEventBridgeTargetProps;
|
|
26
|
+
/** The scoped id of this construct */
|
|
25
27
|
id: string;
|
|
28
|
+
/** The resolved application secrets from SecretsManager */
|
|
26
29
|
applicationSecrets: ISecret[];
|
|
30
|
+
/** The EventBridge event resources (bus, rules, log groups) */
|
|
27
31
|
apiEvent: ApiToEventBridgeTargetEventType;
|
|
32
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
28
33
|
apiToEventBridgeTargetRestApi: ApiToEventBridgeTargetRestApiType;
|
|
34
|
+
/** The default API resource path name */
|
|
29
35
|
apiResource: string;
|
|
36
|
+
/**
|
|
37
|
+
* @summary Create a new ApiToEventBridgeTarget construct
|
|
38
|
+
* @param parent the parent construct
|
|
39
|
+
* @param id scoped id of the resource
|
|
40
|
+
* @param props the API to EventBridge target properties
|
|
41
|
+
*/
|
|
30
42
|
constructor(parent: Construct, id: string, props: ApiToEventBridgeTargetProps);
|
|
31
43
|
/**
|
|
32
44
|
* @summary Initialise and provision resources
|
|
@@ -25,15 +25,24 @@ import { ApiToEventbridgeTargetEvent } from './event.js';
|
|
|
25
25
|
* @category Construct
|
|
26
26
|
*/
|
|
27
27
|
export class ApiToEventBridgeTarget extends CommonConstruct {
|
|
28
|
+
/** The API to EventBridge target properties */
|
|
28
29
|
props;
|
|
30
|
+
/** The scoped id of this construct */
|
|
29
31
|
id;
|
|
30
|
-
|
|
32
|
+
/** The resolved application secrets from SecretsManager */
|
|
31
33
|
applicationSecrets;
|
|
32
|
-
|
|
34
|
+
/** The EventBridge event resources (bus, rules, log groups) */
|
|
33
35
|
apiEvent;
|
|
34
|
-
|
|
36
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
35
37
|
apiToEventBridgeTargetRestApi;
|
|
38
|
+
/** The default API resource path name */
|
|
36
39
|
apiResource;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Create a new ApiToEventBridgeTarget construct
|
|
42
|
+
* @param parent the parent construct
|
|
43
|
+
* @param id scoped id of the resource
|
|
44
|
+
* @param props the API to EventBridge target properties
|
|
45
|
+
*/
|
|
37
46
|
constructor(parent, id, props) {
|
|
38
47
|
super(parent, id, props);
|
|
39
48
|
this.props = props;
|
|
@@ -9,97 +9,164 @@ import { ITopic } from 'aws-cdk-lib/aws-sns';
|
|
|
9
9
|
import { CommonStackProps } from '../../common/index.js';
|
|
10
10
|
import { AcmProps, EventRuleProps, LambdaProps, LogProps, RestApigProps } from '../../services/index.js';
|
|
11
11
|
/**
|
|
12
|
+
* Type definition for EventBridge event resources used by the {@link ApiToEventBridgeTarget} construct
|
|
12
13
|
*/
|
|
13
14
|
/** @category Interface */
|
|
14
15
|
export interface ApiToEventBridgeTargetEventType {
|
|
16
|
+
/** The EventBridge event bus */
|
|
15
17
|
eventBus: IEventBus;
|
|
18
|
+
/** The CloudWatch log group for event logging */
|
|
16
19
|
logGroup: LogGroup;
|
|
20
|
+
/** The CloudWatch log group for failed event deliveries */
|
|
17
21
|
logGroupFailure: LogGroup;
|
|
22
|
+
/** The CloudWatch log group for successful event deliveries */
|
|
18
23
|
logGroupSuccess: LogGroup;
|
|
24
|
+
/** The EventBridge rule for routing events */
|
|
19
25
|
rule: Rule;
|
|
26
|
+
/** The EventBridge rule for failed event deliveries */
|
|
20
27
|
ruleFailure: Rule;
|
|
28
|
+
/** The EventBridge rule for successful event deliveries */
|
|
21
29
|
ruleSuccess: Rule;
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
32
|
+
* Type definition for REST API resources used by the {@link ApiToEventBridgeTarget} construct
|
|
24
33
|
*/
|
|
25
34
|
/** @category Interface */
|
|
26
35
|
export interface ApiToEventBridgeTargetRestApiType {
|
|
36
|
+
/** The CloudWatch log group for API Gateway access logs */
|
|
27
37
|
accessLogGroup: LogGroup;
|
|
38
|
+
/** The API Gateway REST API */
|
|
28
39
|
api: IRestApi;
|
|
40
|
+
/** The optional API Gateway authorizer */
|
|
29
41
|
authoriser?: IAuthorizer;
|
|
42
|
+
/** The SSL/TLS certificate for the custom domain */
|
|
30
43
|
certificate: ICertificate;
|
|
44
|
+
/** The API Gateway custom domain */
|
|
31
45
|
domain: DomainName;
|
|
46
|
+
/** The API Gateway error response model */
|
|
32
47
|
errorResponseModel: Model;
|
|
48
|
+
/** The Route53 hosted zone for the API domain */
|
|
33
49
|
hostedZone: IHostedZone;
|
|
50
|
+
/** The API Gateway integration with EventBridge */
|
|
34
51
|
integration: Integration;
|
|
52
|
+
/** The API Gateway integration error response mapping */
|
|
35
53
|
integrationErrorResponse: IntegrationResponse;
|
|
54
|
+
/** The API Gateway integration request parameter mappings */
|
|
36
55
|
integrationRequestParameters: {
|
|
37
56
|
[p: string]: string;
|
|
38
57
|
};
|
|
58
|
+
/** The API Gateway integration request template mappings */
|
|
39
59
|
integrationRequestTemplates: {
|
|
40
60
|
[p: string]: string;
|
|
41
61
|
};
|
|
62
|
+
/** The API Gateway integration success response mapping */
|
|
42
63
|
integrationResponse: IntegrationResponse;
|
|
64
|
+
/** The API Gateway resource method */
|
|
43
65
|
method: Method;
|
|
66
|
+
/** The API Gateway method error response */
|
|
44
67
|
methodErrorResponse: MethodResponse;
|
|
68
|
+
/** The API Gateway method success response */
|
|
45
69
|
methodResponse: MethodResponse;
|
|
70
|
+
/** The IAM policy for the API Gateway integration role */
|
|
46
71
|
policy?: PolicyDocument;
|
|
72
|
+
/** The API Gateway resource */
|
|
47
73
|
resource: Resource;
|
|
74
|
+
/** The API Gateway success response model */
|
|
48
75
|
responseModel: Model;
|
|
76
|
+
/** The IAM role for the API Gateway integration */
|
|
49
77
|
role?: Role;
|
|
78
|
+
/** The optional SNS topic for event forwarding */
|
|
50
79
|
topic?: ITopic;
|
|
51
80
|
}
|
|
52
81
|
/**
|
|
82
|
+
* Properties for configuring the REST API in the {@link ApiToEventBridgeTarget} construct
|
|
53
83
|
*/
|
|
54
84
|
/** @category Interface */
|
|
55
85
|
export interface ApiToEventBridgeTargetRestApiProps {
|
|
86
|
+
/** The SSL/TLS certificate configuration */
|
|
56
87
|
certificate: AcmProps;
|
|
88
|
+
/** Custom error response model options */
|
|
57
89
|
errorResponseModel?: ModelOptions;
|
|
90
|
+
/** CloudFormation export name for an existing REST API ID */
|
|
58
91
|
importedRestApiRef?: string;
|
|
92
|
+
/** CloudFormation export name for an existing REST API root resource ID */
|
|
59
93
|
importedRestApiRootResourceRef?: string;
|
|
94
|
+
/** Custom integration error response configuration */
|
|
60
95
|
integrationErrorResponse?: IntegrationResponse;
|
|
96
|
+
/** Custom integration options */
|
|
61
97
|
integrationOptions?: IntegrationOptions;
|
|
98
|
+
/** Custom integration success response configuration */
|
|
62
99
|
integrationResponse?: IntegrationResponse;
|
|
100
|
+
/** Custom method error response configuration */
|
|
63
101
|
methodErrorResponse?: MethodResponse;
|
|
102
|
+
/** Custom method success response configuration */
|
|
64
103
|
methodResponse?: MethodResponse;
|
|
104
|
+
/** The API resource path name */
|
|
65
105
|
resource: string;
|
|
106
|
+
/** Custom success response model options */
|
|
66
107
|
responseModel?: ModelOptions;
|
|
108
|
+
/** REST API configuration properties */
|
|
67
109
|
restApi?: RestApigProps;
|
|
110
|
+
/** Whether to use an existing REST API instead of creating a new one */
|
|
68
111
|
useExisting: boolean;
|
|
112
|
+
/** Whether to create a resource and method on the REST API */
|
|
69
113
|
withResource?: boolean;
|
|
70
114
|
}
|
|
71
115
|
/**
|
|
116
|
+
* Properties for configuring the Lambda function in the {@link ApiToEventBridgeTarget} construct
|
|
72
117
|
*/
|
|
73
118
|
/** @category Interface */
|
|
74
119
|
export interface ApiToEventBridgeTargetLambdaProps {
|
|
120
|
+
/** The Lambda function configuration */
|
|
75
121
|
function: LambdaProps;
|
|
122
|
+
/** The Lambda handler entry point */
|
|
76
123
|
handler?: string;
|
|
124
|
+
/** The Lambda layer source code asset */
|
|
77
125
|
layerSource?: AssetCode;
|
|
126
|
+
/** The Lambda function source code asset */
|
|
78
127
|
source?: AssetCode;
|
|
79
128
|
}
|
|
80
129
|
/**
|
|
130
|
+
* Properties for configuring EventBridge events in the {@link ApiToEventBridgeTarget} construct
|
|
81
131
|
*/
|
|
82
132
|
/** @category Interface */
|
|
83
133
|
export interface ApiToEventBridgeTargetEventProps {
|
|
134
|
+
/** The name of the custom event bus (defaults to 'default') */
|
|
84
135
|
eventBusName?: string;
|
|
136
|
+
/** Log group configuration for event logging */
|
|
85
137
|
logGroup?: LogProps;
|
|
138
|
+
/** Log group configuration for failed event deliveries */
|
|
86
139
|
logGroupFailure?: LogProps;
|
|
140
|
+
/** Log group configuration for successful event deliveries */
|
|
87
141
|
logGroupSuccess?: LogProps;
|
|
142
|
+
/** The EventBridge rule configuration */
|
|
88
143
|
rule: EventRuleProps;
|
|
144
|
+
/** The EventBridge rule configuration for failures */
|
|
89
145
|
ruleFailure: EventRuleProps;
|
|
146
|
+
/** The EventBridge rule configuration for successes */
|
|
90
147
|
ruleSuccess: EventRuleProps;
|
|
91
148
|
}
|
|
92
149
|
/**
|
|
150
|
+
* Properties for configuring an {@link ApiToEventBridgeTarget} construct
|
|
93
151
|
*/
|
|
94
152
|
/** @category Interface */
|
|
95
153
|
export interface ApiToEventBridgeTargetProps extends CommonStackProps {
|
|
154
|
+
/** REST API configuration */
|
|
96
155
|
api: ApiToEventBridgeTargetRestApiProps;
|
|
156
|
+
/** Additional API root paths for base path mappings */
|
|
97
157
|
apiRootPaths?: string[];
|
|
158
|
+
/** The subdomain for the API Gateway custom domain */
|
|
98
159
|
apiSubDomain: string;
|
|
160
|
+
/** EventBridge event configuration */
|
|
99
161
|
event: ApiToEventBridgeTargetEventProps;
|
|
162
|
+
/** Optional Lambda function configuration for event processing */
|
|
100
163
|
lambda?: ApiToEventBridgeTargetLambdaProps;
|
|
164
|
+
/** The application log level */
|
|
101
165
|
logLevel: string;
|
|
166
|
+
/** The Node.js environment (e.g. development, production) */
|
|
102
167
|
nodeEnv: string;
|
|
168
|
+
/** The timezone for the application */
|
|
103
169
|
timezone: string;
|
|
170
|
+
/** Whether to look up an existing hosted zone instead of creating one */
|
|
104
171
|
useExistingHostedZone: boolean;
|
|
105
172
|
}
|
|
@@ -7,11 +7,18 @@ import { ApiDestinedLambdaEnvironment, ApiDestinedLambdaType } from './types.js'
|
|
|
7
7
|
* @category Construct
|
|
8
8
|
*/
|
|
9
9
|
export declare class ApiDestinedLambda implements ApiDestinedLambdaType {
|
|
10
|
+
/** The EventBridge destination for failed Lambda invocations */
|
|
10
11
|
destinationFailure: EventBridgeDestination;
|
|
12
|
+
/** The EventBridge destination for successful Lambda invocations */
|
|
11
13
|
destinationSuccess: EventBridgeDestination;
|
|
14
|
+
/** The environment variables for the Lambda function */
|
|
12
15
|
environment: ApiDestinedLambdaEnvironment;
|
|
16
|
+
/** The Lambda function */
|
|
13
17
|
function: IFunction;
|
|
18
|
+
/** The Lambda layers attached to the function */
|
|
14
19
|
layers: LayerVersion[];
|
|
20
|
+
/** The IAM policy for the Lambda function */
|
|
15
21
|
policy: PolicyDocument;
|
|
22
|
+
/** The IAM role for the Lambda function */
|
|
16
23
|
role: Role;
|
|
17
24
|
}
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
* @category Construct
|
|
4
4
|
*/
|
|
5
5
|
export class ApiDestinedLambda {
|
|
6
|
+
/** The EventBridge destination for failed Lambda invocations */
|
|
6
7
|
destinationFailure;
|
|
8
|
+
/** The EventBridge destination for successful Lambda invocations */
|
|
7
9
|
destinationSuccess;
|
|
10
|
+
/** The environment variables for the Lambda function */
|
|
8
11
|
environment;
|
|
12
|
+
/** The Lambda function */
|
|
9
13
|
function;
|
|
14
|
+
/** The Lambda layers attached to the function */
|
|
10
15
|
layers;
|
|
16
|
+
/** The IAM policy for the Lambda function */
|
|
11
17
|
policy;
|
|
18
|
+
/** The IAM role for the Lambda function */
|
|
12
19
|
role;
|
|
13
20
|
}
|
|
@@ -23,13 +23,26 @@ import { ApiDestinedLambdaType } from './types.js';
|
|
|
23
23
|
* @category Construct
|
|
24
24
|
*/
|
|
25
25
|
export declare class ApiToEventBridgeTargetWithSns extends CommonConstruct {
|
|
26
|
+
/** The API to EventBridge target properties */
|
|
26
27
|
props: ApiToEventBridgeTargetProps;
|
|
28
|
+
/** The scoped id of this construct */
|
|
27
29
|
id: string;
|
|
30
|
+
/** The resolved application secrets from SecretsManager */
|
|
28
31
|
applicationSecrets: ISecret[];
|
|
32
|
+
/** The API destined Lambda resources (function, role, destinations) */
|
|
29
33
|
apiDestinedLambda: ApiDestinedLambdaType;
|
|
34
|
+
/** The EventBridge event resources (bus, rules, log groups) */
|
|
30
35
|
apiEvent: ApiToEventBridgeTargetEventType;
|
|
36
|
+
/** The REST API resources (api, integration, domain, etc.) */
|
|
31
37
|
apiDestinedRestApi: ApiToEventBridgeTargetRestApiType;
|
|
38
|
+
/** The default API resource path name */
|
|
32
39
|
apiResource: string;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Create a new ApiToEventBridgeTargetWithSns construct
|
|
42
|
+
* @param parent the parent construct
|
|
43
|
+
* @param id scoped id of the resource
|
|
44
|
+
* @param props the API to EventBridge target properties
|
|
45
|
+
*/
|
|
33
46
|
constructor(parent: Construct, id: string, props: ApiToEventBridgeTargetProps);
|
|
34
47
|
/**
|
|
35
48
|
* @summary Initialise and provision resources
|