@gradientedge/cdk-utils 8.118.0 → 8.119.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.
Files changed (148) hide show
  1. package/app/api-destined-function/package.json +1 -1
  2. package/dist/src/lib/common/construct.d.ts +32 -32
  3. package/dist/src/lib/common/construct.js +36 -59
  4. package/dist/src/lib/common/stack.d.ts +8 -7
  5. package/dist/src/lib/common/stack.js +17 -37
  6. package/dist/src/lib/common/types.d.ts +2 -2
  7. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
  8. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
  9. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
  10. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
  11. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
  12. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
  13. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
  14. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
  15. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
  16. package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
  17. package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
  18. package/dist/src/lib/construct/application-configuration/main.js +17 -41
  19. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
  20. package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
  21. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
  22. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
  23. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
  24. package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
  25. package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
  26. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
  27. package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
  28. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
  29. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
  30. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
  31. package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
  32. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
  33. package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
  34. package/dist/src/lib/construct/static-site/main.d.ts +15 -15
  35. package/dist/src/lib/construct/static-site/main.js +4 -27
  36. package/dist/src/lib/services/aws/api-gateway/main.d.ts +10 -10
  37. package/dist/src/lib/services/aws/api-gateway/main.js +21 -44
  38. package/dist/src/lib/services/aws/api-gateway/types.d.ts +2 -2
  39. package/dist/src/lib/services/aws/appconfig/main.d.ts +7 -7
  40. package/dist/src/lib/services/aws/appconfig/main.js +14 -37
  41. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -5
  42. package/dist/src/lib/services/aws/certificate-manager/main.js +10 -33
  43. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +2 -2
  44. package/dist/src/lib/services/aws/cloudfront/main.d.ts +18 -18
  45. package/dist/src/lib/services/aws/cloudfront/main.js +46 -45
  46. package/dist/src/lib/services/aws/cloudfront/types.d.ts +2 -3
  47. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +5 -5
  48. package/dist/src/lib/services/aws/cloudtrail/main.js +5 -28
  49. package/dist/src/lib/services/aws/codebuild/main.d.ts +3 -3
  50. package/dist/src/lib/services/aws/codebuild/main.js +7 -30
  51. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -3
  52. package/dist/src/lib/services/aws/dynamodb/main.js +8 -31
  53. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +2 -2
  54. package/dist/src/lib/services/aws/elastic-container-registry/main.js +4 -27
  55. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +10 -10
  56. package/dist/src/lib/services/aws/elastic-container-service/main.js +27 -50
  57. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +4 -4
  58. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +3 -3
  59. package/dist/src/lib/services/aws/elastic-file-system/main.js +12 -35
  60. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +4 -4
  61. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -31
  62. package/dist/src/lib/services/aws/elasticache/main.d.ts +4 -4
  63. package/dist/src/lib/services/aws/elasticache/main.js +10 -33
  64. package/dist/src/lib/services/aws/eventbridge/main.d.ts +13 -13
  65. package/dist/src/lib/services/aws/eventbridge/main.js +26 -49
  66. package/dist/src/lib/services/aws/eventbridge/target.d.ts +10 -10
  67. package/dist/src/lib/services/aws/eventbridge/target.js +6 -29
  68. package/dist/src/lib/services/aws/evidently/main.d.ts +7 -7
  69. package/dist/src/lib/services/aws/evidently/main.js +18 -41
  70. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +48 -49
  71. package/dist/src/lib/services/aws/identity-access-management/main.js +110 -133
  72. package/dist/src/lib/services/aws/key-management-service/main.d.ts +2 -2
  73. package/dist/src/lib/services/aws/key-management-service/main.js +5 -28
  74. package/dist/src/lib/services/aws/lambda/main.d.ts +11 -13
  75. package/dist/src/lib/services/aws/lambda/main.js +31 -58
  76. package/dist/src/lib/services/aws/route53/main.d.ts +9 -9
  77. package/dist/src/lib/services/aws/route53/main.js +21 -44
  78. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +5 -6
  79. package/dist/src/lib/services/aws/secrets-manager/main.js +10 -33
  80. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +4 -4
  81. package/dist/src/lib/services/aws/simple-notification-service/main.js +11 -34
  82. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +6 -7
  83. package/dist/src/lib/services/aws/simple-queue-service/main.js +15 -38
  84. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +10 -11
  85. package/dist/src/lib/services/aws/simple-storage-service/main.js +31 -54
  86. package/dist/src/lib/services/aws/step-function/main.d.ts +31 -32
  87. package/dist/src/lib/services/aws/step-function/main.js +33 -57
  88. package/dist/src/lib/services/aws/systems-manager/main.d.ts +4 -4
  89. package/dist/src/lib/services/aws/systems-manager/main.js +10 -33
  90. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +5 -6
  91. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +14 -37
  92. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +3 -3
  93. package/dist/src/lib/services/aws/web-application-firewall/main.js +8 -31
  94. package/dist/src/lib/utils/aws/index.d.ts +6 -3
  95. package/dist/src/lib/utils/aws/index.js +9 -26
  96. package/package.json +15 -15
  97. package/src/lib/common/construct.ts +97 -67
  98. package/src/lib/common/stack.ts +12 -12
  99. package/src/lib/common/types.ts +2 -2
  100. package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
  101. package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
  102. package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
  103. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
  104. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
  105. package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
  106. package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
  107. package/src/lib/construct/application-configuration/main.ts +31 -24
  108. package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
  109. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
  110. package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
  111. package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
  112. package/src/lib/construct/rest-api-lambda/main.ts +21 -21
  113. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
  114. package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
  115. package/src/lib/construct/static-asset-deployment/main.ts +6 -6
  116. package/src/lib/construct/static-site/main.ts +23 -17
  117. package/src/lib/services/aws/api-gateway/main.ts +42 -36
  118. package/src/lib/services/aws/api-gateway/types.ts +2 -2
  119. package/src/lib/services/aws/appconfig/main.ts +19 -19
  120. package/src/lib/services/aws/certificate-manager/main.ts +14 -14
  121. package/src/lib/services/aws/certificate-manager/types.ts +2 -2
  122. package/src/lib/services/aws/cloudfront/main.ts +88 -74
  123. package/src/lib/services/aws/cloudfront/types.ts +6 -3
  124. package/src/lib/services/aws/cloudtrail/main.ts +11 -11
  125. package/src/lib/services/aws/codebuild/main.ts +7 -7
  126. package/src/lib/services/aws/dynamodb/main.ts +8 -8
  127. package/src/lib/services/aws/elastic-container-registry/main.ts +4 -4
  128. package/src/lib/services/aws/elastic-container-service/main.ts +48 -37
  129. package/src/lib/services/aws/elastic-container-service/types.ts +4 -4
  130. package/src/lib/services/aws/elastic-file-system/main.ts +16 -16
  131. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +11 -11
  132. package/src/lib/services/aws/elasticache/main.ts +10 -10
  133. package/src/lib/services/aws/eventbridge/main.ts +37 -37
  134. package/src/lib/services/aws/eventbridge/target.ts +14 -14
  135. package/src/lib/services/aws/evidently/main.ts +18 -18
  136. package/src/lib/services/aws/identity-access-management/main.ts +142 -134
  137. package/src/lib/services/aws/key-management-service/main.ts +5 -5
  138. package/src/lib/services/aws/lambda/main.ts +65 -59
  139. package/src/lib/services/aws/route53/main.ts +31 -31
  140. package/src/lib/services/aws/secrets-manager/main.ts +11 -15
  141. package/src/lib/services/aws/simple-notification-service/main.ts +13 -13
  142. package/src/lib/services/aws/simple-queue-service/main.ts +18 -18
  143. package/src/lib/services/aws/simple-storage-service/main.ts +40 -40
  144. package/src/lib/services/aws/step-function/main.ts +77 -65
  145. package/src/lib/services/aws/systems-manager/main.ts +17 -12
  146. package/src/lib/services/aws/virtual-private-cloud/main.ts +16 -16
  147. package/src/lib/services/aws/web-application-firewall/main.ts +8 -8
  148. package/src/lib/utils/aws/index.ts +8 -5
