@digitraffic/common 2023.1.31-1 → 2023.2.1-1

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.
@@ -21,12 +21,12 @@ class DbProxyStack extends aws_cdk_lib_1.Stack {
21
21
  secretCompleteArn: configuration.secretArn,
22
22
  });
23
23
  const proxy = this.createProxy(vpc, secret, configuration);
24
- const readerEndpoint = this.createProxyEndpoints(vpc, proxy, configuration.securityGroupId);
24
+ const readerEndpoint = this.createProxyEndpoints(vpc, proxy, configuration.proxy.securityGroupId);
25
25
  this.setOutputs(configuration, proxy, readerEndpoint);
26
26
  }
27
27
  createProxy(vpc, secret, configuration) {
28
28
  const proxyId = `${this.isc.environmentName}-proxy`;
29
- const securityGroup = aws_ec2_1.SecurityGroup.fromSecurityGroupId(this, "securitygroup", configuration.securityGroupId);
29
+ const securityGroup = aws_ec2_1.SecurityGroup.fromSecurityGroupId(this, "securitygroup", configuration.proxy.securityGroupId);
30
30
  const cluster = aws_rds_1.DatabaseCluster.fromDatabaseClusterAttributes(this, "db-cluster", {
31
31
  clusterIdentifier: (0, import_util_1.importValue)(this.isc.environmentName, db_stack_1.DbStack.CLUSTER_IDENTIFIER_EXPORT_NAME),
32
32
  engine: aws_rds_1.DatabaseClusterEngine.AURORA_POSTGRESQL,
@@ -38,7 +38,7 @@ class DbProxyStack extends aws_cdk_lib_1.Stack {
38
38
  /* nothing */
39
39
  };
40
40
  return new aws_rds_1.DatabaseProxy(this, proxyId, {
41
- dbProxyName: configuration.dbProxyName ?? "AuroraProxy",
41
+ dbProxyName: configuration.proxy.name ?? "AuroraProxy",
42
42
  securityGroups: [securityGroup],
43
43
  proxyTarget: aws_rds_1.ProxyTarget.fromCluster(cluster),
44
44
  idleClientTimeout: aws_cdk_lib_1.Duration.seconds(1800),
@@ -14,7 +14,10 @@ export interface DbConfiguration {
14
14
  readonly instances: number;
15
15
  readonly customParameterGroup: boolean;
16
16
  readonly securityGroupId: string;
17
- readonly dbProxyName?: string;
17
+ readonly proxy: {
18
+ readonly name?: string;
19
+ readonly securityGroupId: string;
20
+ };
18
21
  }
19
22
  /**
20
23
  * How to upgrade major version?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitraffic/common",
3
- "version": "2023.01.31-1",
3
+ "version": "2023.02.01-1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,11 +38,12 @@ export class DbProxyStack extends Stack {
38
38
  const secret = Secret.fromSecretAttributes(this, "proxy-secret", {
39
39
  secretCompleteArn: configuration.secretArn,
40
40
  });
41
+
41
42
  const proxy = this.createProxy(vpc, secret, configuration);
42
43
  const readerEndpoint = this.createProxyEndpoints(
43
44
  vpc,
44
45
  proxy,
45
- configuration.securityGroupId
46
+ configuration.proxy.securityGroupId
46
47
  );
47
48
  this.setOutputs(configuration, proxy, readerEndpoint);
48
49
  }
@@ -52,7 +53,7 @@ export class DbProxyStack extends Stack {
52
53
  const securityGroup = SecurityGroup.fromSecurityGroupId(
53
54
  this,
54
55
  "securitygroup",
55
- configuration.securityGroupId
56
+ configuration.proxy.securityGroupId
56
57
  );
57
58
 
58
59
  const cluster = DatabaseCluster.fromDatabaseClusterAttributes(
@@ -75,7 +76,7 @@ export class DbProxyStack extends Stack {
75
76
  };
76
77
 
77
78
  return new DatabaseProxy(this, proxyId, {
78
- dbProxyName: configuration.dbProxyName ?? "AuroraProxy",
79
+ dbProxyName: configuration.proxy.name ?? "AuroraProxy",
79
80
  securityGroups: [securityGroup],
80
81
  proxyTarget: ProxyTarget.fromCluster(cluster),
81
82
  idleClientTimeout: Duration.seconds(1800),
@@ -29,7 +29,10 @@ export interface DbConfiguration {
29
29
  readonly customParameterGroup: boolean;
30
30
  readonly securityGroupId: string;
31
31
 
32
- readonly dbProxyName?: string;
32
+ readonly proxy: {
33
+ readonly name?: string;
34
+ readonly securityGroupId: string;
35
+ };
33
36
  }
34
37
 
35
38
  /**