Interface CfnSecret.IGenerateSecretStringProperty
Generates a random password.
Namespace: Amazon.CDK.AWS.SecretsManager
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IGenerateSecretStringProperty
Syntax (vb)
Public Interface IGenerateSecretStringProperty
Remarks
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 .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SecretsManager;
var generateSecretStringProperty = new GenerateSecretStringProperty {
ExcludeCharacters = "excludeCharacters",
ExcludeLowercase = false,
ExcludeNumbers = false,
ExcludePunctuation = false,
ExcludeUppercase = false,
GenerateStringKey = "generateStringKey",
IncludeSpace = false,
PasswordLength = 123,
RequireEachIncludedType = false,
SecretStringTemplate = "secretStringTemplate"
};
Synopsis
Properties
ExcludeCharacters | A string of the characters that you don't want in the password. |
ExcludeLowercase | Specifies whether to exclude lowercase letters from the password. |
ExcludeNumbers | Specifies whether to exclude numbers from the password. |
ExcludePunctuation | Specifies whether to exclude the following punctuation characters from the password: `! |
ExcludeUppercase | Specifies whether to exclude uppercase letters from the password. |
GenerateStringKey | The JSON key name for the key/value pair, where the value is the generated password. |
IncludeSpace | Specifies whether to include the space character. |
PasswordLength | The length of the password. |
RequireEachIncludedType | Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. |
SecretStringTemplate | A template that the generated string must match. |
Properties
ExcludeCharacters
A string of the characters that you don't want in the password.
virtual string ExcludeCharacters { get; }
Property Value
System.String
Remarks
ExcludeLowercase
Specifies whether to exclude lowercase letters from the password.
virtual object ExcludeLowercase { get; }
Property Value
System.Object
Remarks
If you don't include this switch, the password can contain lowercase letters.
ExcludeNumbers
Specifies whether to exclude numbers from the password.
virtual object ExcludeNumbers { get; }
Property Value
System.Object
Remarks
If you don't include this switch, the password can contain numbers.
ExcludePunctuation
Specifies whether to exclude the following punctuation characters from the password: `!
virtual object ExcludePunctuation { get; }
Property Value
System.Object
Remarks
" # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ { | } ~
. If you don't include this switch, the password can contain punctuation.
ExcludeUppercase
Specifies whether to exclude uppercase letters from the password.
virtual object ExcludeUppercase { get; }
Property Value
System.Object
Remarks
If you don't include this switch, the password can contain uppercase letters.
GenerateStringKey
The JSON key name for the key/value pair, where the value is the generated password.
virtual string GenerateStringKey { get; }
Property Value
System.String
Remarks
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
Specifies whether to include the space character.
virtual object IncludeSpace { get; }
Property Value
System.Object
Remarks
If you include this switch, the password can contain space characters.
PasswordLength
The length of the password.
virtual Nullable<double> PasswordLength { get; }
Property Value
System.Nullable<System.Double>
Remarks
If you don't include this parameter, the default length is 32 characters.
RequireEachIncludedType
Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
virtual object RequireEachIncludedType { get; }
Property Value
System.Object
Remarks
If you don't include this switch, the password contains at least one of every character type.
SecretStringTemplate
A template that the generated string must match.
virtual string SecretStringTemplate { get; }
Property Value
System.String
Remarks
When you make a change to this property, a new secret version is created.