@@ -1,8 +1,8 @@
1
- import * as apig from 'aws-cdk-lib/aws-apigateway';
2
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
3
- import * as lambda from 'aws-cdk-lib/aws-lambda';
4
- import { LambdaRestApiProps } from './types';
1
+ import { DomainName, IAuthorizer, IResource, IRestApi, Integration, LambdaRestApi } from 'aws-cdk-lib/aws-apigateway';
2
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
3
+ import { IFunction } from 'aws-cdk-lib/aws-lambda';
5
4
  import { CommonConstruct } from '../../../common';
5
+ import { LambdaRestApiProps } from './types';
6
6
  /**
7
7
  * @classdesc Provides operations on AWS API Gateway.
8
8
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -11,7 +11,7 @@ import { CommonConstruct } from '../../../common';
11
11
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
12
12
  *
13
13
  * class CustomConstruct extends CommonConstruct {
14
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
14
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
15
15
  * super(parent, id, props)
16
16
  * this.props = props
17
17
  * const lambdaFunction = this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
@@ -28,7 +28,7 @@ export declare class ApiManager {
28
28
  * @param props lambda rest restApi props
29
29
  * @param lambdaFunction
30
30
  */
31
- createLambdaRestApi(id: string, scope: CommonConstruct, props: LambdaRestApiProps, lambdaFunction: lambda.IFunction): apig.LambdaRestApi;
31
+ createLambdaRestApi(id: string, scope: CommonConstruct, props: LambdaRestApiProps, lambdaFunction: IFunction): LambdaRestApi;
32
32
  /**
33
33
  * @summary Method to create custom restApi domain
34
34
  * @param id scoped id of the resource
@@ -36,7 +36,7 @@ export declare class ApiManager {
36
36
  * @param domainName the domain name to use
37
37
  * @param certificate the certificate used for custom restApi domain
38
38
  */
