aws-cdk-lib.aws_secretsmanager.CfnSecret.GenerateSecretStringProperty

interface GenerateSecretStringProperty

LanguageType name
.NETAmazon.CDK.AWS.SecretsManager.CfnSecret.GenerateSecretStringProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awssecretsmanager#CfnSecret_GenerateSecretStringProperty
Javasoftware.amazon.awscdk.services.secretsmanager.CfnSecret.GenerateSecretStringProperty
Pythonaws_cdk.aws_secretsmanager.CfnSecret.GenerateSecretStringProperty
TypeScript aws-cdk-lib » aws_secretsmanager » CfnSecret » GenerateSecretStringProperty

Generates a random password.

We recommend that you specify the maximum length and include every character type that the system you are generating a password for can support.

Required permissions: secretsmanager:GetRandomPassword . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
const generateSecretStringProperty: secretsmanager.CfnSecret.GenerateSecretStringProperty = {
  excludeCharacters: 'excludeCharacters',
  excludeLowercase: false,
  excludeNumbers: false,
  excludePunctuation: false,
  excludeUppercase: false,
  generateStringKey: 'generateStringKey',
  includeSpace: false,
  passwordLength: 123,
  requireEachIncludedType: false,
  secretStringTemplate: 'secretStringTemplate',
};

Properties

NameTypeDescription
excludeCharacters?stringA string of the characters that you don't want in the password.
excludeLowercase?boolean | IResolvableSpecifies whether to exclude lowercase letters from the password.
excludeNumbers?boolean | IResolvableSpecifies whether to exclude numbers from the password.
excludePunctuation?boolean | IResolvableSpecifies whether to exclude the following punctuation characters from the password: `!
excludeUppercase?boolean | IResolvableSpecifies whether to exclude uppercase letters from the password.
generateStringKey?stringThe JSON key name for the key/value pair, where the value is the generated password.
includeSpace?boolean | IResolvableSpecifies whether to include the space character.
passwordLength?numberThe length of the password.
requireEachIncludedType?boolean | IResolvableSpecifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
secretStringTemplate?stringA template that the generated string must match.

excludeCharacters?

Type: string (optional)

A string of the characters that you don't want in the password.


excludeLowercase?

Type: boolean | IResolvable (optional)

Specifies whether to exclude lowercase letters from the password.

If you don't include this switch, the password can contain lowercase letters.


excludeNumbers?

Type: boolean | IResolvable (optional)

Specifies whether to exclude numbers from the password.

If you don't include this switch, the password can contain numbers.


excludePunctuation?

Type: boolean | IResolvable (optional)

Specifies whether to exclude the following punctuation characters from the password: `!

" # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ { | } ~ . If you don't include this switch, the password can contain punctuation.


excludeUppercase?

Type: boolean | IResolvable (optional)

Specifies whether to exclude uppercase letters from the password.

If you don't include this switch, the password can contain uppercase letters.


generateStringKey?

Type: string (optional)

The JSON key name for the key/value pair, where the value is the generated password.

This pair is added to the JSON structure specified by the SecretStringTemplate parameter. If you specify this parameter, then you must also specify SecretStringTemplate .


includeSpace?

Type: boolean | IResolvable (optional)

Specifies whether to include the space character.

If you include this switch, the password can contain space characters.


passwordLength?

Type: number (optional)

The length of the password.

If you don't include this parameter, the default length is 32 characters.


requireEachIncludedType?

Type: boolean | IResolvable (optional)

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

If you don't include this switch, the password contains at least one of every character type.


secretStringTemplate?

Type: string (optional)

A template that the generated string must match.

When you make a change to this property, a new secret version is created.