Class: AWSCDK::RDS::DatabaseSecretProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::RDS::DatabaseSecretProps
- Defined in:
- rds/database_secret_props.rb
Overview
Construction properties for a DatabaseSecret.
Instance Attribute Summary collapse
-
#dbname ⇒ String?
readonly
The database name, if not using the default one.
-
#encryption_key ⇒ AWSCDK::KMS::IKey?
readonly
The KMS key to use to encrypt the secret.
-
#exclude_characters ⇒ String?
readonly
Characters to not include in the generated password.
-
#master_secret ⇒ AWSCDK::SecretsManager::ISecret?
readonly
The master secret which will be used to rotate this secret.
-
#replace_on_password_criteria_changes ⇒ Boolean?
readonly
Whether to replace this secret when the criteria for the password change.
-
#replica_regions ⇒ Array<AWSCDK::SecretsManager::ReplicaRegion>?
readonly
A list of regions where to replicate this secret.
-
#secret_name ⇒ String?
readonly
A name for the secret.
-
#username ⇒ String
readonly
The username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(username:, dbname: nil, encryption_key: nil, exclude_characters: nil, master_secret: nil, replace_on_password_criteria_changes: nil, replica_regions: nil, secret_name: nil) ⇒ DatabaseSecretProps
constructor
A new instance of DatabaseSecretProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(username:, dbname: nil, encryption_key: nil, exclude_characters: nil, master_secret: nil, replace_on_password_criteria_changes: nil, replica_regions: nil, secret_name: nil) ⇒ DatabaseSecretProps
Returns a new instance of DatabaseSecretProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'rds/database_secret_props.rb', line 15 def initialize(username:, dbname: nil, encryption_key: nil, exclude_characters: nil, master_secret: nil, replace_on_password_criteria_changes: nil, replica_regions: nil, secret_name: nil) @username = username Jsii::Type.check_type(@username, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "username") @dbname = dbname Jsii::Type.check_type(@dbname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dbname") unless @dbname.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? @master_secret = master_secret Jsii::Type.check_type(@master_secret, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "masterSecret") unless @master_secret.nil? @replace_on_password_criteria_changes = replace_on_password_criteria_changes Jsii::Type.check_type(@replace_on_password_criteria_changes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "replaceOnPasswordCriteriaChanges") unless @replace_on_password_criteria_changes.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? end |
Instance Attribute Details
#dbname ⇒ String? (readonly)
Default: - whatever the secret generates after the attach method is run
The database name, if not using the default one.
42 43 44 |
# File 'rds/database_secret_props.rb', line 42 def dbname @dbname end |
#encryption_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: default master key
The KMS key to use to encrypt the secret.
47 48 49 |
# File 'rds/database_secret_props.rb', line 47 def encryption_key @encryption_key end |
#exclude_characters ⇒ String? (readonly)
Default: " %+~`#$&*()|[]{}:;<>?!'/@\"\"
Characters to not include in the generated password.
52 53 54 |
# File 'rds/database_secret_props.rb', line 52 def exclude_characters @exclude_characters end |
#master_secret ⇒ AWSCDK::SecretsManager::ISecret? (readonly)
Default: - no master secret information will be included
The master secret which will be used to rotate this secret.
57 58 59 |
# File 'rds/database_secret_props.rb', line 57 def master_secret @master_secret end |
#replace_on_password_criteria_changes ⇒ Boolean? (readonly)
Default: false
Whether to replace this secret when the criteria for the password change.
This is achieved by overriding the logical id of the AWS::SecretsManager::Secret with a hash of the options that influence the password generation. This way a new secret will be created when the password is regenerated and the cluster or instance consuming this secret will have its credentials updated.
67 68 69 |
# File 'rds/database_secret_props.rb', line 67 def replace_on_password_criteria_changes @replace_on_password_criteria_changes end |
#replica_regions ⇒ Array<AWSCDK::SecretsManager::ReplicaRegion>? (readonly)
Default: - Secret is not replicated
A list of regions where to replicate this secret.
72 73 74 |
# File 'rds/database_secret_props.rb', line 72 def replica_regions @replica_regions end |
#secret_name ⇒ String? (readonly)
Default: - A name is generated by CloudFormation.
A name for the secret.
77 78 79 |
# File 'rds/database_secret_props.rb', line 77 def secret_name @secret_name end |
#username ⇒ String (readonly)
The username.
37 38 39 |
# File 'rds/database_secret_props.rb', line 37 def username @username end |
Class Method Details
.jsii_properties ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'rds/database_secret_props.rb', line 79 def self.jsii_properties { :username => "username", :dbname => "dbname", :encryption_key => "encryptionKey", :exclude_characters => "excludeCharacters", :master_secret => "masterSecret", :replace_on_password_criteria_changes => "replaceOnPasswordCriteriaChanges", :replica_regions => "replicaRegions", :secret_name => "secretName", } end |
Instance Method Details
#to_jsii ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'rds/database_secret_props.rb', line 92 def to_jsii result = {} result.merge!({ "username" => @username, "dbname" => @dbname, "encryptionKey" => @encryption_key, "excludeCharacters" => @exclude_characters, "masterSecret" => @master_secret, "replaceOnPasswordCriteriaChanges" => @replace_on_password_criteria_changes, "replicaRegions" => @replica_regions, "secretName" => @secret_name, }) result.compact end |