@gradientedge/cdk-utils 8.76.0 → 8.77.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`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.76.0",
3
+ "version": "8.77.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -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,