Skip to content
v2.274.0

SnapshotCredentialsFromGeneratedPasswordOptions Struct ​

Options used in the SnapshotCredentials.fromGeneratedPassword method.

Example ​

ts
declare const vpc: ec2.Vpc;
const engine = rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_16_3 });
const myKey = new kms.Key(this, 'MyKey');

new rds.DatabaseInstanceFromSnapshot(this, 'InstanceFromSnapshotWithCustomizedSecret', {
  engine,
  vpc,
  snapshotIdentifier: 'mySnapshot',
  credentials: rds.SnapshotCredentials.fromGeneratedSecret('username', {
    encryptionKey: myKey,
    excludeCharacters: '!&*^#@()',
    replicaRegions: [{ region: 'eu-west-1' }, { region: 'eu-west-2' }],
  }),
});

Properties ​

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey#
KMS encryption key to encrypt the generated secret.

Default: default master key

excludeCharactersstringexclude_charactersstrexcludeCharactersStringExcludeCharactersstringExcludeCharacters*string#
The characters to exclude from the generated password.

Default: the DatabaseSecret default exclude character set (" %+~`#$&*()|[]{}:;<>?!'/@"\")

replicaRegionsReplicaRegion[]replica_regionstyping.List[ReplicaRegion]replicaRegionsList<ReplicaRegion>ReplicaRegionsReplicaRegion[]ReplicaRegions*[]ReplicaRegion#
A list of regions where to replicate this secret.

Default: Secret is not replicated