@gradientedge/cdk-utils 8.76.0 → 8.78.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.
@@ -88,6 +88,9 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
88
88
  * @protected
89
89
  */
90
90
  resolveSecurityGroup() {
91
+ if (!this.props.restApiCache) {
92
+ return;
93
+ }
91
94
  if (this.props.securityGroupExportName) {
92
95
  this.restApiSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId(this, `${this.id}`, cdk.Fn.importValue(this.props.securityGroupExportName));
93
96
  }
@@ -105,6 +108,9 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
105
108
  * @protected
106
109
  */
107
110
  createElastiCache() {
111
+ if (!this.props.restApiCache) {
112
+ return;
113
+ }
108
114
  this.restApiCache = this.elasticacheManager.createReplicatedElastiCache(`${this.id}-elasticache`, this, this.props.restApiCache, this.restApivpc.privateSubnets.map(subnet => subnet.subnetId), [this.restApiSecurityGroup.securityGroupId]);
109
115
  this.ssmManager.writeStringToParameters(`${this.id}-elasticache-endpoint-address`, this, {
110
116
  parameterName: `${this.id}-elasticache-endpoint-address`,
@@ -137,6 +137,8 @@ class LambdaManager {
137
137
  props.lambdaAliases.forEach(alias => {
138
138
  const aliasId = alias.id ?? `${id}-${alias.aliasName}`;
139
139
  const functionAlias = this.createLambdaFunctionAlias(`${aliasId}`, scope, alias, lambdaFunction.currentVersion);
140
+ utils.createCfnOutput(`${id}-${alias.aliasName}AliasArn`, scope, functionAlias.functionArn);
141
+ utils.createCfnOutput(`${id}-${alias.aliasName}AliasName`, scope, functionAlias.aliasName);
140
142
  if (alias.provisionedConcurrency) {
141
143
  const functionAutoScaling = functionAlias.addAutoScaling(alias.provisionedConcurrency);
142
144
  functionAutoScaling.scaleOnUtilization({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.76.0",
3
+ "version": "8.78.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -46,13 +46,13 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@aws-sdk/client-secrets-manager": "^3.344.0",
49
+ "@aws-sdk/client-secrets-manager": "^3.345.0",
50
50
  "@types/lodash": "^4.14.195",
51
51
  "@types/node": "^20.2.5",
52
52
  "@types/uuid": "^9.0.1",
53
53
  "app-root-path": "^3.1.0",
54
54
  "aws-cdk-lib": "^2.82.0",
55
- "constructs": "^10.2.40",
55
+ "constructs": "^10.2.43",
56
56
  "lodash": "^4.17.21",
57
57
  "moment": "^2.29.4",
58
58
  "nconf": "^0.12.0",
@@ -72,11 +72,11 @@
72
72
  "codecov": "^3.8.3",
73
73
  "commitizen": "^4.3.0",
74
74
  "docdash": "^2.0.1",
75
- "dotenv": "^16.1.3",
76
- "eslint": "^8.41.0",
75
+ "dotenv": "^16.1.4",
76
+ "eslint": "^8.42.0",
77
77
  "eslint-config-prettier": "^8.8.0",
78
78
  "eslint-plugin-import": "^2.27.5",
79
- "eslint-plugin-jsdoc": "^46.1.0",
79
+ "eslint-plugin-jsdoc": "^46.2.4",
80
80
  "husky": "^8.0.3",
81
81
  "jest": "^29.5.0",
82
82
  "jest-extended": "^3.2.4",
@@ -89,7 +89,7 @@
89
89
  "prettier": "^2.8.8",
90
90
  "prettier-plugin-organize-imports": "^3.2.2",
91
91
  "rimraf": "^5.0.1",
92
- "semantic-release": "^21.0.2",
92
+ "semantic-release": "^21.0.3",
93
93
  "taffydb": "^2.7.3",
94
94
  "ts-jest": "^29.1.0",
95
95
  "ts-node": "^10.9.1",
@@ -71,6 +71,10 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
71
71
  * @protected
72
72
  */
73
73
  protected resolveSecurityGroup() {
74
+ if (!this.props.restApiCache) {
75
+ return
76
+ }
77
+
74
78
  if (this.props.securityGroupExportName) {
75
79
  this.restApiSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId(
76
80
  this,
@@ -94,6 +98,10 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
94
98
  * @protected
95
99
  */
96
100
  protected createElastiCache() {
101
+ if (!this.props.restApiCache) {
102
+ return
103
+ }
104
+
97
105
  this.restApiCache = this.elasticacheManager.createReplicatedElastiCache(
98
106
  `${this.id}-elasticache`,
99
107
  this,
@@ -144,6 +144,8 @@ export class LambdaManager {
144
144
  props.lambdaAliases.forEach(alias => {
145
145
  const aliasId = alias.id ?? `${id}-${alias.aliasName}`
146
146
  const functionAlias = this.createLambdaFunctionAlias(`${aliasId}`, scope, alias, lambdaFunction.currentVersion)
147
+ utils.createCfnOutput(`${id}-${alias.aliasName}AliasArn`, scope, functionAlias.functionArn)
148
+ utils.createCfnOutput(`${id}-${alias.aliasName}AliasName`, scope, functionAlias.aliasName)
147
149
 
148
150
  if (alias.provisionedConcurrency) {
149
151
  const functionAutoScaling = functionAlias.addAutoScaling(alias.provisionedConcurrency)