Class: AWSCDK::RDS::CredentialsFromUsernameOptions

Inherits:
CredentialsBaseOptions
  • Object
show all
Defined in:
rds/credentials_from_username_options.rb

Overview

Options for creating Credentials from a username.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encryption_key: nil, exclude_characters: nil, replica_regions: nil, secret_name: nil, password: nil) ⇒ CredentialsFromUsernameOptions

Returns a new instance of CredentialsFromUsernameOptions.

Parameters:

  • encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    KMS encryption key to encrypt the generated secret.

  • exclude_characters (String, nil) (defaults to: nil)

    The characters to exclude from the generated password.

  • replica_regions (Array<AWSCDK::SecretsManager::ReplicaRegion>, nil) (defaults to: nil)

    A list of regions where to replicate this secret.

  • secret_name (String, nil) (defaults to: nil)

    The name of the secret.

  • password (AWSCDK::SecretValue, nil) (defaults to: nil)

    Password.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'rds/credentials_from_username_options.rb', line 12

def initialize(encryption_key: nil, exclude_characters: nil, replica_regions: nil, secret_name: nil, password: nil)
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil?
  @exclude_characters = exclude_characters
  Jsii::Type.check_type(@exclude_characters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "excludeCharacters") unless @exclude_characters.nil?
  @replica_regions = replica_regions.is_a?(Array) ? replica_regions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::SecretsManager::ReplicaRegion.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : replica_regions
  Jsii::Type.check_type(@replica_regions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zZWNyZXRzbWFuYWdlci5SZXBsaWNhUmVnaW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "replicaRegions") unless @replica_regions.nil?
  @secret_name = secret_name
  Jsii::Type.check_type(@secret_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secretName") unless @secret_name.nil?
  @password = password
  Jsii::Type.check_type(@password, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TZWNyZXRWYWx1ZSJ9")), "password") unless @password.nil?
end

Instance Attribute Details

#encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - default master key

KMS encryption key to encrypt the generated secret.

Returns:



29
30
31
# File 'rds/credentials_from_username_options.rb', line 29

def encryption_key
  @encryption_key
end

#exclude_charactersString? (readonly)

Note:

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

The characters to exclude from the generated password.

Has no effect if password has been provided.

Returns:

  • (String, nil)


36
37
38
# File 'rds/credentials_from_username_options.rb', line 36

def exclude_characters
  @exclude_characters
end

#passwordAWSCDK::SecretValue? (readonly)

Note:

Default: - a Secrets Manager generated password

Password.

Do not put passwords in your CDK code directly.

Returns:



53
54
55
# File 'rds/credentials_from_username_options.rb', line 53

def password
  @password
end

#replica_regionsArray<AWSCDK::SecretsManager::ReplicaRegion>? (readonly)

Note:

Default: - Secret is not replicated

A list of regions where to replicate this secret.

Returns:



41
42
43
# File 'rds/credentials_from_username_options.rb', line 41

def replica_regions
  @replica_regions
end

#secret_nameString? (readonly)

Note:

Default: - A name is generated by CloudFormation.

The name of the secret.

Returns:

  • (String, nil)


46
47
48
# File 'rds/credentials_from_username_options.rb', line 46

def secret_name
  @secret_name
end

Class Method Details

.jsii_propertiesObject



55
56
57
58
59
60
61
62
63
# File 'rds/credentials_from_username_options.rb', line 55

def self.jsii_properties
  {
    :encryption_key => "encryptionKey",
    :exclude_characters => "excludeCharacters",
    :replica_regions => "replicaRegions",
    :secret_name => "secretName",
    :password => "password",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
75
76
# File 'rds/credentials_from_username_options.rb', line 65

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "encryptionKey" => @encryption_key,
    "excludeCharacters" => @exclude_characters,
    "replicaRegions" => @replica_regions,
    "secretName" => @secret_name,
    "password" => @password,
  })
  result.compact
end