Class CredentialsBaseOptions
Base options for creating Credentials.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CredentialsBaseOptions : ICredentialsBaseOptions
Syntax (vb)
Public Class CredentialsBaseOptions Implements ICredentialsBaseOptions
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
var myKey = new Key(this, "MyKey");
new DatabaseInstance(this, "InstanceWithCustomizedSecret", new DatabaseInstanceProps {
Engine = engine,
Vpc = vpc,
Credentials = Credentials.FromGeneratedSecret("postgres", new CredentialsBaseOptions {
SecretName = "my-cool-name",
EncryptionKey = myKey,
ExcludeCharacters = "!&*^#@()",
ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
})
});
Synopsis
Constructors
| CredentialsBaseOptions() | Base options for creating Credentials. |
Properties
| EncryptionKey | KMS encryption key to encrypt the generated secret. |
| ExcludeCharacters | Base options for creating Credentials. |
| ReplicaRegions | A list of regions where to replicate this secret. |
| SecretName | The name of the secret. |
Constructors
CredentialsBaseOptions()
Base options for creating Credentials.
public CredentialsBaseOptions()
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
var myKey = new Key(this, "MyKey");
new DatabaseInstance(this, "InstanceWithCustomizedSecret", new DatabaseInstanceProps {
Engine = engine,
Vpc = vpc,
Credentials = Credentials.FromGeneratedSecret("postgres", new CredentialsBaseOptions {
SecretName = "my-cool-name",
EncryptionKey = myKey,
ExcludeCharacters = "!&*^#@()",
ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
})
});
Properties
EncryptionKey
KMS encryption key to encrypt the generated secret.
public IKey? EncryptionKey { get; set; }
Property Value
Remarks
Default: - default master key
ExcludeCharacters
Base options for creating Credentials.
public string? ExcludeCharacters { get; set; }
Property Value
Remarks
ExampleMetadata: infused
ReplicaRegions
A list of regions where to replicate this secret.
public IReplicaRegion[]? ReplicaRegions { get; set; }
Property Value
Remarks
Default: - Secret is not replicated
SecretName
The name of the secret.
public string? SecretName { get; set; }
Property Value
Remarks
Default: - A name is generated by CloudFormation.