@studion/infra-code-blocks 0.6.6 → 0.6.7

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Database = void 0;
4
4
  const aws = require("@pulumi/aws");
5
5
  const pulumi = require("@pulumi/pulumi");
6
+ const random = require("@pulumi/random");
6
7
  const password_1 = require("./password");
7
8
  const constants_1 = require("../constants");
8
9
  const defaults = {
@@ -90,9 +91,13 @@ class Database extends pulumi.ComponentResource {
90
91
  return monitoringRole;
91
92
  }
92
93
  createEncryptedSnapshotCopy(snapshotIdentifier) {
94
+ const targetDbSnapshotIdentifier = new random.RandomString(`${this.name}-snapshot-copy-identifier-sufix`, {
95
+ length: 10,
96
+ special: false,
97
+ }, { parent: this }).result.apply(sufix => `${snapshotIdentifier}-${sufix}`);
93
98
  const encryptedSnapshotCopy = new aws.rds.SnapshotCopy(`${this.name}-encrypted-snapshot-copy`, {
94
99
  sourceDbSnapshotIdentifier: snapshotIdentifier,
95
- targetDbSnapshotIdentifier: `${snapshotIdentifier}-${Date.now()}`,
100
+ targetDbSnapshotIdentifier,
96
101
  kmsKeyId: this.kms.arn,
97
102
  }, { parent: this });
98
103
  return encryptedSnapshotCopy;
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.7",
4
4
  "description": "Studion common infra components",
5
5
  "keywords": [
6
6
  "infrastructure",