39
- createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: acm.ICertificate): apig.DomainName;
39
+ createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: ICertificate): DomainName;
40
40
  /**
41
41
  * @summary Method to create an API gateway resource
42
42
  * @param id
@@ -52,14 +52,14 @@ export declare class ApiManager {
52
52
  * @param methodRequestParameters
53
53
  * @param proxyIntegration
54
54
  */
55
- createApiResource(id: string, scope: CommonConstruct, parent: apig.IResource, path: string, integration: apig.Integration, addProxy: boolean, authorizer?: apig.IAuthorizer, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[], methodRequestParameters?: {
55
+ createApiResource(id: string, scope: CommonConstruct, parent: IResource, path: string, integration: Integration, addProxy: boolean, authorizer?: IAuthorizer, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[], methodRequestParameters?: {
56
56
  [param: string]: boolean;
57
- }, proxyIntegration?: apig.Integration): apig.Resource;
57
+ }, proxyIntegration?: Integration): import("aws-cdk-lib/aws-apigateway").Resource;
58
58
  /**
59
59
  * @summary Method to create an api deployment
60
60
  * @param id
61
61
  * @param scope
62
62
  * @param restApi
63
63
  */
64
- createApiDeployment(id: string, scope: CommonConstruct, restApi: apig.IRestApi): void;
64
+ createApiDeployment(id: string, scope: CommonConstruct, restApi: IRestApi): void;
65
65
  }
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.ApiManager = void 0;
27
- const apig = __importStar(require("aws-cdk-lib/aws-apigateway"));
28
- const utils = __importStar(require("../../../utils"));
29
- const cdk = __importStar(require("aws-cdk-lib"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
6
+ const utils_1 = require("../../../utils");
30
7
  /**
31
8
  * @classdesc Provides operations on AWS API Gateway.
32
9
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -35,7 +12,7 @@ const cdk = __importStar(require("aws-cdk-lib"));
35
12
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
36
13
  *
37
14
  * class CustomConstruct extends CommonConstruct {
38
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
15
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
39
16
  * super(parent, id, props)
40
17
  * this.props = props
41
18
  * const lambdaFunction = this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
@@ -55,7 +32,7 @@ class ApiManager {
55
32
  createLambdaRestApi(id, scope, props, lambdaFunction) {
56
33
  if (!props)
57
34
  throw `Api props undefined for ${id}`;
58
- const api = new apig.LambdaRestApi(scope, `${id}`, {
35
+ const api = new aws_apigateway_1.LambdaRestApi(scope, `${id}`, {
59
36
  binaryMediaTypes: props.binaryMediaTypes,
60
37
  cloudWatchRole: props.cloudWatchRole || false,
61
38
  defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
@@ -80,7 +57,7 @@ class ApiManager {
80
57
  },
81
58
  domainName: props.domainName,
82
59
  endpointConfiguration: {
83
- types: props.endpointConfiguration?.types || [apig.EndpointType.REGIONAL],
60
+ types: props.endpointConfiguration?.types || [aws_apigateway_1.EndpointType.REGIONAL],
84
61
  vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
85
62
  },
86
63
  endpointTypes: props.endpointTypes,
@@ -95,11 +72,11 @@ class ApiManager {
95
72
  });
96
73
  if (props.tags && props.tags.length > 0) {
97
74
  props.tags.forEach(tag => {
98
- cdk.Tags.of(api).add(tag.key, tag.value);
75
+ aws_cdk_lib_1.Tags.of(api).add(tag.key, tag.value);
99
76
  });
100
77
  }
101
- utils.createCfnOutput(`${id}-restApiId`, scope, api.restApiId);
102
- utils.createCfnOutput(`${id}-restApiName`, scope, api.restApiName);
78
+ (0, utils_1.createCfnOutput)(`${id}-restApiId`, scope, api.restApiId);
79
+ (0, utils_1.createCfnOutput)(`${id}-restApiName`, scope, api.restApiName);
103
80
  return api;
104
81
  }
105
82
  /**
@@ -110,13 +87,13 @@ class ApiManager {
110
87
  * @param certificate the certificate used for custom restApi domain
111
88
  */
112
89
  createApiDomain(id, scope, domainName, certificate) {
113
- const apiDomain = new apig.DomainName(scope, `${id}`, {
90
+ const apiDomain = new aws_apigateway_1.DomainName(scope, `${id}`, {
114
91
  certificate: certificate,
115
92
  domainName: domainName,
116
- endpointType: scope.isProductionStage() ? apig.EndpointType.EDGE : apig.EndpointType.REGIONAL,
117
- securityPolicy: apig.SecurityPolicy.TLS_1_2,
93
+ endpointType: scope.isProductionStage() ? aws_apigateway_1.EndpointType.EDGE : aws_apigateway_1.EndpointType.REGIONAL,
94
+ securityPolicy: aws_apigateway_1.SecurityPolicy.TLS_1_2,
118
95
  });
119
- utils.createCfnOutput(`${id}-customDomainName`, scope, apiDomain.domainName);
96
+ (0, utils_1.createCfnOutput)(`${id}-customDomainName`, scope, apiDomain.domainName);
120
97
  return apiDomain;
121
98
  }
122
99
  /**
@@ -135,34 +112,34 @@ class ApiManager {
135
112
  * @param proxyIntegration
136
113
  */
137
114
  createApiResource(id, scope, parent, path, integration, addProxy, authorizer, allowedOrigins, allowedMethods, allowedHeaders, methodRequestParameters, proxyIntegration) {
138
- const methods = allowedMethods ?? apig.Cors.ALL_METHODS;
115
+ const methods = allowedMethods ?? aws_apigateway_1.Cors.ALL_METHODS;
139
116
  const resource = parent.addResource(path, {
140
117
  defaultCorsPreflightOptions: {
141
118
  allowCredentials: true,
142
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
119
+ allowHeaders: allowedHeaders ?? aws_apigateway_1.Cors.DEFAULT_HEADERS,
143
120
  allowMethods: [...methods, 'OPTIONS'],
144
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
121
+ allowOrigins: allowedOrigins ?? aws_apigateway_1.Cors.ALL_ORIGINS,
145
122
  },
146
123
  });
147
124
  methods.forEach(method => resource.addMethod(method, integration, {
148
125
  authorizer,
149
126
  requestParameters: methodRequestParameters,
150
127
  }));
151
- utils.createCfnOutput(`${id}-${path}ResourceId`, scope, resource.resourceId);
128
+ (0, utils_1.createCfnOutput)(`${id}-${path}ResourceId`, scope, resource.resourceId);
152
129
  if (addProxy) {
153
130
  const resourceProxy = resource.addResource(`{${path}+}`, {
154
131
  defaultCorsPreflightOptions: {
155
132
  allowCredentials: true,
156
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
133
+ allowHeaders: allowedHeaders ?? aws_apigateway_1.Cors.DEFAULT_HEADERS,
157
134
  allowMethods: [...methods, 'OPTIONS'],
158
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
135
+ allowOrigins: allowedOrigins ?? aws_apigateway_1.Cors.ALL_ORIGINS,
159
136
  },
160
137
  });
161
138
  methods.forEach(method => resourceProxy.addMethod(method, proxyIntegration ?? integration, {
162
139
  authorizer,
163
140
  requestParameters: methodRequestParameters,
164
141
  }));
165
- utils.createCfnOutput(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId);
142
+ (0, utils_1.createCfnOutput)(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId);
166
143
  }
167
144
  return resource;
168
145
  }
@@ -173,7 +150,7 @@ class ApiManager {
173
150
  * @param restApi
174
151
  */
175
152
  createApiDeployment(id, scope, restApi) {
176
- new apig.Deployment(scope, `${id}`, {
153
+ new aws_apigateway_1.Deployment(scope, `${id}`, {
177
154
  api: restApi,
178
155
  retainDeployments: false,
179
156
  });
@@ -1,7 +1,7 @@
1
+ import { LambdaRestApiProps as LambdaRestApigProps } from 'aws-cdk-lib/aws-apigateway';
1
2
  import { TagProps } from '../../../types';
2
- import * as apig from 'aws-cdk-lib/aws-apigateway';
3
3
  /**
4
4
  */
5
- export interface LambdaRestApiProps extends apig.LambdaRestApiProps {
5
+ export interface LambdaRestApiProps extends LambdaRestApigProps {
6
6
  tags?: TagProps[];
7
7
  }
@@ -1,16 +1,16 @@
1
- import * as appconfig from 'aws-cdk-lib/aws-appconfig';
1
+ import { CfnApplication, CfnConfigurationProfile, CfnEnvironment } from 'aws-cdk-lib/aws-appconfig';
2
+ import { CommonConstruct } from '../../../common';
2
3
  import { Architecture } from '../constants';
3
4
  import { AppConfigProps } from './types';
4
- import { CommonConstruct } from '../../../common';
5
5
  /**
6
- * @classdesc Provides operations on AWS AppConfig.
6
+ * @classdesc 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
10
10
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
11
11
  *
12
12
  * class CustomConstruct extends CommonConstruct {
13
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
13
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
14
14
  * super(parent, id, props)
15
15
  * this.props = props
16
16
  * this.appConfigManager.createApplication('MyApplication', this)
@@ -32,7 +32,7 @@ export declare class AppConfigManager {
32
32
  * @param props
33
33
  * @returns the appconfig application
34
34
  */
35
- createApplication(id: string, scope: CommonConstruct, props: AppConfigProps): appconfig.CfnApplication;
35
+ createApplication(id: string, scope: CommonConstruct, props: AppConfigProps): CfnApplication;
36
36
  /**
37
37
  * @summary Method to create an AppConfig Environment for a given application
38
38
  * @param id scoped id of the resource
@@ -41,7 +41,7 @@ export declare class AppConfigManager {
41
41
  * @param props
42
42
  * @returns the appconfig environment
43
43
  */
44
- createEnvironment(id: string, scope: CommonConstruct, applicationId: string, props: AppConfigProps): appconfig.CfnEnvironment;
44
+ createEnvironment(id: string, scope: CommonConstruct, applicationId: string, props: AppConfigProps): CfnEnvironment;
45
45
  /**
46
46
  * @summary Method to create an AppConfig Configuration Profile for a given application
47
47
  * - <p>&#9888; The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
@@ -51,5 +51,5 @@ export declare class AppConfigManager {
51
51
  * @param props
52
52
  * @returns the appconfig configuration profile
53
53
  */
54
- createConfigurationProfile(id: string, scope: CommonConstruct, applicationId: string, props: AppConfigProps): appconfig.CfnConfigurationProfile;
54
+ createConfigurationProfile(id: string, scope: CommonConstruct, applicationId: string, props: AppConfigProps): CfnConfigurationProfile;
55
55
  }
@@ -1,43 +1,20 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.AppConfigManager = void 0;
27
- const cdk = __importStar(require("aws-cdk-lib"));
28
- const appconfig = __importStar(require("aws-cdk-lib/aws-appconfig"));
29
- const utils = __importStar(require("../../../utils"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_appconfig_1 = require("aws-cdk-lib/aws-appconfig");
6
+ const utils_1 = require("../../../utils");
30
7
  const constants_1 = require("../constants");
31
8
  const constants_2 = require("./constants");
32
9
  /**
33
- * @classdesc Provides operations on AWS AppConfig.
10
+ * @classdesc Provides operations on AWS
34
11
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
35
12
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
36
13
  * @example
37
14
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
38
15
  *
39
16
  * class CustomConstruct extends CommonConstruct {
40
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
17
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
41
18
  * super(parent, id, props)
42
19
  * this.props = props
43
20
  * this.appConfigManager.createApplication('MyApplication', this)
@@ -71,13 +48,13 @@ class AppConfigManager {
71
48
  createApplication(id, scope, props) {
72
49
  if (!props)
73
50
  throw `AppConfig props undefined for ${id}`;
74
- const application = new appconfig.CfnApplication(scope, `${id}`, {
51
+ const application = new aws_appconfig_1.CfnApplication(scope, `${id}`, {
75
52
  description: props.application.description,
76
53
  name: `${props.application.name}-${scope.props.stage}`,
77
54
  tags: props.application.tags,
78
55
  });
79
- utils.createCfnOutput(`${id}-ApplicationId`, scope, cdk.Fn.ref(application.logicalId));
80
- utils.createCfnOutput(`${id}-ApplicationName`, scope, application.name);
56
+ (0, utils_1.createCfnOutput)(`${id}-ApplicationId`, scope, aws_cdk_lib_1.Fn.ref(application.logicalId));
57
+ (0, utils_1.createCfnOutput)(`${id}-ApplicationName`, scope, application.name);
81
58
  return application;
82
59
  }
83
60
  /**
@@ -91,15 +68,15 @@ class AppConfigManager {
91
68
  createEnvironment(id, scope, applicationId, props) {
92
69
  if (!props)
93
70
  throw `AppConfig props undefined for ${id}`;
94
- const environment = new appconfig.CfnEnvironment(scope, `${id}`, {
71
+ const environment = new aws_appconfig_1.CfnEnvironment(scope, `${id}`, {
95
72
  applicationId: applicationId,
96
73
  description: props.environment.description,
97
74
  monitors: props.environment.monitors,
98
75
  name: props.environment.name ?? scope.props.stage,
99
76
  tags: props.environment.tags,
100
77
  });
101
- utils.createCfnOutput(`${id}-configurationEnvironmentId`, scope, cdk.Fn.ref(environment.logicalId));
102
- utils.createCfnOutput(`${id}-configurationEnvironmentName`, scope, environment.name);
78
+ (0, utils_1.createCfnOutput)(`${id}-configurationEnvironmentId`, scope, aws_cdk_lib_1.Fn.ref(environment.logicalId));
79
+ (0, utils_1.createCfnOutput)(`${id}-configurationEnvironmentName`, scope, environment.name);
103
80
  return environment;
104
81
  }
105
82
  /**
@@ -114,7 +91,7 @@ class AppConfigManager {
114
91
  createConfigurationProfile(id, scope, applicationId, props) {
115
92
  if (!props)
116
93
  throw `AppConfig props undefined for ${id}`;
117
- const profile = new appconfig.CfnConfigurationProfile(scope, `${id}`, {
94
+ const profile = new aws_appconfig_1.CfnConfigurationProfile(scope, `${id}`, {
118
95
  applicationId: applicationId,
119
96
  description: props.configurationProfile.description,
120
97
  locationUri: props.configurationProfile.locationUri || 'hosted',
@@ -124,8 +101,8 @@ class AppConfigManager {
124
101
  type: props.configurationProfile.type,
125
102
  validators: props.configurationProfile.validators,
126
103
  });
127
- utils.createCfnOutput(`${id}-configurationProfileId`, scope, cdk.Fn.ref(profile.logicalId));
128
- utils.createCfnOutput(`${id}-configurationProfileName`, scope, profile.name);
104
+ (0, utils_1.createCfnOutput)(`${id}-configurationProfileId`, scope, aws_cdk_lib_1.Fn.ref(profile.logicalId));
105
+ (0, utils_1.createCfnOutput)(`${id}-configurationProfileName`, scope, profile.name);
129
106
  return profile;
130
107
  }
131
108
  }
@@ -1,7 +1,7 @@
1
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
2
- import * as route53 from 'aws-cdk-lib/aws-route53';
3
- import { AcmProps } from './types';
1
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
2
+ import { IHostedZone } from 'aws-cdk-lib/aws-route53';
4
3
  import { CommonConstruct } from '../../../common';
4
+ import { AcmProps } from './types';
5
5
  /**
6
6
  * @classdesc Provides operations on AWS Certificates.
7
7
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -10,7 +10,7 @@ import { CommonConstruct } from '../../../common';
10
10
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
11
11
  *
12
12
  * class CustomConstruct extends CommonConstruct {
13
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
13
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
14
14
  * super(parent, id, props)
15
15
  * this.props = props
16
16
  * this.acmManager.createCertificate('MyCertificate', this)
@@ -37,5 +37,5 @@ export declare class AcmManager {
37
37
  * E -- No --> D;
38
38
  * F --> G;
39
39
  */
40
- resolveCertificate(id: string, scope: CommonConstruct, props: AcmProps, hostedZone?: route53.IHostedZone): acm.ICertificate;
40
+ resolveCertificate(id: string, scope: CommonConstruct, props: AcmProps, hostedZone?: IHostedZone): ICertificate;
41
41
  }
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.AcmManager = void 0;
27
- const cdk = __importStar(require("aws-cdk-lib"));
28
- const acm = __importStar(require("aws-cdk-lib/aws-certificatemanager"));
29
- const utils = __importStar(require("../../../utils"));
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_certificatemanager_1 = require("aws-cdk-lib/aws-certificatemanager");
6
+ const utils_1 = require("../../../utils");
30
7
  /**
31
8
  * @classdesc Provides operations on AWS Certificates.
32
9
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
@@ -35,7 +12,7 @@ const utils = __importStar(require("../../../utils"));
35
12
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
36
13
  *
37
14
  * class CustomConstruct extends CommonConstruct {
38
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
15
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
39
16
  * super(parent, id, props)
40
17
  * this.props = props
41
18
  * this.acmManager.createCertificate('MyCertificate', this)
@@ -69,20 +46,20 @@ class AcmManager {
69
46
  if (props.useExistingCertificate) {
70
47
  let certificateArn = props.certificateArn;
71
48
  if (!certificateArn) {
72
- const certificateAccount = props.certificateAccount ? props.certificateAccount : cdk.Stack.of(scope).account;
73
- const certificateRegion = props.certificateRegion ? props.certificateRegion : cdk.Stack.of(scope).region;
49
+ const certificateAccount = props.certificateAccount ? props.certificateAccount : aws_cdk_lib_1.Stack.of(scope).account;
50
+ const certificateRegion = props.certificateRegion ? props.certificateRegion : aws_cdk_lib_1.Stack.of(scope).region;
74
51
  certificateArn = `arn:aws:acm:${certificateRegion}:${certificateAccount}:certificate/${props.certificateId}`;
75
52
  }
76
- certificate = acm.Certificate.fromCertificateArn(scope, `${id}`, certificateArn);
53
+ certificate = aws_certificatemanager_1.Certificate.fromCertificateArn(scope, `${id}`, certificateArn);
77
54
  }
78
55
  else {
79
- certificate = new acm.Certificate(scope, `${id}`, {
56
+ certificate = new aws_certificatemanager_1.Certificate(scope, `${id}`, {
80
57
  domainName: props.domainName,
81
58
  subjectAlternativeNames: props.subjectAlternativeNames,
82
- validation: acm.CertificateValidation.fromDns(hostedZone),
59
+ validation: aws_certificatemanager_1.CertificateValidation.fromDns(hostedZone),
83
60
  });
84
61
  }
85
- utils.createCfnOutput(`${id}-certificateArn`, scope, certificate.certificateArn);
62
+ (0, utils_1.createCfnOutput)(`${id}-certificateArn`, scope, certificate.certificateArn);
86
63
  return certificate;
87
64
  }
88
65
  }
@@ -1,7 +1,7 @@
1
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
1
+ import { CertificateProps } from 'aws-cdk-lib/aws-certificatemanager';
2
2
  /**
3
3
  */
4
- export interface AcmProps extends acm.CertificateProps {
4
+ export interface AcmProps extends CertificateProps {
5
5
  certificateAccount?: string;
6
6
  certificateArn?: string;
7
7
  certificateId?: string;
@@ -1,24 +1,24 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
3
- import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
4
- import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
5
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
6
- import * as efs from 'aws-cdk-lib/aws-efs';
7
- import * as iam from 'aws-cdk-lib/aws-iam';
8
- import * as lambda from 'aws-cdk-lib/aws-lambda';
9
- import * as s3 from 'aws-cdk-lib/aws-s3';
1
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
2
+ import * as cf from 'aws-cdk-lib/aws-cloudfront';
3
+ import { FunctionAssociation, IResponseHeadersPolicy, OriginAccessIdentity } from 'aws-cdk-lib/aws-cloudfront';
4
+ import { HttpOrigin, S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins';
5
+ import { ISecurityGroup, IVpc } from 'aws-cdk-lib/aws-ec2';
6
+ import { IAccessPoint } from 'aws-cdk-lib/aws-efs';
7
+ import { Role } from 'aws-cdk-lib/aws-iam';
8
+ import { AssetCode, ILayerVersion } from 'aws-cdk-lib/aws-lambda';
9
+ import { IBucket } from 'aws-cdk-lib/aws-s3';
10
10
  import { CommonConstruct } from '../../../common';
11
- import { CloudfrontFunctionProps, CloudFrontProps, DistributionProps } from './types';
12
11
  import { LambdaEdgeProps } from '../lambda';
12
+ import { CloudFrontProps, CloudfrontFunctionProps, DistributionProps } from './types';
13
13
  /**
14
- * @classdesc Provides operations on AWS CloudFront.
14
+ * @classdesc Provides operations on AWS
15
15
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
16
16
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
17
17
  * @example
18
18
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
19
19
  *
20
20
  * class CustomConstruct extends CommonConstruct {
21
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
21
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
22
22
  * super(parent, id, props)
23
23
  * this.props = props
24
24
  * this.cloudFrontManager.createCloudFrontDistribution(
@@ -34,7 +34,7 @@ import { LambdaEdgeProps } from '../lambda';
34
34
  * @see [CDK CloudFront Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html}
35
35
  */
36
36
  export declare class CloudFrontManager {
37
- createOriginAccessIdentity(id: string, scope: CommonConstruct, accessBucket?: s3.IBucket): cdk.aws_cloudfront.OriginAccessIdentity;
37
+ createOriginAccessIdentity(id: string, scope: CommonConstruct, accessBucket?: IBucket): cf.OriginAccessIdentity;
38
38
  /**
39
39
  * @summary Method to create a cloudfront distribution
40
40
  * @param id scoped id of the resource
@@ -46,7 +46,7 @@ export declare class CloudFrontManager {
46
46
  * @param certificate
47
47
  * @param aliases
48
48
  */
49
- createCloudFrontDistribution(id: string, scope: CommonConstruct, props: CloudFrontProps, siteBucket?: s3.IBucket, logBucket?: s3.IBucket, oai?: cloudfront.OriginAccessIdentity, certificate?: acm.ICertificate, aliases?: string[]): cdk.aws_cloudfront.CloudFrontWebDistribution;
49
+ createCloudFrontDistribution(id: string, scope: CommonConstruct, props: CloudFrontProps, siteBucket?: IBucket, logBucket?: IBucket, oai?: OriginAccessIdentity, certificate?: ICertificate, aliases?: string[]): cf.CloudFrontWebDistribution;
50
50
  /**
51
51
  * Method to create a CloudFront distribution with S3 Origin
52
52
  * @param id scoped id of the resource
@@ -60,7 +60,7 @@ export declare class CloudFrontManager {
60
60
  * @param aliases
61
61
  * @param defaultFunctionAssociations
62
62
  */
63
- createDistributionWithS3Origin(id: string, scope: CommonConstruct, props: DistributionProps, origin: origins.S3Origin, siteBucket: s3.IBucket, logBucket?: s3.IBucket, oai?: cloudfront.OriginAccessIdentity, certificate?: acm.ICertificate, aliases?: string[], defaultFunctionAssociations?: cloudfront.FunctionAssociation[]): cdk.aws_cloudfront.Distribution;
63
+ createDistributionWithS3Origin(id: string, scope: CommonConstruct, props: DistributionProps, origin: S3Origin, siteBucket: IBucket, logBucket?: IBucket, oai?: OriginAccessIdentity, certificate?: ICertificate, aliases?: string[], defaultFunctionAssociations?: FunctionAssociation[]): cf.Distribution;
64
64
  /**
65
65
  * Method to create a CloudFront distribution with HTTP Origin
66
66
  * @param id scoped id of the resource
@@ -73,7 +73,7 @@ export declare class CloudFrontManager {
73
73
  * @param defaultFunctionAssociations
74
74
  * @param responseHeadersPolicy
75
75
  */
76
- createDistributionWithHttpOrigin(id: string, scope: CommonConstruct, props: DistributionProps, origin: origins.HttpOrigin, domainNames: string[], logBucket?: s3.IBucket, certificate?: acm.ICertificate, defaultFunctionAssociations?: cloudfront.FunctionAssociation[], responseHeadersPolicy?: cloudfront.IResponseHeadersPolicy): cdk.aws_cloudfront.Distribution;
76
+ createDistributionWithHttpOrigin(id: string, scope: CommonConstruct, props: DistributionProps, origin: HttpOrigin, domainNames: string[], logBucket?: IBucket, certificate?: ICertificate, defaultFunctionAssociations?: FunctionAssociation[], responseHeadersPolicy?: IResponseHeadersPolicy): cf.Distribution;
77
77
  /**
78
78
  * @summary Method to provision a Lambda@Edge function
79
79
  * @param id scoped id of the resource
@@ -88,7 +88,7 @@ export declare class CloudFrontManager {
88
88
  * @param accessPoint
89
89
  * @param mountPath
90
90
  */
91
- createEdgeFunction(id: string, scope: CommonConstruct, props: LambdaEdgeProps, layers: lambda.ILayerVersion[], code: lambda.AssetCode, role: iam.Role, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string): cdk.aws_cloudfront.experimental.EdgeFunction;
91
+ createEdgeFunction(id: string, scope: CommonConstruct, props: LambdaEdgeProps, layers: ILayerVersion[], code: AssetCode, role: Role, environment?: any, vpc?: IVpc, securityGroups?: ISecurityGroup[], accessPoint?: IAccessPoint, mountPath?: string): cf.experimental.EdgeFunction;
92
92
  /**
93
93
  *
94
94
  * @param id
@@ -104,5 +104,5 @@ export declare class CloudFrontManager {
104
104
  * @param scope scope in which this resource is defined
105
105
  * @param props
106
106
  */
107
- createCloudfrontFunction(id: string, scope: CommonConstruct, props: CloudfrontFunctionProps): cdk.aws_cloudfront.Function;
107
+ createCloudfrontFunction(id: string, scope: CommonConstruct, props: CloudfrontFunctionProps): cf.Function;
108
108
  }