Class: AWSCDK::DocDB::RotationMultiUserOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
doc_db/rotation_multi_user_options.rb

Overview

Options to add the multi user rotation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(secret:, automatically_after: nil) ⇒ RotationMultiUserOptions

Returns a new instance of RotationMultiUserOptions.

Parameters:

  • secret (AWSCDK::SecretsManager::ISecret)

    The secret to rotate.

  • automatically_after (AWSCDK::Duration, nil) (defaults to: nil)

    Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.



9
10
11
12
13
14
# File 'doc_db/rotation_multi_user_options.rb', line 9

def initialize(secret:, automatically_after: nil)
  @secret = secret
  Jsii::Type.check_type(@secret, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "secret")
  @automatically_after = automatically_after
  Jsii::Type.check_type(@automatically_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "automaticallyAfter") unless @automatically_after.nil?
end

Instance Attribute Details

#automatically_afterAWSCDK::Duration? (readonly)

Note:

Default: Duration.days(30)

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

Returns:



40
41
42
# File 'doc_db/rotation_multi_user_options.rb', line 40

def automatically_after
  @automatically_after
end

#secretAWSCDK::SecretsManager::ISecret (readonly)

The secret to rotate.

It must be a JSON string with the following format:

{
  "engine": <required: must be set to 'mongo'>,
  "host": <required: instance host name>,
  "username": <required: username>,
  "password": <required: password>,
  "dbname": <optional: database name>,
  "port": <optional: if not specified, default port 27017 will be used>,
  "masterarn": <required: the arn of the master secret which will be used to create users/change passwords>
  "ssl": <optional: if not specified, defaults to false. This must be true if being used for DocumentDB rotations
         where the cluster has TLS enabled>
}


35
36
37
# File 'doc_db/rotation_multi_user_options.rb', line 35

def secret
  @secret
end

Class Method Details

.jsii_propertiesObject



42
43
44
45
46
47
# File 'doc_db/rotation_multi_user_options.rb', line 42

def self.jsii_properties
  {
    :secret => "secret",
    :automatically_after => "automaticallyAfter",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
# File 'doc_db/rotation_multi_user_options.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "secret" => @secret,
    "automaticallyAfter" => @automatically_after,
  })
  result.compact
end