@gradientedge/cdk-utils 7.19.0 → 7.21.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.
@@ -9,13 +9,13 @@
9
9
  ],
10
10
  "linkedModules": [],
11
11
  "topLevelPatterns": [
12
- "@types/uuid@^8.3.4",
12
+ "@types/uuid@^9.0.0",
13
13
  "mkdirp@^1.0.4",
14
14
  "rimraf@^3.0.2",
15
15
  "uuid@^9.0.0"
16
16
  ],
17
17
  "lockfileEntries": {
18
- "@types/uuid@^8.3.4": "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc",
18
+ "@types/uuid@^9.0.0": "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.0.tgz#53ef263e5239728b56096b0a869595135b7952d2",
19
19
  "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
20
20
  "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
21
21
  "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
@@ -8,7 +8,7 @@ This package contains type definitions for uuid (https://github.com/uuidjs/uuid)
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 06 Jan 2022 07:31:27 GMT
11
+ * Last updated: Tue, 29 Nov 2022 18:32:57 GMT
12
12
  * Dependencies: none
13
13
  * Global values: none
14
14
 
@@ -1,4 +1,4 @@
1
- // Type definitions for uuid 8.3
1
+ // Type definitions for uuid 9.0
2
2
  // Project: https://github.com/uuidjs/uuid
3
3
  // Definitions by: Oliver Hoffmann <https://github.com/iamolivinius>
4
4
  // Felipe Ochoa <https://github.com/felipeochoa>
@@ -6,7 +6,6 @@
6
6
  // Linus Unnebäck <https://github.com/LinusU>
7
7
  // Christoph Tavan <https://github.com/ctavan>
8
8
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
- // TypeScript Version: 2.8
10
9
 
11
10
  // disable automatic export
12
11
  export {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/uuid",
3
- "version": "8.3.4",
3
+ "version": "9.0.0",
4
4
  "description": "TypeScript definitions for uuid",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid",
6
6
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "scripts": {},
42
42
  "dependencies": {},
43
- "typesPublisherContentHash": "7bd9cd358e9e4357393eb0163c44f44dc265ab936b456743af6ed3d0d0ac644f",
44
- "typeScriptVersion": "3.8",
43
+ "typesPublisherContentHash": "fcbbe0ed3964850f2ba3f7c63e9bf38a037f990945fb14bb976e9420e2d9d0b0",
44
+ "typeScriptVersion": "4.1",
45
45
  "exports": {
46
46
  "./package.json": "./package.json",
47
47
  ".": {
@@ -19,7 +19,7 @@
19
19
  "test": "npx jest --ci --runInBand --passWithNoTests"
20
20
  },
21
21
  "dependencies": {
22
- "@types/uuid": "^8.3.4",
22
+ "@types/uuid": "^9.0.0",
23
23
  "uuid": "^9.0.0"
24
24
  },
25
25
  "devDependencies": {
@@ -8,13 +8,13 @@
8
8
  ],
9
9
  "linkedModules": [],
10
10
  "topLevelPatterns": [
11
- "@types/uuid@^8.3.4",
11
+ "@types/uuid@^9.0.0",
12
12
  "mkdirp@^1.0.4",
13
13
  "rimraf@^3.0.2",
14
14
  "uuid@^9.0.0"
15
15
  ],
16
16
  "lockfileEntries": {
17
- "@types/uuid@^8.3.4": "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc",
17
+ "@types/uuid@^9.0.0": "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.0.tgz#53ef263e5239728b56096b0a869595135b7952d2",
18
18
  "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
19
19
  "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
20
20
  "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
@@ -8,7 +8,7 @@ This package contains type definitions for uuid (https://github.com/uuidjs/uuid)
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 06 Jan 2022 07:31:27 GMT
11
+ * Last updated: Tue, 29 Nov 2022 18:32:57 GMT
12
12
  * Dependencies: none
13
13
  * Global values: none
14
14
 
@@ -1,4 +1,4 @@
1
- // Type definitions for uuid 8.3
1
+ // Type definitions for uuid 9.0
2
2
  // Project: https://github.com/uuidjs/uuid
3
3
  // Definitions by: Oliver Hoffmann <https://github.com/iamolivinius>
4
4
  // Felipe Ochoa <https://github.com/felipeochoa>
@@ -6,7 +6,6 @@
6
6
  // Linus Unnebäck <https://github.com/LinusU>
7
7
  // Christoph Tavan <https://github.com/ctavan>
8
8
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
- // TypeScript Version: 2.8
10
9
 
11
10
  // disable automatic export
12
11
  export {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/uuid",
3
- "version": "8.3.4",
3
+ "version": "9.0.0",
4
4
  "description": "TypeScript definitions for uuid",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uuid",
6
6
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "scripts": {},
42
42
  "dependencies": {},
43
- "typesPublisherContentHash": "7bd9cd358e9e4357393eb0163c44f44dc265ab936b456743af6ed3d0d0ac644f",
44
- "typeScriptVersion": "3.8",
43
+ "typesPublisherContentHash": "fcbbe0ed3964850f2ba3f7c63e9bf38a037f990945fb14bb976e9420e2d9d0b0",
44
+ "typeScriptVersion": "4.1",
45
45
  "exports": {
46
46
  "./package.json": "./package.json",
47
47
  ".": {
@@ -19,7 +19,7 @@
19
19
  "test": "npx jest --ci --runInBand --passWithNoTests"
20
20
  },
21
21
  "dependencies": {
22
- "@types/uuid": "^8.3.4",
22
+ "@types/uuid": "^9.0.0",
23
23
  "uuid": "^9.0.0"
24
24
  },
25
25
  "devDependencies": {
@@ -28,7 +28,7 @@ export declare class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
28
28
  props: GraphQlApiLambdaWithCacheProps;
29
29
  id: string;
30
30
  graphQLVpc: ec2.IVpc;
31
- graphQLElastiCache: elasticache.CfnCacheCluster;
31
+ graphQLElastiCache: elasticache.CfnReplicationGroup;
32
32
  graphQLSecurityGroup: ec2.ISecurityGroup;
33
33
  securityGroupExportName: string;
34
34
  constructor(parent: Construct, id: string, props: GraphQlApiLambdaWithCacheProps);
@@ -104,7 +104,7 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
104
104
  * @protected
105
105
  */
106
106
  createElastiCache() {
107
- this.graphQLElastiCache = this.elasticacheManager.createElastiCache(`${this.id}-elasticache`, this, this.props.graphQLElastiCache, this.graphQLVpc.privateSubnets.map(subnet => subnet.subnetId), [this.graphQLSecurityGroup.securityGroupId]);
107
+ this.graphQLElastiCache = this.elasticacheManager.createReplicatedElastiCache(`${this.id}-elasticache`, this, this.props.graphQLElastiCache, this.graphQLVpc.privateSubnets.map(subnet => subnet.subnetId), [this.graphQLSecurityGroup.securityGroupId]);
108
108
  }
109
109
  /**
110
110
  * Create Lambda Role
@@ -120,8 +120,8 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
120
120
  */
121
121
  createLambdaEnvironment() {
122
122
  this.graphQLApiLambdaEnvironment = {
123
- CACHE_REDIS_HOST: `${this.graphQLElastiCache.attrRedisEndpointAddress}`,
124
- CACHE_REDIS_PORT: `${this.graphQLElastiCache.attrRedisEndpointPort}`,
123
+ CACHE_REDIS_HOST: `${this.graphQLElastiCache.attrPrimaryEndPointAddress}`,
124
+ CACHE_REDIS_PORT: `${this.graphQLElastiCache.attrPrimaryEndPointPort}`,
125
125
  NODE_ENV: this.props.nodeEnv,
126
126
  LOG_LEVEL: this.props.logLevel,
127
127
  TZ: this.props.timezone,
@@ -140,6 +140,7 @@ class CloudFrontManager {
140
140
  originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
141
141
  functionAssociations: defaultFunctionAssociations ?? undefined,
142
142
  viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
143
+ edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
143
144
  },
144
145
  additionalBehaviors: props.additionalBehaviors,
145
146
  defaultRootObject: props.defaultRootObject,
@@ -39,4 +39,14 @@ export declare class ElastiCacheManager {
39
39
  * @param {string[]} logDeliveryConfigurations
40
40
  */
41
41
  createElastiCache(id: string, scope: common.CommonConstruct, props: types.ElastiCacheProps, subnetIds: string[], securityGroupIds: string[], logDeliveryConfigurations?: any): elasticache.CfnCacheCluster;
42
+ /**
43
+ * @summary Method to create an replicated elasticache resource
44
+ * @param {string} id scoped id of the resource
45
+ * @param {common.CommonConstruct} scope scope in which scope resource is defined
46
+ * @param {types.ReplicatedElastiCacheProps} props
47
+ * @param {string[]} subnetIds
48
+ * @param {string[]} securityGroupIds
49
+ * @param {string[]} logDeliveryConfigurations
50
+ */
51
+ createReplicatedElastiCache(id: string, scope: common.CommonConstruct, props: types.ReplicatedElastiCacheProps, subnetIds: string[], securityGroupIds: string[], logDeliveryConfigurations?: any): elasticache.CfnReplicationGroup;
42
52
  }
@@ -95,10 +95,52 @@ class ElastiCacheManager {
95
95
  snapshotWindow: props.snapshotWindow,
96
96
  logDeliveryConfigurations: logDeliveryConfigurations,
97
97
  });
98
+ elasticacheCluster.addDependsOn(subnetGroup);
98
99
  utils.createCfnOutput(`${id}-clusterName`, scope, elasticacheCluster.clusterName);
99
100
  utils.createCfnOutput(`${id}-redisEndpointPort`, scope, elasticacheCluster.attrRedisEndpointPort);
100
101
  utils.createCfnOutput(`${id}-redisEndpointAddress`, scope, elasticacheCluster.attrRedisEndpointAddress);
101
102
  return elasticacheCluster;
102
103
  }
104
+ /**
105
+ * @summary Method to create an replicated elasticache resource
106
+ * @param {string} id scoped id of the resource
107
+ * @param {common.CommonConstruct} scope scope in which scope resource is defined
108
+ * @param {types.ReplicatedElastiCacheProps} props
109
+ * @param {string[]} subnetIds
110
+ * @param {string[]} securityGroupIds
111
+ * @param {string[]} logDeliveryConfigurations
112
+ */
113
+ createReplicatedElastiCache(id, scope, props, subnetIds, securityGroupIds, logDeliveryConfigurations) {
114
+ if (!props)
115
+ throw `ElastiCache props undefined`;
116
+ const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
117
+ const elasticacheCluster = new elasticache.CfnReplicationGroup(scope, `${id}`, {
118
+ replicationGroupDescription: `${id} Redis Replication Cluster`,
119
+ replicationGroupId: `${id}-${scope.props.stage}`,
120
+ cacheNodeType: props.cacheNodeType,
121
+ engine: props.engine,
122
+ cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
123
+ securityGroupIds: securityGroupIds,
124
+ numNodeGroups: props.numNodeGroups,
125
+ replicasPerNodeGroup: props.replicasPerNodeGroup,
126
+ automaticFailoverEnabled: props.automaticFailoverEnabled,
127
+ multiAzEnabled: props.multiAzEnabled,
128
+ cacheParameterGroupName: props.cacheParameterGroupName,
129
+ cacheSecurityGroupNames: props.cacheSecurityGroupNames,
130
+ engineVersion: props.engineVersion,
131
+ globalReplicationGroupId: props.globalReplicationGroupId,
132
+ logDeliveryConfigurations: props.logDeliveryConfigurations,
133
+ numCacheClusters: props.numCacheClusters,
134
+ port: props.port,
135
+ preferredCacheClusterAZs: props.preferredCacheClusterAZs,
136
+ preferredMaintenanceWindow: props.preferredMaintenanceWindow,
137
+ primaryClusterId: props.primaryClusterId,
138
+ autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
139
+ });
140
+ elasticacheCluster.addDependsOn(subnetGroup);
141
+ utils.createCfnOutput(`${id}-primaryEndPointPort`, scope, elasticacheCluster.attrPrimaryEndPointPort);
142
+ utils.createCfnOutput(`${id}-primaryEndPointAddress`, scope, elasticacheCluster.attrPrimaryEndPointAddress);
143
+ return elasticacheCluster;
144
+ }
103
145
  }
104
146
  exports.ElastiCacheManager = ElastiCacheManager;
@@ -246,7 +246,7 @@ export interface GraphQlApiLambdaProps extends CommonStackProps {
246
246
  */
247
247
  export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
248
248
  graphQLVpc: ec2.VpcProps;
249
- graphQLElastiCache: ElastiCacheProps;
249
+ graphQLElastiCache: ReplicatedElastiCacheProps;
250
250
  securityGroupExportName: string;
251
251
  useExistingVpc: boolean;
252
252
  vpcName?: string;
@@ -673,6 +673,12 @@ export interface WafWebACLProps extends wafv2.CfnWebACLProps {
673
673
  */
674
674
  export interface ElastiCacheProps extends elasticache.CfnCacheClusterProps {
675
675
  }
676
+ /**
677
+ * @category cdk-utils.elasticache-manager
678
+ * @category Compute
679
+ */
680
+ export interface ReplicatedElastiCacheProps extends elasticache.CfnReplicationGroupProps {
681
+ }
676
682
  /**
677
683
  * @category cdk-utils.sqs-manager
678
684
  * @subcategory Properties
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "7.19.0",
3
+ "version": "7.21.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -35,7 +35,7 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
35
35
 
36
36
  /* graphql restApi resources */
37
37
  graphQLVpc: ec2.IVpc
38
- graphQLElastiCache: elasticache.CfnCacheCluster
38
+ graphQLElastiCache: elasticache.CfnReplicationGroup
39
39
  graphQLSecurityGroup: ec2.ISecurityGroup
40
40
  securityGroupExportName: string
41
41
 
@@ -93,7 +93,7 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
93
93
  * @protected
94
94
  */
95
95
  protected createElastiCache() {
96
- this.graphQLElastiCache = this.elasticacheManager.createElastiCache(
96
+ this.graphQLElastiCache = this.elasticacheManager.createReplicatedElastiCache(
97
97
  `${this.id}-elasticache`,
98
98
  this,
99
99
  this.props.graphQLElastiCache,
@@ -120,8 +120,8 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
120
120
  */
121
121
  protected createLambdaEnvironment() {
122
122
  this.graphQLApiLambdaEnvironment = {
123
- CACHE_REDIS_HOST: `${this.graphQLElastiCache.attrRedisEndpointAddress}`,
124
- CACHE_REDIS_PORT: `${this.graphQLElastiCache.attrRedisEndpointPort}`,
123
+ CACHE_REDIS_HOST: `${this.graphQLElastiCache.attrPrimaryEndPointAddress}`,
124
+ CACHE_REDIS_PORT: `${this.graphQLElastiCache.attrPrimaryEndPointPort}`,
125
125
  NODE_ENV: this.props.nodeEnv,
126
126
  LOG_LEVEL: this.props.logLevel,
127
127
  TZ: this.props.timezone,
@@ -144,6 +144,7 @@ export class CloudFrontManager {
144
144
  originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
145
145
  functionAssociations: defaultFunctionAssociations ?? undefined,
146
146
  viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
147
+ edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
147
148
  },
148
149
  additionalBehaviors: props.additionalBehaviors,
149
150
  defaultRootObject: props.defaultRootObject,
@@ -83,10 +83,65 @@ export class ElastiCacheManager {
83
83
  logDeliveryConfigurations: logDeliveryConfigurations,
84
84
  })
85
85
 
86
+ elasticacheCluster.addDependsOn(subnetGroup)
87
+
86
88
  utils.createCfnOutput(`${id}-clusterName`, scope, elasticacheCluster.clusterName)
87
89
  utils.createCfnOutput(`${id}-redisEndpointPort`, scope, elasticacheCluster.attrRedisEndpointPort)
88
90
  utils.createCfnOutput(`${id}-redisEndpointAddress`, scope, elasticacheCluster.attrRedisEndpointAddress)
89
91
 
90
92
  return elasticacheCluster
91
93
  }
94
+
95
+ /**
96
+ * @summary Method to create an replicated elasticache resource
97
+ * @param {string} id scoped id of the resource
98
+ * @param {common.CommonConstruct} scope scope in which scope resource is defined
99
+ * @param {types.ReplicatedElastiCacheProps} props
100
+ * @param {string[]} subnetIds
101
+ * @param {string[]} securityGroupIds
102
+ * @param {string[]} logDeliveryConfigurations
103
+ */
104
+ public createReplicatedElastiCache(
105
+ id: string,
106
+ scope: common.CommonConstruct,
107
+ props: types.ReplicatedElastiCacheProps,
108
+ subnetIds: string[],
109
+ securityGroupIds: string[],
110
+ logDeliveryConfigurations?: any
111
+ ) {
112
+ if (!props) throw `ElastiCache props undefined`
113
+
114
+ const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds)
115
+
116
+ const elasticacheCluster = new elasticache.CfnReplicationGroup(scope, `${id}`, {
117
+ replicationGroupDescription: `${id} Redis Replication Cluster`,
118
+ replicationGroupId: `${id}-${scope.props.stage}`,
119
+ cacheNodeType: props.cacheNodeType,
120
+ engine: props.engine,
121
+ cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
122
+ securityGroupIds: securityGroupIds,
123
+ numNodeGroups: props.numNodeGroups,
124
+ replicasPerNodeGroup: props.replicasPerNodeGroup,
125
+ automaticFailoverEnabled: props.automaticFailoverEnabled,
126
+ multiAzEnabled: props.multiAzEnabled,
127
+ cacheParameterGroupName: props.cacheParameterGroupName,
128
+ cacheSecurityGroupNames: props.cacheSecurityGroupNames,
129
+ engineVersion: props.engineVersion,
130
+ globalReplicationGroupId: props.globalReplicationGroupId,
131
+ logDeliveryConfigurations: props.logDeliveryConfigurations,
132
+ numCacheClusters: props.numCacheClusters,
133
+ port: props.port,
134
+ preferredCacheClusterAZs: props.preferredCacheClusterAZs,
135
+ preferredMaintenanceWindow: props.preferredMaintenanceWindow,
136
+ primaryClusterId: props.primaryClusterId,
137
+ autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
138
+ })
139
+
140
+ elasticacheCluster.addDependsOn(subnetGroup)
141
+
142
+ utils.createCfnOutput(`${id}-primaryEndPointPort`, scope, elasticacheCluster.attrPrimaryEndPointPort)
143
+ utils.createCfnOutput(`${id}-primaryEndPointAddress`, scope, elasticacheCluster.attrPrimaryEndPointAddress)
144
+
145
+ return elasticacheCluster
146
+ }
92
147
  }
@@ -266,7 +266,7 @@ export interface GraphQlApiLambdaProps extends CommonStackProps {
266
266
  */
267
267
  export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
268
268
  graphQLVpc: ec2.VpcProps
269
- graphQLElastiCache: ElastiCacheProps
269
+ graphQLElastiCache: ReplicatedElastiCacheProps
270
270
  securityGroupExportName: string
271
271
  useExistingVpc: boolean
272
272
  vpcName?: string
@@ -716,6 +716,12 @@ export interface WafWebACLProps extends wafv2.CfnWebACLProps {}
716
716
  */
717
717
  export interface ElastiCacheProps extends elasticache.CfnCacheClusterProps {}
718
718
 
719
+ /**
720
+ * @category cdk-utils.elasticache-manager
721
+ * @category Compute
722
+ */
723
+ export interface ReplicatedElastiCacheProps extends elasticache.CfnReplicationGroupProps {}
724
+
719
725
  /**
720
726
  * @category cdk-utils.sqs-manager
721
727
  * @subcategory Properties