@studion/infra-code-blocks 0.6.6 → 0.6.8

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.
@@ -52,6 +52,11 @@ export type DatabaseArgs = {
52
52
  * Set this to true to enable database monitoring. Defaults to false.
53
53
  */
54
54
  enableMonitoring?: pulumi.Input<boolean>;
55
+ /**
56
+ * Set this to true to allow major version upgrades, for example when creating
57
+ * db from the snapshot. Defaults to false.
58
+ */
59
+ allowMajorVersionUpgrade?: pulumi.Input<boolean>;
55
60
  /**
56
61
  * The name of custom aws.rds.ParameterGroup. Setting this param will apply custom
57
62
  * DB parameters to this instance.
@@ -13,6 +13,7 @@ const defaults = {
13
13
  maxAllocatedStorage: 100,
14
14
  instanceClass: 'db.t4g.micro',
15
15
  enableMonitoring: false,
16
+ allowMajorVersionUpgrade: false,
16
17
  };
17
18
  class Database extends pulumi.ComponentResource {
18
19
  constructor(name, args, opts = {}) {
@@ -92,7 +93,7 @@ class Database extends pulumi.ComponentResource {
92
93
  createEncryptedSnapshotCopy(snapshotIdentifier) {
93
94
  const encryptedSnapshotCopy = new aws.rds.SnapshotCopy(`${this.name}-encrypted-snapshot-copy`, {
94
95
  sourceDbSnapshotIdentifier: snapshotIdentifier,
95
- targetDbSnapshotIdentifier: `${snapshotIdentifier}-${Date.now()}`,
96
+ targetDbSnapshotIdentifier: `${snapshotIdentifier}-encrypted-copy`,
96
97
  kmsKeyId: this.kms.arn,
97
98
  }, { parent: this });
98
99
  return encryptedSnapshotCopy;
@@ -109,7 +110,7 @@ class Database extends pulumi.ComponentResource {
109
110
  performanceInsightsRetentionPeriod: 7,
110
111
  }
111
112
  : {};
112
- const instance = new aws.rds.Instance(`${this.name}-rds`, Object.assign(Object.assign({ identifierPrefix: `${this.name}-`, engine: 'postgres', engineVersion: '15.5', allocatedStorage: argsWithDefaults.allocatedStorage, maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage, instanceClass: argsWithDefaults.instanceClass, dbName: argsWithDefaults.dbName, username: argsWithDefaults.username, password: this.password.value, dbSubnetGroupName: this.dbSubnetGroup.name, vpcSecurityGroupIds: [this.dbSecurityGroup.id], storageEncrypted: true, kmsKeyId: this.kms.arn, multiAz: argsWithDefaults.multiAz, publiclyAccessible: false, skipFinalSnapshot: argsWithDefaults.skipFinalSnapshot, applyImmediately: argsWithDefaults.applyImmediately, autoMinorVersionUpgrade: true, maintenanceWindow: 'Mon:07:00-Mon:07:30', finalSnapshotIdentifier: `${this.name}-final-snapshot-${stack}`, backupWindow: '06:00-06:30', backupRetentionPeriod: 14, caCertIdentifier: 'rds-ca-rsa2048-g1', parameterGroupName: argsWithDefaults.parameterGroupName, allowMajorVersionUpgrade: Boolean(argsWithDefaults.snapshotIdentifier), snapshotIdentifier: (_a = this.encryptedSnapshotCopy) === null || _a === void 0 ? void 0 : _a.targetDbSnapshotIdentifier }, monitoringOptions), { tags: Object.assign(Object.assign({}, constants_1.commonTags), argsWithDefaults.tags) }), { parent: this, dependsOn: [this.password] });
113
+ const instance = new aws.rds.Instance(`${this.name}-rds`, Object.assign(Object.assign({ identifierPrefix: `${this.name}-`, engine: 'postgres', engineVersion: '15.5', allocatedStorage: argsWithDefaults.allocatedStorage, maxAllocatedStorage: argsWithDefaults.maxAllocatedStorage, instanceClass: argsWithDefaults.instanceClass, dbName: argsWithDefaults.dbName, username: argsWithDefaults.username, password: this.password.value, dbSubnetGroupName: this.dbSubnetGroup.name, vpcSecurityGroupIds: [this.dbSecurityGroup.id], storageEncrypted: true, kmsKeyId: this.kms.arn, multiAz: argsWithDefaults.multiAz, publiclyAccessible: false, skipFinalSnapshot: argsWithDefaults.skipFinalSnapshot, applyImmediately: argsWithDefaults.applyImmediately, autoMinorVersionUpgrade: true, maintenanceWindow: 'Mon:07:00-Mon:07:30', finalSnapshotIdentifier: `${this.name}-final-snapshot-${stack}`, backupWindow: '06:00-06:30', backupRetentionPeriod: 14, caCertIdentifier: 'rds-ca-rsa2048-g1', parameterGroupName: argsWithDefaults.parameterGroupName, allowMajorVersionUpgrade: argsWithDefaults.allowMajorVersionUpgrade, snapshotIdentifier: (_a = this.encryptedSnapshotCopy) === null || _a === void 0 ? void 0 : _a.targetDbSnapshotIdentifier }, monitoringOptions), { tags: Object.assign(Object.assign({}, constants_1.commonTags), argsWithDefaults.tags) }), { parent: this, dependsOn: [this.password] });
113
114
  return instance;
114
115
  }
115
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studion/infra-code-blocks",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",