@gradientedge/cdk-utils 8.91.0 → 8.93.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/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +1 -19
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +2 -20
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +2 -20
- package/src/lib/construct/rest-api-lambda/types.ts +6 -10
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
|
@@ -27,9 +27,6 @@ exports.CodeBuildManager = void 0;
|
|
|
27
27
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
28
28
|
const codebuild = __importStar(require("aws-cdk-lib/aws-codebuild"));
|
|
29
29
|
/**
|
|
30
|
-
* @stability stable
|
|
31
|
-
* @category cdk-utils.codebuild-manager
|
|
32
|
-
* @subcategory Construct
|
|
33
30
|
* @classdesc Provides operations on AWS Code Build.
|
|
34
31
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
35
32
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -43,7 +40,6 @@ const codebuild = __importStar(require("aws-cdk-lib/aws-codebuild"));
|
|
|
43
40
|
* this.codeBuildManager.createImageForCloudfrontInvalidation('MyInvalidation', this, './docker ')
|
|
44
41
|
* }
|
|
45
42
|
* }
|
|
46
|
-
*
|
|
47
43
|
* @see [CDK Codebuild Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild-readme.html}
|
|
48
44
|
*/
|
|
49
45
|
class CodeBuildManager {
|
|
@@ -67,9 +63,7 @@ class CodeBuildManager {
|
|
|
67
63
|
createProjectForCloudfrontInvalidation(id, scope, dockerFilepath, distributionId, paths) {
|
|
68
64
|
const invalidationPaths = paths ?? '/*';
|
|
69
65
|
return new codebuild.Project(scope, `${id}-install-deps-project`, {
|
|
70
|
-
role: scope.iamManager.roleForCloudfrontInvalidation(id, scope),
|
|
71
66
|
buildSpec: codebuild.BuildSpec.fromObject({
|
|
72
|
-
version: '0.1',
|
|
73
67
|
phases: {
|
|
74
68
|
build: {
|
|
75
69
|
commands: [
|
|
@@ -77,6 +71,7 @@ class CodeBuildManager {
|
|
|
77
71
|
],
|
|
78
72
|
},
|
|
79
73
|
},
|
|
74
|
+
version: '0.1',
|
|
80
75
|
}),
|
|
81
76
|
environment: {
|
|
82
77
|
buildImage: codebuild.LinuxBuildImage.fromDockerRegistry(this.createImageForCloudfrontInvalidation(id, scope, dockerFilepath).imageUri),
|
|
@@ -85,12 +80,13 @@ class CodeBuildManager {
|
|
|
85
80
|
},
|
|
86
81
|
logging: {
|
|
87
82
|
cloudWatch: {
|
|
83
|
+
enabled: true,
|
|
88
84
|
logGroup: scope.logManager.createLogGroup(`${id}-project-log-group`, scope, {
|
|
89
85
|
logGroupName: `${id}-cloudfront-invalidation`,
|
|
90
86
|
}),
|
|
91
|
-
enabled: true,
|
|
92
87
|
},
|
|
93
88
|
},
|
|
89
|
+
role: scope.iamManager.roleForCloudfrontInvalidation(id, scope),
|
|
94
90
|
timeout: cdk.Duration.minutes(5),
|
|
95
91
|
});
|
|
96
92
|
}
|
|
@@ -2,9 +2,6 @@ import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
import { TableProps } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.dynamodb-manager
|
|
7
|
-
* @subcategory Construct
|
|
8
5
|
* @classdesc Provides operations on AWS DynamoDB.
|
|
9
6
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
10
7
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -18,15 +15,14 @@ import { TableProps } from './types';
|
|
|
18
15
|
* this.dynamodbManager.createTable('MyTable', this, tableProps)
|
|
19
16
|
* }
|
|
20
17
|
* }
|
|
21
|
-
*
|
|
22
18
|
* @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb-readme.html}
|
|
23
19
|
*/
|
|
24
20
|
export declare class DynamodbManager {
|
|
25
21
|
/**
|
|
26
22
|
* @summary Method to create a table
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
23
|
+
* @param id scoped id of the resource
|
|
24
|
+
* @param scope scope in which this resource is defined
|
|
25
|
+
* @param props table props
|
|
30
26
|
*/
|
|
31
27
|
createTable(id: string, scope: CommonConstruct, props: TableProps): dynamodb.Table;
|
|
32
28
|
}
|
|
@@ -28,9 +28,6 @@ const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
|
|
|
28
28
|
const utils = __importStar(require("../../../utils"));
|
|
29
29
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
30
30
|
/**
|
|
31
|
-
* @stability stable
|
|
32
|
-
* @category cdk-utils.dynamodb-manager
|
|
33
|
-
* @subcategory Construct
|
|
34
31
|
* @classdesc Provides operations on AWS DynamoDB.
|
|
35
32
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
36
33
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -44,37 +41,36 @@ const cdk = __importStar(require("aws-cdk-lib"));
|
|
|
44
41
|
* this.dynamodbManager.createTable('MyTable', this, tableProps)
|
|
45
42
|
* }
|
|
46
43
|
* }
|
|
47
|
-
*
|
|
48
44
|
* @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb-readme.html}
|
|
49
45
|
*/
|
|
50
46
|
class DynamodbManager {
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create a table
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param props table props
|
|
56
52
|
*/
|
|
57
53
|
createTable(id, scope, props) {
|
|
58
54
|
if (!props)
|
|
59
55
|
throw `Table props undefined for ${id}`;
|
|
60
56
|
const table = new dynamodb.Table(scope, `${id}`, {
|
|
61
|
-
tableName: `${props.tableName}-${scope.props.stage}`,
|
|
62
|
-
partitionKey: props.partitionKey,
|
|
63
|
-
sortKey: props.sortKey,
|
|
64
|
-
kinesisStream: props.kinesisStream,
|
|
65
|
-
readCapacity: props.readCapacity,
|
|
66
|
-
writeCapacity: props.writeCapacity,
|
|
67
57
|
billingMode: props.billingMode,
|
|
68
|
-
|
|
58
|
+
contributorInsightsEnabled: props.contributorInsightsEnabled,
|
|
69
59
|
encryption: props.encryption,
|
|
70
60
|
encryptionKey: props.encryptionKey,
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
kinesisStream: props.kinesisStream,
|
|
62
|
+
partitionKey: props.partitionKey,
|
|
63
|
+
pointInTimeRecovery: props.pointInTimeRecovery,
|
|
64
|
+
readCapacity: props.readCapacity,
|
|
73
65
|
removalPolicy: props.removalPolicy,
|
|
74
66
|
replicationRegions: props.replicationRegions,
|
|
75
67
|
replicationTimeout: props.replicationTimeout,
|
|
68
|
+
sortKey: props.sortKey,
|
|
69
|
+
stream: props.stream,
|
|
70
|
+
tableName: `${props.tableName}-${scope.props.stage}`,
|
|
71
|
+
timeToLiveAttribute: props.timeToLiveAttribute,
|
|
76
72
|
waitForReplicationToFinish: props.waitForReplicationToFinish,
|
|
77
|
-
|
|
73
|
+
writeCapacity: props.writeCapacity,
|
|
78
74
|
});
|
|
79
75
|
if (props.tags && props.tags.length > 0) {
|
|
80
76
|
props.tags.forEach(tag => {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
/**
|
|
4
|
-
* @stability stable
|
|
5
|
-
* @category cdk-utils.ecr-manager
|
|
6
|
-
* @subcategory Construct
|
|
7
4
|
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
8
5
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
9
6
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -17,15 +14,14 @@ import { CommonConstruct } from '../../../common';
|
|
|
17
14
|
* this.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
|
|
18
15
|
* }
|
|
19
16
|
* }
|
|
20
|
-
*
|
|
21
17
|
* @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
|
|
22
18
|
*/
|
|
23
19
|
export declare class EcrManager {
|
|
24
20
|
/**
|
|
25
21
|
* @summary Method to create a docker image in ecr
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
22
|
+
* @param id scoped id of the resource
|
|
23
|
+
* @param scope scope in which this resource is defined
|
|
24
|
+
* @param dockerfilePath
|
|
29
25
|
*/
|
|
30
26
|
createDockerImage(id: string, scope: CommonConstruct, dockerfilePath: string): ecr.DockerImageAsset;
|
|
31
27
|
}
|
|
@@ -27,9 +27,6 @@ exports.EcrManager = void 0;
|
|
|
27
27
|
const ecr = __importStar(require("aws-cdk-lib/aws-ecr-assets"));
|
|
28
28
|
const utils = __importStar(require("../../../utils"));
|
|
29
29
|
/**
|
|
30
|
-
* @stability stable
|
|
31
|
-
* @category cdk-utils.ecr-manager
|
|
32
|
-
* @subcategory Construct
|
|
33
30
|
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
34
31
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
35
32
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -43,15 +40,14 @@ const utils = __importStar(require("../../../utils"));
|
|
|
43
40
|
* this.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
|
|
44
41
|
* }
|
|
45
42
|
* }
|
|
46
|
-
*
|
|
47
43
|
* @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
|
|
48
44
|
*/
|
|
49
45
|
class EcrManager {
|
|
50
46
|
/**
|
|
51
47
|
* @summary Method to create a docker image in ecr
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
48
|
+
* @param id scoped id of the resource
|
|
49
|
+
* @param scope scope in which this resource is defined
|
|
50
|
+
* @param dockerfilePath
|
|
55
51
|
*/
|
|
56
52
|
createDockerImage(id, scope, dockerfilePath) {
|
|
57
53
|
const asset = new ecr.DockerImageAsset(scope, `${id}`, {
|
|
@@ -6,9 +6,6 @@ import * as logs from 'aws-cdk-lib/aws-logs';
|
|
|
6
6
|
import { CommonConstruct } from '../../../common';
|
|
7
7
|
import { EcsApplicationLoadBalancedFargateServiceProps, EcsClusterProps, EcsTaskProps } from './types';
|
|
8
8
|
/**
|
|
9
|
-
* @stability stable
|
|
10
|
-
* @category cdk-utils.ecs-manager
|
|
11
|
-
* @subcategory Construct
|
|
12
9
|
* @classdesc Provides operations on AWS Elastic Container Service.
|
|
13
10
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
14
11
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -22,39 +19,38 @@ import { EcsApplicationLoadBalancedFargateServiceProps, EcsClusterProps, EcsTask
|
|
|
22
19
|
* this.ecsManager.createEcsCluster('MyCluster', this, vpc)
|
|
23
20
|
* }
|
|
24
21
|
* }
|
|
25
|
-
*
|
|
26
22
|
* @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
|
|
27
23
|
*/
|
|
28
24
|
export declare class EcsManager {
|
|
29
25
|
/**
|
|
30
26
|
* @summary Method to create an ecs cluster
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
27
|
+
* @param id scoped id of the resource
|
|
28
|
+
* @param scope scope in which this resource is defined
|
|
29
|
+
* @param props
|
|
30
|
+
* @param vpc
|
|
35
31
|
*/
|
|
36
32
|
createEcsCluster(id: string, scope: CommonConstruct, props: EcsClusterProps, vpc: ec2.IVpc): cdk.aws_ecs.Cluster;
|
|
37
33
|
/**
|
|
38
34
|
* @summary Method to create an ecs fargate task
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
35
|
+
* @param id scoped id of the resource
|
|
36
|
+
* @param scope scope in which this resource is defined
|
|
37
|
+
* @param props
|
|
38
|
+
* @param cluster
|
|
39
|
+
* @param role
|
|
40
|
+
* @param logGroup
|
|
41
|
+
* @param containerImage
|
|
42
|
+
* @param environment
|
|
43
|
+
* @param secrets
|
|
44
|
+
* @param command
|
|
49
45
|
*/
|
|
50
46
|
createEcsFargateTask(id: string, scope: CommonConstruct, props: EcsTaskProps, cluster: ecs.ICluster, role: iam.Role, logGroup: logs.ILogGroup, containerImage: ecs.ContainerImage, environment?: any, secrets?: any, command?: string[]): cdk.aws_ecs.TaskDefinition;
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create an application loadbalanced ecs fargate task
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param props
|
|
52
|
+
* @param cluster
|
|
53
|
+
* @param logGroup
|
|
58
54
|
*/
|
|
59
55
|
createLoadBalancedFargateService(id: string, scope: CommonConstruct, props: EcsApplicationLoadBalancedFargateServiceProps, cluster: ecs.ICluster, logGroup: logs.ILogGroup): cdk.aws_ecs_patterns.ApplicationLoadBalancedFargateService;
|
|
60
56
|
}
|
|
@@ -29,9 +29,6 @@ const ecs = __importStar(require("aws-cdk-lib/aws-ecs"));
|
|
|
29
29
|
const ecsPatterns = __importStar(require("aws-cdk-lib/aws-ecs-patterns"));
|
|
30
30
|
const utils = __importStar(require("../../../utils"));
|
|
31
31
|
/**
|
|
32
|
-
* @stability stable
|
|
33
|
-
* @category cdk-utils.ecs-manager
|
|
34
|
-
* @subcategory Construct
|
|
35
32
|
* @classdesc Provides operations on AWS Elastic Container Service.
|
|
36
33
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
37
34
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -45,28 +42,27 @@ const utils = __importStar(require("../../../utils"));
|
|
|
45
42
|
* this.ecsManager.createEcsCluster('MyCluster', this, vpc)
|
|
46
43
|
* }
|
|
47
44
|
* }
|
|
48
|
-
*
|
|
49
45
|
* @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
|
|
50
46
|
*/
|
|
51
47
|
class EcsManager {
|
|
52
48
|
/**
|
|
53
49
|
* @summary Method to create an ecs cluster
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
50
|
+
* @param id scoped id of the resource
|
|
51
|
+
* @param scope scope in which this resource is defined
|
|
52
|
+
* @param props
|
|
53
|
+
* @param vpc
|
|
58
54
|
*/
|
|
59
55
|
createEcsCluster(id, scope, props, vpc) {
|
|
60
56
|
if (!props)
|
|
61
57
|
throw `Ecs Cluster props undefined for ${id}`;
|
|
62
58
|
const ecsCluster = new ecs.Cluster(scope, `${id}`, {
|
|
59
|
+
capacity: props.capacity,
|
|
63
60
|
clusterName: `${props.clusterName}-${scope.props.stage}`,
|
|
64
|
-
|
|
61
|
+
containerInsights: props.containerInsights,
|
|
65
62
|
defaultCloudMapNamespace: props.defaultCloudMapNamespace,
|
|
66
|
-
capacity: props.capacity,
|
|
67
63
|
enableFargateCapacityProviders: props.enableFargateCapacityProviders,
|
|
68
|
-
containerInsights: props.containerInsights,
|
|
69
64
|
executeCommandConfiguration: props.executeCommandConfiguration,
|
|
65
|
+
vpc: vpc,
|
|
70
66
|
});
|
|
71
67
|
if (props.tags && props.tags.length > 0) {
|
|
72
68
|
props.tags.forEach(tag => {
|
|
@@ -79,16 +75,16 @@ class EcsManager {
|
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
77
|
* @summary Method to create an ecs fargate task
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
78
|
+
* @param id scoped id of the resource
|
|
79
|
+
* @param scope scope in which this resource is defined
|
|
80
|
+
* @param props
|
|
81
|
+
* @param cluster
|
|
82
|
+
* @param role
|
|
83
|
+
* @param logGroup
|
|
84
|
+
* @param containerImage
|
|
85
|
+
* @param environment
|
|
86
|
+
* @param secrets
|
|
87
|
+
* @param command
|
|
92
88
|
*/
|
|
93
89
|
createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment, secrets, command) {
|
|
94
90
|
if (!props)
|
|
@@ -99,35 +95,35 @@ class EcsManager {
|
|
|
99
95
|
ephemeralStorageGiB: props.ephemeralStorageGiB,
|
|
100
96
|
executionRole: role,
|
|
101
97
|
family: `${props.family}-${scope.props.stage}`,
|
|
102
|
-
ipcMode: props.ipcMode,
|
|
103
98
|
inferenceAccelerators: props.inferenceAccelerators,
|
|
99
|
+
ipcMode: props.ipcMode,
|
|
104
100
|
memoryMiB: props.memoryMiB,
|
|
105
101
|
networkMode: ecs.NetworkMode.AWS_VPC,
|
|
106
102
|
pidMode: props.pidMode,
|
|
107
103
|
placementConstraints: props.placementConstraints,
|
|
108
104
|
proxyConfiguration: props.proxyConfiguration,
|
|
109
105
|
runtimePlatform: {
|
|
110
|
-
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
|
|
111
106
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? ecs.CpuArchitecture.X86_64,
|
|
107
|
+
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
|
|
112
108
|
},
|
|
113
109
|
taskRole: role,
|
|
114
110
|
volumes: props.volumes,
|
|
115
111
|
});
|
|
116
112
|
ecsTask.addContainer('EcsContainer', {
|
|
113
|
+
command: command,
|
|
117
114
|
cpu: props.cpu ? parseInt(props.cpu) : undefined,
|
|
118
115
|
disableNetworking: false,
|
|
119
116
|
environment: environment,
|
|
120
117
|
image: containerImage,
|
|
121
118
|
logging: ecs.LogDriver.awsLogs({
|
|
122
119
|
logGroup: logGroup,
|
|
123
|
-
streamPrefix: `${id}`,
|
|
124
|
-
multilinePattern: props.logging?.multilinePattern,
|
|
125
120
|
logRetention: props.logging?.logRetention,
|
|
121
|
+
multilinePattern: props.logging?.multilinePattern,
|
|
122
|
+
streamPrefix: `${id}`,
|
|
126
123
|
}),
|
|
127
124
|
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
128
125
|
privileged: false,
|
|
129
126
|
secrets: secrets,
|
|
130
|
-
command: command,
|
|
131
127
|
});
|
|
132
128
|
if (props.tags && props.tags.length > 0) {
|
|
133
129
|
props.tags.forEach(tag => {
|
|
@@ -139,11 +135,11 @@ class EcsManager {
|
|
|
139
135
|
}
|
|
140
136
|
/**
|
|
141
137
|
* @summary Method to create an application loadbalanced ecs fargate task
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
138
|
+
* @param id scoped id of the resource
|
|
139
|
+
* @param scope scope in which this resource is defined
|
|
140
|
+
* @param props
|
|
141
|
+
* @param cluster
|
|
142
|
+
* @param logGroup
|
|
147
143
|
*/
|
|
148
144
|
createLoadBalancedFargateService(id, scope, props, cluster, logGroup) {
|
|
149
145
|
if (!props)
|
|
@@ -164,25 +160,25 @@ class EcsManager {
|
|
|
164
160
|
loadBalancerName: `${id}-${scope.props.stage}`,
|
|
165
161
|
memoryLimitMiB: props.memoryLimitMiB,
|
|
166
162
|
runtimePlatform: {
|
|
167
|
-
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
|
|
168
163
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? ecs.CpuArchitecture.X86_64,
|
|
164
|
+
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? ecs.OperatingSystemFamily.LINUX,
|
|
169
165
|
},
|
|
170
166
|
serviceName: `${id}-${scope.props.stage}`,
|
|
171
167
|
taskImageOptions: {
|
|
168
|
+
containerPort: props.taskImageOptions?.containerPort,
|
|
172
169
|
enableLogging: props.taskImageOptions?.enableLogging ?? true,
|
|
170
|
+
environment: props.taskImageOptions?.environment,
|
|
171
|
+
executionRole: props.taskImageOptions?.executionRole,
|
|
172
|
+
image: props.taskImageOptions.image,
|
|
173
173
|
logDriver: props.taskImageOptions?.logDriver ??
|
|
174
174
|
ecs.LogDriver.awsLogs({
|
|
175
175
|
logGroup: logGroup,
|
|
176
|
-
streamPrefix: `${id}-${scope.props.stage}/ecs`,
|
|
177
|
-
multilinePattern: props.logging?.multilinePattern,
|
|
178
176
|
logRetention: props.logging?.logRetention,
|
|
177
|
+
multilinePattern: props.logging?.multilinePattern,
|
|
178
|
+
streamPrefix: `${id}-${scope.props.stage}/ecs`,
|
|
179
179
|
}),
|
|
180
|
-
image: props.taskImageOptions.image,
|
|
181
|
-
executionRole: props.taskImageOptions?.executionRole,
|
|
182
|
-
taskRole: props.taskImageOptions?.taskRole,
|
|
183
|
-
containerPort: props.taskImageOptions?.containerPort,
|
|
184
|
-
environment: props.taskImageOptions?.environment,
|
|
185
180
|
secrets: props.taskImageOptions?.secrets,
|
|
181
|
+
taskRole: props.taskImageOptions?.taskRole,
|
|
186
182
|
},
|
|
187
183
|
});
|
|
188
184
|
if (props.healthCheck) {
|
|
@@ -4,39 +4,31 @@ import { ScalingSchedule } from 'aws-cdk-lib/aws-applicationautoscaling';
|
|
|
4
4
|
import { ApplicationLoadBalancedFargateServiceProps } from 'aws-cdk-lib/aws-ecs-patterns';
|
|
5
5
|
import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
6
6
|
/**
|
|
7
|
-
* @category cdk-utils.ecs-manager
|
|
8
|
-
* @subcategory Properties
|
|
9
7
|
*/
|
|
10
8
|
export interface EcsClusterProps extends ClusterProps {
|
|
11
9
|
tags?: TagProps[];
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
|
-
* @category cdk-utils.ecs-manager
|
|
15
|
-
* @subcategory Properties
|
|
16
12
|
*/
|
|
17
13
|
export interface EcsTaskProps extends TaskDefinitionProps {
|
|
18
14
|
logging?: AwsLogDriverProps;
|
|
19
15
|
tags?: TagProps[];
|
|
20
16
|
}
|
|
21
17
|
export interface EcsScalingProps {
|
|
22
|
-
minCapacity?: number;
|
|
23
18
|
maxCapacity?: number;
|
|
19
|
+
minCapacity?: number;
|
|
24
20
|
scaleOnCpuUtilization?: number;
|
|
25
21
|
scaleOnMemoryUtilization?: number;
|
|
26
22
|
scaleOnRequestsPerTarget?: number;
|
|
27
23
|
scaleOnSchedule?: ScalingSchedule;
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
|
-
* @category cdk-utils.site-with-ecs-backend
|
|
31
|
-
* @subcategory Properties
|
|
32
26
|
*/
|
|
33
27
|
export interface HealthCheck extends elb.HealthCheck {
|
|
34
28
|
intervalInSecs: number;
|
|
35
29
|
timeoutInSecs: number;
|
|
36
30
|
}
|
|
37
31
|
/**
|
|
38
|
-
* @category cdk-utils.ecs-manager
|
|
39
|
-
* @subcategory Properties
|
|
40
32
|
*/
|
|
41
33
|
export interface EcsApplicationLoadBalancedFargateServiceProps extends ApplicationLoadBalancedFargateServiceProps {
|
|
42
34
|
healthCheck?: HealthCheck;
|
|
@@ -3,18 +3,15 @@ import * as efs from 'aws-cdk-lib/aws-efs';
|
|
|
3
3
|
import { CommonConstruct } from '../../../common';
|
|
4
4
|
import { EfsAccessPointOptions, EfsFileSystemProps } from './types';
|
|
5
5
|
export declare const DEFAULT_CREATE_ACL: {
|
|
6
|
-
ownerUid: string;
|
|
7
6
|
ownerGid: string;
|
|
7
|
+
ownerUid: string;
|
|
8
8
|
permissions: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const DEFAULT_POSIX_USER: {
|
|
11
|
-
uid: string;
|
|
12
11
|
gid: string;
|
|
12
|
+
uid: string;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* @stability stable
|
|
16
|
-
* @category cdk-utils.efs-manager
|
|
17
|
-
* @subcategory Construct
|
|
18
15
|
* @classdesc Provides operations on AWS Elastic File System.
|
|
19
16
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
20
17
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -28,19 +25,18 @@ export declare const DEFAULT_POSIX_USER: {
|
|
|
28
25
|
* this.efsManager.createFileSystem('MyFileSystem', this, fileSystemProps, vpc)
|
|
29
26
|
* }
|
|
30
27
|
* }
|
|
31
|
-
*
|
|
32
28
|
* @see [CDK EFS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_efs-readme.html}
|
|
33
29
|
*/
|
|
34
30
|
export declare class EfsManager {
|
|
35
31
|
/**
|
|
36
32
|
* @summary Method to create an efs file system
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
33
|
+
* @param id scoped id of the resource
|
|
34
|
+
* @param scope scope in which this resource is defined
|
|
35
|
+
* @param props the file system props
|
|
36
|
+
* @param vpc the vpc to use for the file system
|
|
37
|
+
* @param accessPointOptions optional access point configuration options for the file system
|
|
38
|
+
* @param securityGroup optional security groups to configure for the file system
|
|
39
|
+
* @param vpcSubnets optional subnets to configure for the file system
|
|
44
40
|
*/
|
|
45
41
|
createFileSystem(id: string, scope: CommonConstruct, props: EfsFileSystemProps, vpc: ec2.IVpc, accessPointOptions?: EfsAccessPointOptions[], securityGroup?: ec2.ISecurityGroup, vpcSubnets?: ec2.SubnetSelection): efs.FileSystem;
|
|
46
42
|
}
|
|
@@ -28,18 +28,15 @@ const efs = __importStar(require("aws-cdk-lib/aws-efs"));
|
|
|
28
28
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
29
29
|
const utils = __importStar(require("../../../utils"));
|
|
30
30
|
exports.DEFAULT_CREATE_ACL = {
|
|
31
|
-
ownerUid: '1000',
|
|
32
31
|
ownerGid: '1000',
|
|
32
|
+
ownerUid: '1000',
|
|
33
33
|
permissions: '755',
|
|
34
34
|
};
|
|
35
35
|
exports.DEFAULT_POSIX_USER = {
|
|
36
|
-
uid: '1000',
|
|
37
36
|
gid: '1000',
|
|
37
|
+
uid: '1000',
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
* @stability stable
|
|
41
|
-
* @category cdk-utils.efs-manager
|
|
42
|
-
* @subcategory Construct
|
|
43
40
|
* @classdesc Provides operations on AWS Elastic File System.
|
|
44
41
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
45
42
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -53,19 +50,18 @@ exports.DEFAULT_POSIX_USER = {
|
|
|
53
50
|
* this.efsManager.createFileSystem('MyFileSystem', this, fileSystemProps, vpc)
|
|
54
51
|
* }
|
|
55
52
|
* }
|
|
56
|
-
*
|
|
57
53
|
* @see [CDK EFS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_efs-readme.html}
|
|
58
54
|
*/
|
|
59
55
|
class EfsManager {
|
|
60
56
|
/**
|
|
61
57
|
* @summary Method to create an efs file system
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
58
|
+
* @param id scoped id of the resource
|
|
59
|
+
* @param scope scope in which this resource is defined
|
|
60
|
+
* @param props the file system props
|
|
61
|
+
* @param vpc the vpc to use for the file system
|
|
62
|
+
* @param accessPointOptions optional access point configuration options for the file system
|
|
63
|
+
* @param securityGroup optional security groups to configure for the file system
|
|
64
|
+
* @param vpcSubnets optional subnets to configure for the file system
|
|
69
65
|
*/
|
|
70
66
|
createFileSystem(id, scope, props, vpc, accessPointOptions, securityGroup, vpcSubnets) {
|
|
71
67
|
if (!props)
|
|
@@ -73,14 +69,14 @@ class EfsManager {
|
|
|
73
69
|
const fileSystemId = props.provisionNewOnDeployment ? `${id}-${new Date().getMilliseconds()}` : `${id}`;
|
|
74
70
|
const fileSystem = new efs.FileSystem(scope, `${fileSystemId}`, {
|
|
75
71
|
...props,
|
|
76
|
-
vpc,
|
|
77
|
-
securityGroup,
|
|
78
|
-
vpcSubnets,
|
|
79
72
|
fileSystemName: props.fileSystemName ? `${props.fileSystemName}-${scope.props.stage}` : undefined,
|
|
80
73
|
lifecyclePolicy: props.lifecyclePolicy ?? efs.LifecyclePolicy.AFTER_7_DAYS,
|
|
81
|
-
performanceMode: props.performanceMode ?? efs.PerformanceMode.GENERAL_PURPOSE,
|
|
82
74
|
outOfInfrequentAccessPolicy: props.outOfInfrequentAccessPolicy ?? efs.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
|
|
75
|
+
performanceMode: props.performanceMode ?? efs.PerformanceMode.GENERAL_PURPOSE,
|
|
83
76
|
removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
|
|
77
|
+
securityGroup,
|
|
78
|
+
vpc,
|
|
79
|
+
vpcSubnets,
|
|
84
80
|
});
|
|
85
81
|
utils.createCfnOutput(`${id}-fileSystemArn`, scope, fileSystem.fileSystemArn);
|
|
86
82
|
utils.createCfnOutput(`${id}-fileSystemId`, scope, fileSystem.fileSystemId);
|
|
@@ -90,8 +86,8 @@ class EfsManager {
|
|
|
90
86
|
if (!accessPointOption.path)
|
|
91
87
|
throw `Undefined access point path for option: [${accessPointOption}], id: [${id}]`;
|
|
92
88
|
const accessPoint = fileSystem.addAccessPoint(`${id}-ap-${index}`, {
|
|
93
|
-
path: accessPointOption.path,
|
|
94
89
|
createAcl: accessPointOption.createAcl ?? exports.DEFAULT_CREATE_ACL,
|
|
90
|
+
path: accessPointOption.path,
|
|
95
91
|
posixUser: accessPointOption.posixUser ?? exports.DEFAULT_POSIX_USER,
|
|
96
92
|
});
|
|
97
93
|
utils.createCfnOutput(`${id}-accessPointArn-${index}`, scope, accessPoint.accessPointArn);
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { AccessPointOptions, FileSystemProps } from 'aws-cdk-lib/aws-efs';
|
|
2
2
|
import { AuthorizationConfig } from 'aws-cdk-lib/aws-ecs';
|
|
3
3
|
/**
|
|
4
|
-
* @category cdk-utils.efs-manager
|
|
5
|
-
* @subcategory Properties
|
|
6
4
|
*/
|
|
7
5
|
export interface EfsFileSystemProps extends FileSystemProps {
|
|
6
|
+
authorizationConfig?: AuthorizationConfig;
|
|
8
7
|
provisionNewOnDeployment?: boolean;
|
|
9
8
|
rootDirectory?: string;
|
|
10
9
|
transitEncryption?: string;
|
|
11
10
|
transitEncryptionPort?: number;
|
|
12
|
-
authorizationConfig?: AuthorizationConfig;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
|
-
* @category cdk-utils.efs-manager
|
|
16
|
-
* @subcategory Properties
|
|
17
13
|
*/
|
|
18
14
|
export interface EfsAccessPointOptions extends AccessPointOptions {
|
|
19
15
|
}
|