File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import * as aws from '@pulumi/aws' ;
22import * as pulumi from '@pulumi/pulumi' ;
3+ import * as random from '@pulumi/random' ;
34import { Password } from './password' ;
45import { commonTags } from '../constants' ;
56
@@ -215,11 +216,20 @@ export class Database extends pulumi.ComponentResource {
215216 private createEncryptedSnapshotCopy (
216217 snapshotIdentifier : NonNullable < DatabaseArgs [ 'snapshotIdentifier' ] > ,
217218 ) {
219+ const targetDbSnapshotIdentifier = new random . RandomString (
220+ `${ this . name } -snapshot-copy-identifier-sufix` ,
221+ {
222+ length : 10 ,
223+ special : false ,
224+ } ,
225+ { parent : this } ,
226+ ) . result . apply ( sufix => `${ snapshotIdentifier } -${ sufix } ` ) ;
227+
218228 const encryptedSnapshotCopy = new aws . rds . SnapshotCopy (
219229 `${ this . name } -encrypted-snapshot-copy` ,
220230 {
221231 sourceDbSnapshotIdentifier : snapshotIdentifier ,
222- targetDbSnapshotIdentifier : ` ${ snapshotIdentifier } - ${ Date . now ( ) } ` ,
232+ targetDbSnapshotIdentifier,
223233 kmsKeyId : this . kms . arn ,
224234 } ,
225235 { parent : this } ,
You can’t perform that action at this time.
0 commit comments