aws-cdk-lib.aws_rds.CredentialsFromUsernameOptions

interface CredentialsFromUsernameOptions

LanguageType name
.NETAmazon.CDK.AWS.RDS.CredentialsFromUsernameOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsrds#CredentialsFromUsernameOptions
Javasoftware.amazon.awscdk.services.rds.CredentialsFromUsernameOptions
Pythonaws_cdk.aws_rds.CredentialsFromUsernameOptions
TypeScript (source)aws-cdk-lib » aws_rds » CredentialsFromUsernameOptions

Options for creating Credentials from a username.

Example

declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.VER_15_2 }),
  credentials: rds.Credentials.fromUsername('adminuser', { password: cdk.SecretValue.unsafePlainText('7959866cacc02c2d243ecfe177464fe6') }),
  instanceProps: {
    instanceType: ec2.InstanceType.of(ec2.InstanceClass.X2G, ec2.InstanceSize.XLARGE),
    vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
    vpc,
  },
  storageType: rds.DBClusterStorageType.AURORA_IOPT1,
});

Properties

NameTypeDescription
encryptionKey?IKeyKMS encryption key to encrypt the generated secret.
excludeCharacters?stringThe characters to exclude from the generated password.
password?SecretValuePassword.
replicaRegions?ReplicaRegion[]A list of regions where to replicate this secret.
secretName?stringThe name of the secret.

encryptionKey?

Type: IKey (optional, default: default master key)

KMS encryption key to encrypt the generated secret.


excludeCharacters?

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

The characters to exclude from the generated password.

Has no effect if password has been provided.


password?

Type: SecretValue (optional, default: a Secrets Manager generated password)

Password.

Do not put passwords in your CDK code directly.


replicaRegions?

Type: ReplicaRegion[] (optional, default: Secret is not replicated)

A list of regions where to replicate this secret.


secretName?

Type: string (optional, default: A name is generated by CloudFormation.)

The name of the secret.