@gradientedge/cdk-utils-aws 2.0.0 → 2.1.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/README.md +31 -0
- package/dist/src/common/construct.d.ts +2 -2
- package/dist/src/common/construct.js +2 -2
- package/dist/src/common/resource-name-formatter.d.ts +1 -0
- package/dist/src/common/resource-name-formatter.js +1 -0
- package/dist/src/common/stack.d.ts +2 -1
- package/dist/src/common/stack.js +2 -1
- package/dist/src/common/types.d.ts +2 -0
- package/dist/src/construct/api-to-any-target/main.d.ts +2 -1
- package/dist/src/construct/api-to-any-target/main.js +2 -1
- package/dist/src/construct/api-to-any-target/target.d.ts +1 -0
- package/dist/src/construct/api-to-any-target/target.js +1 -0
- package/dist/src/construct/api-to-any-target/types.d.ts +4 -0
- package/dist/src/construct/api-to-eventbridge-target/api.d.ts +2 -1
- package/dist/src/construct/api-to-eventbridge-target/api.js +2 -1
- package/dist/src/construct/api-to-eventbridge-target/event.d.ts +2 -1
- package/dist/src/construct/api-to-eventbridge-target/event.js +2 -1
- package/dist/src/construct/api-to-eventbridge-target/main.d.ts +3 -2
- package/dist/src/construct/api-to-eventbridge-target/main.js +3 -2
- package/dist/src/construct/api-to-eventbridge-target/types.d.ts +8 -3
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +2 -1
- package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +2 -1
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -2
- package/dist/src/construct/api-to-eventbridge-target-with-sns/main.js +3 -2
- package/dist/src/construct/api-to-eventbridge-target-with-sns/types.d.ts +2 -0
- package/dist/src/construct/api-to-lambda-target/api.d.ts +2 -1
- package/dist/src/construct/api-to-lambda-target/api.js +2 -1
- package/dist/src/construct/api-to-lambda-target/main.d.ts +1 -0
- package/dist/src/construct/api-to-lambda-target/main.js +1 -0
- package/dist/src/construct/api-to-lambda-target/types.d.ts +3 -0
- package/dist/src/construct/application-configuration/main.d.ts +1 -0
- package/dist/src/construct/application-configuration/main.js +1 -0
- package/dist/src/construct/application-configuration/types.d.ts +1 -0
- package/dist/src/construct/event-handler/handler.d.ts +1 -0
- package/dist/src/construct/event-handler/handler.js +1 -0
- package/dist/src/construct/event-handler/main.d.ts +2 -1
- package/dist/src/construct/event-handler/main.js +2 -1
- package/dist/src/construct/event-handler/types.d.ts +2 -0
- package/dist/src/construct/lambda-with-iam-access/main.d.ts +2 -1
- package/dist/src/construct/lambda-with-iam-access/main.js +2 -1
- package/dist/src/construct/lambda-with-iam-access/types.d.ts +2 -0
- package/dist/src/construct/piped-event-handler/main.d.ts +2 -1
- package/dist/src/construct/piped-event-handler/main.js +2 -1
- package/dist/src/construct/piped-event-handler/types.d.ts +1 -0
- package/dist/src/construct/rest-api-lambda/main.d.ts +3 -2
- package/dist/src/construct/rest-api-lambda/main.js +3 -2
- package/dist/src/construct/rest-api-lambda/types.d.ts +2 -0
- package/dist/src/construct/rest-api-lambda-with-cache/main.d.ts +3 -2
- package/dist/src/construct/rest-api-lambda-with-cache/main.js +3 -2
- package/dist/src/construct/rest-api-lambda-with-cache/types.d.ts +1 -0
- package/dist/src/construct/site-with-ecs-backend/constants.d.ts +1 -0
- package/dist/src/construct/site-with-ecs-backend/constants.js +1 -0
- package/dist/src/construct/site-with-ecs-backend/main.d.ts +2 -1
- package/dist/src/construct/site-with-ecs-backend/main.js +2 -1
- package/dist/src/construct/site-with-ecs-backend/types.d.ts +5 -0
- package/dist/src/construct/site-with-lambda-backend/constants.d.ts +2 -0
- package/dist/src/construct/site-with-lambda-backend/constants.js +2 -0
- package/dist/src/construct/site-with-lambda-backend/main.d.ts +2 -1
- package/dist/src/construct/site-with-lambda-backend/main.js +2 -1
- package/dist/src/construct/site-with-lambda-backend/types.d.ts +5 -0
- package/dist/src/construct/static-asset-deployment/main.d.ts +2 -1
- package/dist/src/construct/static-asset-deployment/main.js +2 -1
- package/dist/src/construct/static-asset-deployment/types.d.ts +3 -0
- package/dist/src/construct/static-site/main.d.ts +2 -1
- package/dist/src/construct/static-site/main.js +2 -1
- package/dist/src/construct/static-site/types.d.ts +1 -0
- package/dist/src/services/api-gateway/main.d.ts +2 -1
- package/dist/src/services/api-gateway/main.js +2 -1
- package/dist/src/services/api-gateway/types.d.ts +2 -0
- package/dist/src/services/appconfig/constants.d.ts +2 -0
- package/dist/src/services/appconfig/constants.js +2 -0
- package/dist/src/services/appconfig/main.d.ts +2 -1
- package/dist/src/services/appconfig/main.js +2 -1
- package/dist/src/services/appconfig/types.d.ts +2 -0
- package/dist/src/services/certificate-manager/main.d.ts +13 -11
- package/dist/src/services/certificate-manager/main.js +13 -11
- package/dist/src/services/certificate-manager/types.d.ts +1 -0
- package/dist/src/services/cloudfront/main.d.ts +2 -1
- package/dist/src/services/cloudfront/main.js +2 -1
- package/dist/src/services/cloudfront/types.d.ts +2 -0
- package/dist/src/services/cloudtrail/main.d.ts +2 -1
- package/dist/src/services/cloudtrail/main.js +2 -1
- package/dist/src/services/cloudtrail/types.d.ts +1 -0
- package/dist/src/services/cloudwatch/logs.d.ts +2 -1
- package/dist/src/services/cloudwatch/logs.js +2 -1
- package/dist/src/services/cloudwatch/main.d.ts +2 -1
- package/dist/src/services/cloudwatch/main.js +2 -1
- package/dist/src/services/cloudwatch/types.d.ts +11 -0
- package/dist/src/services/codebuild/main.d.ts +2 -1
- package/dist/src/services/codebuild/main.js +2 -1
- package/dist/src/services/constants.d.ts +1 -0
- package/dist/src/services/constants.js +1 -0
- package/dist/src/services/dynamodb/main.d.ts +2 -1
- package/dist/src/services/dynamodb/main.js +2 -1
- package/dist/src/services/dynamodb/types.d.ts +2 -0
- package/dist/src/services/elastic-container-registry/main.d.ts +2 -1
- package/dist/src/services/elastic-container-registry/main.js +2 -1
- package/dist/src/services/elastic-container-service/main.d.ts +2 -1
- package/dist/src/services/elastic-container-service/main.js +2 -1
- package/dist/src/services/elastic-container-service/types.d.ts +6 -0
- package/dist/src/services/elastic-file-system/main.d.ts +4 -1
- package/dist/src/services/elastic-file-system/main.js +4 -1
- package/dist/src/services/elastic-file-system/types.d.ts +2 -0
- package/dist/src/services/elastic-kubernetes-service/main.d.ts +2 -1
- package/dist/src/services/elastic-kubernetes-service/main.js +2 -1
- package/dist/src/services/elastic-kubernetes-service/types.d.ts +1 -0
- package/dist/src/services/elasticache/main.d.ts +1 -0
- package/dist/src/services/elasticache/main.js +1 -0
- package/dist/src/services/elasticache/types.d.ts +2 -0
- package/dist/src/services/eventbridge/main.d.ts +3 -2
- package/dist/src/services/eventbridge/main.js +3 -2
- package/dist/src/services/eventbridge/target.d.ts +4 -1
- package/dist/src/services/eventbridge/target.js +3 -1
- package/dist/src/services/eventbridge/types.d.ts +6 -0
- package/dist/src/services/evidently/main.d.ts +2 -1
- package/dist/src/services/evidently/main.js +2 -1
- package/dist/src/services/evidently/types.d.ts +5 -0
- package/dist/src/services/identity-access-management/main.d.ts +2 -1
- package/dist/src/services/identity-access-management/main.js +2 -1
- package/dist/src/services/key-management-service/main.d.ts +2 -1
- package/dist/src/services/key-management-service/main.js +2 -1
- package/dist/src/services/key-management-service/types.d.ts +1 -0
- package/dist/src/services/lambda/main.d.ts +2 -1
- package/dist/src/services/lambda/main.js +2 -1
- package/dist/src/services/lambda/types.d.ts +7 -0
- package/dist/src/services/route53/main.d.ts +2 -1
- package/dist/src/services/route53/main.js +2 -1
- package/dist/src/services/route53/types.d.ts +1 -0
- package/dist/src/services/secrets-manager/main.d.ts +2 -1
- package/dist/src/services/secrets-manager/main.js +2 -1
- package/dist/src/services/secrets-manager/types.d.ts +1 -0
- package/dist/src/services/simple-notification-service/main.d.ts +2 -1
- package/dist/src/services/simple-notification-service/main.js +2 -1
- package/dist/src/services/simple-notification-service/types.d.ts +1 -0
- package/dist/src/services/simple-queue-service/main.d.ts +2 -1
- package/dist/src/services/simple-queue-service/main.js +2 -1
- package/dist/src/services/simple-queue-service/types.d.ts +1 -0
- package/dist/src/services/simple-storage-service/main.d.ts +2 -1
- package/dist/src/services/simple-storage-service/main.js +2 -1
- package/dist/src/services/simple-storage-service/types.d.ts +3 -0
- package/dist/src/services/step-function/main.d.ts +2 -1
- package/dist/src/services/step-function/main.js +2 -1
- package/dist/src/services/step-function/types.d.ts +16 -0
- package/dist/src/services/systems-manager/main.d.ts +4 -2
- package/dist/src/services/systems-manager/main.js +4 -2
- package/dist/src/services/systems-manager/types.d.ts +2 -0
- package/dist/src/services/virtual-private-cloud/ipv6.d.ts +1 -0
- package/dist/src/services/virtual-private-cloud/ipv6.js +1 -0
- package/dist/src/services/virtual-private-cloud/main.d.ts +2 -1
- package/dist/src/services/virtual-private-cloud/main.js +2 -1
- package/dist/src/services/virtual-private-cloud/types.d.ts +1 -0
- package/dist/src/services/web-application-firewall/main.d.ts +2 -1
- package/dist/src/services/web-application-firewall/main.js +2 -1
- package/dist/src/services/web-application-firewall/types.d.ts +2 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.js +4 -0
- package/package.json +17 -5
|
@@ -3,7 +3,7 @@ import { Construct } from 'constructs';
|
|
|
3
3
|
import { EventHandler } from '../event-handler/index.js';
|
|
4
4
|
import { PipedEventHandlerProps } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides a construct to create and deploy an EventBridge Piped Event Handler
|
|
7
7
|
* @example
|
|
8
8
|
* import { PipedEventHandler, PipedEventHandlerProps } '@gradientedge/cdk-utils'
|
|
9
9
|
* import { Construct } from 'constructs'
|
|
@@ -16,6 +16,7 @@ import { PipedEventHandlerProps } from './types.js';
|
|
|
16
16
|
* this.initResources()
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
|
+
* @category Construct
|
|
19
20
|
*/
|
|
20
21
|
export declare class PipedEventHandler extends EventHandler {
|
|
21
22
|
props: PipedEventHandlerProps;
|
|
@@ -2,7 +2,7 @@ import { SqsQueue } from 'aws-cdk-lib/aws-events-targets';
|
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { EventHandler } from '../event-handler/index.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Provides a construct to create and deploy an EventBridge Piped Event Handler
|
|
6
6
|
* @example
|
|
7
7
|
* import { PipedEventHandler, PipedEventHandlerProps } '@gradientedge/cdk-utils'
|
|
8
8
|
* import { Construct } from 'constructs'
|
|
@@ -15,6 +15,7 @@ import { EventHandler } from '../event-handler/index.js';
|
|
|
15
15
|
* this.initResources()
|
|
16
16
|
* }
|
|
17
17
|
* }
|
|
18
|
+
* @category Construct
|
|
18
19
|
*/
|
|
19
20
|
export class PipedEventHandler extends EventHandler {
|
|
20
21
|
props;
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
+
/** @category Interface */
|
|
4
5
|
export interface PipedEventHandlerProps extends EventHandlerProps {
|
|
5
6
|
pipedDlq: QueueProps;
|
|
6
7
|
pipedQueue: QueueProps;
|
|
@@ -8,9 +8,9 @@ import { Construct } from 'constructs';
|
|
|
8
8
|
import { CommonConstruct } from '../../common/index.js';
|
|
9
9
|
import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types.js';
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Provides a construct to create and deploy a RestApi as Lambda
|
|
12
12
|
*
|
|
13
|
-
* <b>Architecture</b><br/> 
|
|
14
14
|
* @example
|
|
15
15
|
* import { RestApiLambda, RestApiLambdaProps } '@gradientedge/cdk-utils'
|
|
16
16
|
* import { Construct } from 'constructs'
|
|
@@ -23,6 +23,7 @@ import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types.js';
|
|
|
23
23
|
* this.initResources()
|
|
24
24
|
* }
|
|
25
25
|
* }
|
|
26
|
+
* @category Construct
|
|
26
27
|
*/
|
|
27
28
|
export declare abstract class RestApiLambda extends CommonConstruct {
|
|
28
29
|
props: RestApiLambdaProps;
|
|
@@ -3,9 +3,9 @@ import { PolicyDocument } from 'aws-cdk-lib/aws-iam';
|
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { CommonConstruct } from '../../common/index.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides a construct to create and deploy a RestApi as Lambda
|
|
7
7
|
*
|
|
8
|
-
* <b>Architecture</b><br/> 
|
|
9
9
|
* @example
|
|
10
10
|
* import { RestApiLambda, RestApiLambdaProps } '@gradientedge/cdk-utils'
|
|
11
11
|
* import { Construct } from 'constructs'
|
|
@@ -18,6 +18,7 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
18
18
|
* this.initResources()
|
|
19
19
|
* }
|
|
20
20
|
* }
|
|
21
|
+
* @category Construct
|
|
21
22
|
*/
|
|
22
23
|
export class RestApiLambda extends CommonConstruct {
|
|
23
24
|
/* restApiLambda props */
|
|
@@ -3,10 +3,12 @@ import { AcmProps, LambdaEnvironment, LambdaProps, LambdaRestApiProps } from '..
|
|
|
3
3
|
import { CommonStackProps } from '../../common/index.js';
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
|
+
/** @category Interface */
|
|
6
7
|
export interface RestApiLambdaEnvironment extends LambdaEnvironment {
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
*/
|
|
11
|
+
/** @category Interface */
|
|
10
12
|
export interface RestApiLambdaProps extends CommonStackProps {
|
|
11
13
|
apiRootPaths?: string[];
|
|
12
14
|
apiSubDomain: string;
|
|
@@ -4,9 +4,9 @@ import { Construct } from 'constructs';
|
|
|
4
4
|
import { RestApiLambda } from '../rest-api-lambda/index.js';
|
|
5
5
|
import { RestApiLambdaWithCacheProps } from './types.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provides a construct to create and deploy a RestApi API as Lambda with Caching
|
|
8
8
|
*
|
|
9
|
-
* <b>Architecture</b><br/> 
|
|
10
10
|
* @example
|
|
11
11
|
* import { RestApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
|
|
12
12
|
* import { Construct } from 'constructs'
|
|
@@ -19,6 +19,7 @@ import { RestApiLambdaWithCacheProps } from './types.js';
|
|
|
19
19
|
* this.initResources()
|
|
20
20
|
* }
|
|
21
21
|
* }
|
|
22
|
+
* @category Construct
|
|
22
23
|
*/
|
|
23
24
|
export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
|
|
24
25
|
props: RestApiLambdaWithCacheProps;
|
|
@@ -5,9 +5,9 @@ import _ from 'lodash';
|
|
|
5
5
|
import { createCfnOutput } from '../../utils/index.js';
|
|
6
6
|
import { RestApiLambda } from '../rest-api-lambda/index.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Provides a construct to create and deploy a RestApi API as Lambda with Caching
|
|
9
9
|
*
|
|
10
|
-
* <b>Architecture</b><br/> 
|
|
11
11
|
* @example
|
|
12
12
|
* import { RestApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
|
|
13
13
|
* import { Construct } from 'constructs'
|
|
@@ -20,6 +20,7 @@ import { RestApiLambda } from '../rest-api-lambda/index.js';
|
|
|
20
20
|
* this.initResources()
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
|
+
* @category Construct
|
|
23
24
|
*/
|
|
24
25
|
export class RestApiLambdaWithCache extends RestApiLambda {
|
|
25
26
|
/* restApiLambdaWithCache props */
|
|
@@ -2,6 +2,7 @@ import { RestApiLambdaProps } from '../rest-api-lambda/index.js';
|
|
|
2
2
|
import { ReplicatedElastiCacheProps, VpcProps } from '../../services/index.js';
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
|
+
/** @category Interface */
|
|
5
6
|
export interface RestApiLambdaWithCacheProps extends RestApiLambdaProps {
|
|
6
7
|
restApiCache: ReplicatedElastiCacheProps;
|
|
7
8
|
restApiVpc: VpcProps;
|
|
@@ -13,7 +13,7 @@ import { Construct } from 'constructs';
|
|
|
13
13
|
import { CommonConstruct } from '../../common/index.js';
|
|
14
14
|
import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBackendProps } from './types.js';
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
17
17
|
* @example
|
|
18
18
|
* import { SiteWithEcsBackend, SiteWithEcsBackendProps } '@gradientedge/cdk-utils'
|
|
19
19
|
* import { Construct } from 'constructs'
|
|
@@ -26,6 +26,7 @@ import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBacken
|
|
|
26
26
|
* this.initResources()
|
|
27
27
|
* }
|
|
28
28
|
* }
|
|
29
|
+
* @category Construct
|
|
29
30
|
*/
|
|
30
31
|
export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
31
32
|
props: SiteWithEcsBackendProps;
|
|
@@ -7,7 +7,7 @@ import { PolicyDocument, PolicyStatement } from 'aws-cdk-lib/aws-iam';
|
|
|
7
7
|
import _ from 'lodash';
|
|
8
8
|
import { CommonConstruct } from '../../common/index.js';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
11
11
|
* @example
|
|
12
12
|
* import { SiteWithEcsBackend, SiteWithEcsBackendProps } '@gradientedge/cdk-utils'
|
|
13
13
|
* import { Construct } from 'constructs'
|
|
@@ -20,6 +20,7 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
20
20
|
* this.initResources()
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
|
+
* @category Construct
|
|
23
24
|
*/
|
|
24
25
|
export class SiteWithEcsBackend extends CommonConstruct {
|
|
25
26
|
/* site properties */
|
|
@@ -5,6 +5,7 @@ import { AcmProps, CloudfrontFunctionProps, DistributionProps, EcsApplicationLoa
|
|
|
5
5
|
import { SiteResponseHeaderPolicyType } from './constants.js';
|
|
6
6
|
/**
|
|
7
7
|
*/
|
|
8
|
+
/** @category Interface */
|
|
8
9
|
export interface SiteWithEcsBackendProps extends CommonStackProps {
|
|
9
10
|
logLevel: string;
|
|
10
11
|
nodeEnv: string;
|
|
@@ -32,16 +33,20 @@ export interface SiteWithEcsBackendProps extends CommonStackProps {
|
|
|
32
33
|
useExistingHostedZone: boolean;
|
|
33
34
|
useExistingVpc: boolean;
|
|
34
35
|
}
|
|
36
|
+
/** @category Interface */
|
|
35
37
|
export interface SiteResponseHeadersStrictTransportSecurity extends ResponseHeadersStrictTransportSecurity {
|
|
36
38
|
accessControlMaxAgeInSeconds: number;
|
|
37
39
|
}
|
|
40
|
+
/** @category Interface */
|
|
38
41
|
export interface SiteSecurityHeadersBehavior extends ResponseSecurityHeadersBehavior {
|
|
39
42
|
strictTransportSecurity: SiteResponseHeadersStrictTransportSecurity;
|
|
40
43
|
}
|
|
44
|
+
/** @category Interface */
|
|
41
45
|
export interface SiteResponseHeadersPolicyProps extends ResponseHeadersPolicyProps {
|
|
42
46
|
securityHeadersBehavior: SiteSecurityHeadersBehavior;
|
|
43
47
|
type: SiteResponseHeaderPolicyType;
|
|
44
48
|
}
|
|
49
|
+
/** @category Interface */
|
|
45
50
|
export interface SiteCachePolicyProps extends CachePolicyProps {
|
|
46
51
|
defaultTtlInSeconds: number;
|
|
47
52
|
minTtlInSeconds: number;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @category Enum */
|
|
1
2
|
export var SiteWithLambdaBackendResponseHeaderPolicyType;
|
|
2
3
|
(function (SiteWithLambdaBackendResponseHeaderPolicyType) {
|
|
3
4
|
SiteWithLambdaBackendResponseHeaderPolicyType["ORIGIN"] = "origin";
|
|
4
5
|
SiteWithLambdaBackendResponseHeaderPolicyType["STATIC"] = "static";
|
|
5
6
|
})(SiteWithLambdaBackendResponseHeaderPolicyType || (SiteWithLambdaBackendResponseHeaderPolicyType = {}));
|
|
7
|
+
/** @category Constant */
|
|
6
8
|
export const LAMBDA_ALIAS_NAME_CURRENT = 'latest';
|
|
@@ -10,7 +10,7 @@ import { Construct } from 'constructs';
|
|
|
10
10
|
import { CommonConstruct } from '../../common/index.js';
|
|
11
11
|
import { SiteWithLambdaBackendCachePolicyProps, SiteWithLambdaBackendProps, SiteWithLambdaBackendResponseHeadersPolicyProps } from './types.js';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
14
14
|
* @example
|
|
15
15
|
* import { SiteWithLambdaBackend, SiteWithLambdaBackendProps } '@gradientedge/cdk-utils'
|
|
16
16
|
* import { Construct } from 'constructs'
|
|
@@ -23,6 +23,7 @@ import { SiteWithLambdaBackendCachePolicyProps, SiteWithLambdaBackendProps, Site
|
|
|
23
23
|
* this.initResources()
|
|
24
24
|
* }
|
|
25
25
|
* }
|
|
26
|
+
* @category Construct
|
|
26
27
|
*/
|
|
27
28
|
export declare class SiteWithLambdaBackend extends CommonConstruct {
|
|
28
29
|
props: SiteWithLambdaBackendProps;
|
|
@@ -7,7 +7,7 @@ import _ from 'lodash';
|
|
|
7
7
|
import { CommonConstruct } from '../../common/index.js';
|
|
8
8
|
import { LAMBDA_ALIAS_NAME_CURRENT } from './constants.js';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
11
11
|
* @example
|
|
12
12
|
* import { SiteWithLambdaBackend, SiteWithLambdaBackendProps } '@gradientedge/cdk-utils'
|
|
13
13
|
* import { Construct } from 'constructs'
|
|
@@ -20,6 +20,7 @@ import { LAMBDA_ALIAS_NAME_CURRENT } from './constants.js';
|
|
|
20
20
|
* this.initResources()
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
|
+
* @category Construct
|
|
23
24
|
*/
|
|
24
25
|
export class SiteWithLambdaBackend extends CommonConstruct {
|
|
25
26
|
/* site properties */
|
|
@@ -4,6 +4,7 @@ import { AcmProps, CloudfrontFunctionProps, DistributionProps, LambdaProps, LogP
|
|
|
4
4
|
import { SiteWithLambdaBackendResponseHeaderPolicyType } from './constants.js';
|
|
5
5
|
/**
|
|
6
6
|
*/
|
|
7
|
+
/** @category Interface */
|
|
7
8
|
export interface SiteWithLambdaBackendProps extends CommonStackProps {
|
|
8
9
|
logLevel: string;
|
|
9
10
|
nodeEnv: string;
|
|
@@ -28,16 +29,20 @@ export interface SiteWithLambdaBackendProps extends CommonStackProps {
|
|
|
28
29
|
useExistingHostedZone: boolean;
|
|
29
30
|
useExistingVpc: boolean;
|
|
30
31
|
}
|
|
32
|
+
/** @category Interface */
|
|
31
33
|
export interface SiteWithLambdaBackendResponseHeadersStrictTransportSecurity extends ResponseHeadersStrictTransportSecurity {
|
|
32
34
|
accessControlMaxAgeInSeconds: number;
|
|
33
35
|
}
|
|
36
|
+
/** @category Interface */
|
|
34
37
|
export interface SiteWithLambdaBackendSecurityHeadersBehavior extends ResponseSecurityHeadersBehavior {
|
|
35
38
|
strictTransportSecurity: SiteWithLambdaBackendResponseHeadersStrictTransportSecurity;
|
|
36
39
|
}
|
|
40
|
+
/** @category Interface */
|
|
37
41
|
export interface SiteWithLambdaBackendResponseHeadersPolicyProps extends ResponseHeadersPolicyProps {
|
|
38
42
|
securityHeadersBehavior: SiteWithLambdaBackendSecurityHeadersBehavior;
|
|
39
43
|
type: SiteWithLambdaBackendResponseHeaderPolicyType;
|
|
40
44
|
}
|
|
45
|
+
/** @category Interface */
|
|
41
46
|
export interface SiteWithLambdaBackendCachePolicyProps extends CachePolicyProps {
|
|
42
47
|
defaultTtlInSeconds: number;
|
|
43
48
|
minTtlInSeconds: number;
|
|
@@ -4,7 +4,7 @@ import { Construct } from 'constructs';
|
|
|
4
4
|
import { CommonConstruct } from '../../common/index.js';
|
|
5
5
|
import { StaticAssetDeploymentProps } from './types.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provides a construct to create and deploy static assets into S3 bucket
|
|
8
8
|
* @example
|
|
9
9
|
* import { StaticAssetDeployment, StaticAssetDeploymentProps } '@gradientedge/cdk-utils'
|
|
10
10
|
* import { Construct } from 'constructs'
|
|
@@ -15,6 +15,7 @@ import { StaticAssetDeploymentProps } from './types.js';
|
|
|
15
15
|
* this.initResources()
|
|
16
16
|
* }
|
|
17
17
|
* }
|
|
18
|
+
* @category Construct
|
|
18
19
|
*/
|
|
19
20
|
export declare class StaticAssetDeployment extends CommonConstruct {
|
|
20
21
|
staticAssetBucket: IBucket;
|
|
@@ -5,7 +5,7 @@ import _ from 'lodash';
|
|
|
5
5
|
import appRoot from 'app-root-path';
|
|
6
6
|
import { CommonConstruct } from '../../common/index.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Provides a construct to create and deploy static assets into S3 bucket
|
|
9
9
|
* @example
|
|
10
10
|
* import { StaticAssetDeployment, StaticAssetDeploymentProps } '@gradientedge/cdk-utils'
|
|
11
11
|
* import { Construct } from 'constructs'
|
|
@@ -16,6 +16,7 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
16
16
|
* this.initResources()
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
|
+
* @category Construct
|
|
19
20
|
*/
|
|
20
21
|
export class StaticAssetDeployment extends CommonConstruct {
|
|
21
22
|
/* construct resources */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BucketDeploymentProps, S3BucketProps } from '../../services/index.js';
|
|
2
2
|
import { CommonStackProps } from '../../common/index.js';
|
|
3
|
+
/** @category Interface */
|
|
3
4
|
export interface AssetExport {
|
|
4
5
|
key: string;
|
|
5
6
|
value: string;
|
|
@@ -9,6 +10,7 @@ export interface AssetExport {
|
|
|
9
10
|
* When value is configured, the construct will invalidate the distribution after the deployment.
|
|
10
11
|
* Use either domainName or distributionId or domainNameRef or distributionIdRef.
|
|
11
12
|
*/
|
|
13
|
+
/** @category Interface */
|
|
12
14
|
export interface StaticCloudFrontDistribution {
|
|
13
15
|
/**
|
|
14
16
|
* @summary The domain name to associate with the bucket.
|
|
@@ -31,6 +33,7 @@ export interface StaticCloudFrontDistribution {
|
|
|
31
33
|
*/
|
|
32
34
|
invalidationPaths: string[];
|
|
33
35
|
}
|
|
36
|
+
/** @category Interface */
|
|
34
37
|
export interface StaticAssetDeploymentProps extends CommonStackProps {
|
|
35
38
|
staticAssetBucket: S3BucketProps;
|
|
36
39
|
staticAssetDeployment: BucketDeploymentProps;
|
|
@@ -6,7 +6,7 @@ import { Construct } from 'constructs';
|
|
|
6
6
|
import { CommonConstruct } from '../../common/index.js';
|
|
7
7
|
import { StaticSiteProps } from './types.js';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Provides a construct to create and deploy a s3 hosted static site
|
|
10
10
|
* @example
|
|
11
11
|
* import { StaticSite, StaticSiteProps } '@gradientedge/cdk-utils'
|
|
12
12
|
* import { Construct } from 'constructs'
|
|
@@ -19,6 +19,7 @@ import { StaticSiteProps } from './types.js';
|
|
|
19
19
|
* this.initResources()
|
|
20
20
|
* }
|
|
21
21
|
* }
|
|
22
|
+
* @category Construct
|
|
22
23
|
*/
|
|
23
24
|
export declare class StaticSite extends CommonConstruct {
|
|
24
25
|
props: StaticSiteProps;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionEventType, } from 'aws-cdk-lib/aws-cloudfront';
|
|
2
2
|
import { CommonConstruct } from '../../common/index.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides a construct to create and deploy a s3 hosted static site
|
|
5
5
|
* @example
|
|
6
6
|
* import { StaticSite, StaticSiteProps } '@gradientedge/cdk-utils'
|
|
7
7
|
* import { Construct } from 'constructs'
|
|
@@ -14,6 +14,7 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
14
14
|
* this.initResources()
|
|
15
15
|
* }
|
|
16
16
|
* }
|
|
17
|
+
* @category Construct
|
|
17
18
|
*/
|
|
18
19
|
export class StaticSite extends CommonConstruct {
|
|
19
20
|
/* static site properties */
|
|
@@ -3,6 +3,7 @@ import { CommonStackProps } from '../../common/index.js';
|
|
|
3
3
|
import { AcmProps, CloudfrontFunctionProps, DistributionProps, S3BucketProps } from '../../services/index.js';
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
|
+
/** @category Interface */
|
|
6
7
|
export interface StaticSiteProps extends CommonStackProps {
|
|
7
8
|
logLevel: string;
|
|
8
9
|
nodeEnv: string;
|
|
@@ -4,7 +4,7 @@ import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
|
4
4
|
import { CommonConstruct } from '../../common/index.js';
|
|
5
5
|
import { LambdaRestApiProps } from './types.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provides operations on AWS API Gateway.
|
|
8
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
9
9
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
10
10
|
* @example
|
|
@@ -19,6 +19,7 @@ import { LambdaRestApiProps } from './types.js';
|
|
|
19
19
|
* }
|
|
20
20
|
* }
|
|
21
21
|
* @see [CDK API Gateway Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html}
|
|
22
|
+
* @category Service
|
|
22
23
|
*/
|
|
23
24
|
export declare class ApiManager {
|
|
24
25
|
/**
|
|
@@ -3,7 +3,7 @@ import { Cors, Deployment, DomainName, EndpointType, LambdaRestApi, LogGroupLogD
|
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { createCfnOutput } from '../../utils/index.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides operations on AWS API Gateway.
|
|
7
7
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
8
8
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
9
9
|
* @example
|
|
@@ -18,6 +18,7 @@ import { createCfnOutput } from '../../utils/index.js';
|
|
|
18
18
|
* }
|
|
19
19
|
* }
|
|
20
20
|
* @see [CDK API Gateway Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html}
|
|
21
|
+
* @category Service
|
|
21
22
|
*/
|
|
22
23
|
export class ApiManager {
|
|
23
24
|
/**
|
|
@@ -2,9 +2,11 @@ import { LambdaRestApiProps as LambdaRestApigProps, RestApiProps } from 'aws-cdk
|
|
|
2
2
|
import { TagProps } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
|
+
/** @category Interface */
|
|
5
6
|
export interface LambdaRestApiProps extends LambdaRestApigProps {
|
|
6
7
|
tags?: TagProps[];
|
|
7
8
|
minCompressionSizeInBytes?: number;
|
|
8
9
|
}
|
|
10
|
+
/** @category Interface */
|
|
9
11
|
export interface RestApigProps extends RestApiProps {
|
|
10
12
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @returns { Map<string, string> } AppConfig extension ARN by region for x84
|
|
3
3
|
*/
|
|
4
|
+
/** @category Constant */
|
|
4
5
|
export declare const ArnsByRegionForX86_64: {
|
|
5
6
|
[region: string]: string;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* @returns { Map<string, string> } AppConfig extension ARN by region for arm64
|
|
9
10
|
*/
|
|
11
|
+
/** @category Constant */
|
|
10
12
|
export declare const ArnsByRegionForArm64: {
|
|
11
13
|
[region: string]: string;
|
|
12
14
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @returns { Map<string, string> } AppConfig extension ARN by region for x84
|
|
3
3
|
*/
|
|
4
|
+
/** @category Constant */
|
|
4
5
|
export const ArnsByRegionForX86_64 = {
|
|
5
6
|
'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:116',
|
|
6
7
|
'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:106',
|
|
@@ -37,6 +38,7 @@ export const ArnsByRegionForX86_64 = {
|
|
|
37
38
|
/**
|
|
38
39
|
* @returns { Map<string, string> } AppConfig extension ARN by region for arm64
|
|
39
40
|
*/
|
|
41
|
+
/** @category Constant */
|
|
40
42
|
export const ArnsByRegionForArm64 = {
|
|
41
43
|
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:72',
|
|
42
44
|
'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:81',
|
|
@@ -3,7 +3,7 @@ import { CommonConstruct } from '../../common/index.js';
|
|
|
3
3
|
import { Architecture } from '../constants.js';
|
|
4
4
|
import { AppConfigProps } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides operations on AWS
|
|
7
7
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
8
8
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
9
9
|
* @example
|
|
@@ -17,6 +17,7 @@ import { AppConfigProps } from './types.js';
|
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
19
|
* @see [CDK AppConfig Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig-readme.html}
|
|
20
|
+
* @category Service
|
|
20
21
|
*/
|
|
21
22
|
export declare class AppConfigManager {
|
|
22
23
|
/**
|
|
@@ -4,7 +4,7 @@ import { createCfnOutput } from '../../utils/index.js';
|
|
|
4
4
|
import { Architecture } from '../constants.js';
|
|
5
5
|
import { ArnsByRegionForArm64, ArnsByRegionForX86_64 } from './constants.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provides operations on AWS
|
|
8
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
9
9
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
10
10
|
* @example
|
|
@@ -18,6 +18,7 @@ import { ArnsByRegionForArm64, ArnsByRegionForX86_64 } from './constants.js';
|
|
|
18
18
|
* }
|
|
19
19
|
* }
|
|
20
20
|
* @see [CDK AppConfig Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig-readme.html}
|
|
21
|
+
* @category Service
|
|
21
22
|
*/
|
|
22
23
|
export class AppConfigManager {
|
|
23
24
|
/**
|
|
@@ -2,11 +2,13 @@ import { CfnApplicationProps, CfnConfigurationProfileProps, CfnDeploymentProps,
|
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
|
+
/** @category Interface */
|
|
5
6
|
export interface AppConfigDeploymentStrategyProps extends DeploymentStrategyProps {
|
|
6
7
|
deploymentStrategyArn?: string;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
*/
|
|
11
|
+
/** @category Interface */
|
|
10
12
|
export interface AppConfigProps {
|
|
11
13
|
application: CfnApplicationProps;
|
|
12
14
|
configurationProfile: CfnConfigurationProfileProps;
|
|
@@ -3,7 +3,7 @@ import { IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
|
3
3
|
import { CommonConstruct } from '../../common/index.js';
|
|
4
4
|
import { AcmProps } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Provides operations on AWS Certificates.
|
|
7
7
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
8
8
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
9
9
|
* @example
|
|
@@ -17,6 +17,7 @@ import { AcmProps } from './types.js';
|
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
19
|
* @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_certificatemanager-readme.html}
|
|
20
|
+
* @category Service
|
|
20
21
|
*/
|
|
21
22
|
export declare class AcmManager {
|
|
22
23
|
/**
|
|
@@ -26,16 +27,17 @@ export declare class AcmManager {
|
|
|
26
27
|
* @param props certificate props
|
|
27
28
|
* @param hostedZone optional hosted zone to perform DNS validation
|
|
28
29
|
* @returns the resolved certificate
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
30
|
+
* ```mermaid
|
|
31
|
+
* graph LR;
|
|
32
|
+
* A((Start)) --> B{Valid Properties?};
|
|
33
|
+
* B -- Yes --> C(Fetch By ARN);
|
|
34
|
+
* B -- No --> D[Throw Error];
|
|
35
|
+
* D --> G((Stop));
|
|
36
|
+
* C --> E{Valid ARN?};
|
|
37
|
+
* E -- Yes --> F(Return Certificate);
|
|
38
|
+
* E -- No --> D;
|
|
39
|
+
* F --> G;
|
|
40
|
+
* ```
|
|
39
41
|
*/
|
|
40
42
|
resolveCertificate(id: string, scope: CommonConstruct, props: AcmProps, hostedZone?: IHostedZone): ICertificate;
|
|
41
43
|
}
|
|
@@ -2,7 +2,7 @@ import { Stack } from 'aws-cdk-lib';
|
|
|
2
2
|
import { Certificate, CertificateValidation } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3
3
|
import { createCfnOutput } from '../../utils/index.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Provides operations on AWS Certificates.
|
|
6
6
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
7
7
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
8
8
|
* @example
|
|
@@ -16,6 +16,7 @@ import { createCfnOutput } from '../../utils/index.js';
|
|
|
16
16
|
* }
|
|
17
17
|
* }
|
|
18
18
|
* @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_certificatemanager-readme.html}
|
|
19
|
+
* @category Service
|
|
19
20
|
*/
|
|
20
21
|
export class AcmManager {
|
|
21
22
|
/**
|
|
@@ -25,16 +26,17 @@ export class AcmManager {
|
|
|
25
26
|
* @param props certificate props
|
|
26
27
|
* @param hostedZone optional hosted zone to perform DNS validation
|
|
27
28
|
* @returns the resolved certificate
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
29
|
+
* ```mermaid
|
|
30
|
+
* graph LR;
|
|
31
|
+
* A((Start)) --> B{Valid Properties?};
|
|
32
|
+
* B -- Yes --> C(Fetch By ARN);
|
|
33
|
+
* B -- No --> D[Throw Error];
|
|
34
|
+
* D --> G((Stop));
|
|
35
|
+
* C --> E{Valid ARN?};
|
|
36
|
+
* E -- Yes --> F(Return Certificate);
|
|
37
|
+
* E -- No --> D;
|
|
38
|
+
* F --> G;
|
|
39
|
+
* ```
|
|
38
40
|
*/
|
|
39
41
|
resolveCertificate(id, scope, props, hostedZone) {
|
|
40
42
|
if (!props)
|