Class: AWSCDK::RDS::RotationMultiUserOptions

Inherits:
CommonRotationUserOptions
  • Object
show all
Defined in:
rds/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(automatically_after: nil, endpoint: nil, exclude_characters: nil, rotate_immediately_on_update: nil, security_group: nil, vpc_subnets: nil, secret:) ⇒ RotationMultiUserOptions

Returns a new instance of RotationMultiUserOptions.

Parameters:

  • 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.

  • endpoint (AWSCDK::EC2::IInterfaceVPCEndpoint, nil) (defaults to: nil)

    The VPC interface endpoint to use for the Secrets Manager API.

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

    Specifies characters to not include in generated passwords.

  • rotate_immediately_on_update (Boolean, nil) (defaults to: nil)

    Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.

  • security_group (AWSCDK::EC2::ISecurityGroup, nil) (defaults to: nil)

    The security group for the Lambda rotation function.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    Where to place the rotation Lambda function.

  • secret (AWSCDK::SecretsManager::ISecret)

    The secret to rotate.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'rds/rotation_multi_user_options.rb', line 14

def initialize(automatically_after: nil, endpoint: nil, exclude_characters: nil, rotate_immediately_on_update: nil, security_group: nil, vpc_subnets: nil, secret:)
  @automatically_after = automatically_after
  Jsii::Type.check_type(@automatically_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "automaticallyAfter") unless @automatically_after.nil?
  @endpoint = endpoint
  Jsii::Type.check_type(@endpoint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklJbnRlcmZhY2VWcGNFbmRwb2ludCJ9")), "endpoint") unless @endpoint.nil?
  @exclude_characters = exclude_characters
  Jsii::Type.check_type(@exclude_characters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "excludeCharacters") unless @exclude_characters.nil?
  @rotate_immediately_on_update = rotate_immediately_on_update
  Jsii::Type.check_type(@rotate_immediately_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "rotateImmediatelyOnUpdate") unless @rotate_immediately_on_update.nil?
  @security_group = security_group
  Jsii::Type.check_type(@security_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "securityGroup") unless @security_group.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
  @secret = secret
  Jsii::Type.check_type(@secret, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "secret")
end

Instance Attribute Details

#automatically_afterAWSCDK::Duration? (readonly)

Note:

Default: - 30 days

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

Returns:



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

def automatically_after
  @automatically_after
end

#endpointAWSCDK::EC2::IInterfaceVPCEndpoint? (readonly)

Note:

Default: https://secretsmanager..amazonaws.com

The VPC interface endpoint to use for the Secrets Manager API.

If you enable private DNS hostnames for your VPC private endpoint (the default), you don't need to specify an endpoint. The standard Secrets Manager DNS hostname the Secrets Manager CLI and SDKs use by default (https://secretsmanager..amazonaws.com) automatically resolves to your VPC endpoint.



45
46
47
# File 'rds/rotation_multi_user_options.rb', line 45

def endpoint
  @endpoint
end

#exclude_charactersString? (readonly)

Note:

Default: " %+~`#$&*()|[]{}:;<>?!'/@\"\"

Specifies characters to not include in generated passwords.

Returns:

  • (String, nil)


50
51
52
# File 'rds/rotation_multi_user_options.rb', line 50

def exclude_characters
  @exclude_characters
end

#rotate_immediately_on_updateBoolean? (readonly)

Note:

Default: true

Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.

Returns:

  • (Boolean, nil)


55
56
57
# File 'rds/rotation_multi_user_options.rb', line 55

def rotate_immediately_on_update
  @rotate_immediately_on_update
end

#secretAWSCDK::SecretsManager::ISecret (readonly)

The secret to rotate.

It must be a JSON string with the following format:

{
  "engine": <required: database engine>,
  "host": <required: instance host name>,
  "username": <required: username>,
  "password": <required: password>,
  "dbname": <optional: database name>,
  "port": <optional: if not specified, default port will be used>,
  "masterarn": <required: the arn of the master secret which will be used to create users/change passwords>
}


83
84
85
# File 'rds/rotation_multi_user_options.rb', line 83

def secret
  @secret
end

#security_groupAWSCDK::EC2::ISecurityGroup? (readonly)

Note:

Default: - a new security group is created

The security group for the Lambda rotation function.

Returns:



60
61
62
# File 'rds/rotation_multi_user_options.rb', line 60

def security_group
  @security_group
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - same placement as instance or cluster

Where to place the rotation Lambda function.



65
66
67
# File 'rds/rotation_multi_user_options.rb', line 65

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



85
86
87
88
89
90
91
92
93
94
95
# File 'rds/rotation_multi_user_options.rb', line 85

def self.jsii_properties
  {
    :automatically_after => "automaticallyAfter",
    :endpoint => "endpoint",
    :exclude_characters => "excludeCharacters",
    :rotate_immediately_on_update => "rotateImmediatelyOnUpdate",
    :security_group => "securityGroup",
    :vpc_subnets => "vpcSubnets",
    :secret => "secret",
  }
end

Instance Method Details

#to_jsiiObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'rds/rotation_multi_user_options.rb', line 97

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "automaticallyAfter" => @automatically_after,
    "endpoint" => @endpoint,
    "excludeCharacters" => @exclude_characters,
    "rotateImmediatelyOnUpdate" => @rotate_immediately_on_update,
    "securityGroup" => @security_group,
    "vpcSubnets" => @vpc_subnets,
    "secret" => @secret,
  })
  result.compact
end