Class: AWSCDK::RDS::ServerlessScalingOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
rds/serverless_scaling_options.rb

Overview

Options for configuring scaling on an Aurora Serverless v1 Cluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_pause: nil, max_capacity: nil, min_capacity: nil, timeout: nil, timeout_action: nil) ⇒ ServerlessScalingOptions

Returns a new instance of ServerlessScalingOptions.

Parameters:

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

    The time before an Aurora Serverless database cluster is paused.

  • max_capacity (AWSCDK::RDS::AuroraCapacityUnit, nil) (defaults to: nil)

    The maximum capacity for an Aurora Serverless database cluster.

  • min_capacity (AWSCDK::RDS::AuroraCapacityUnit, nil) (defaults to: nil)

    The minimum capacity for an Aurora Serverless database cluster.

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

    The amount of time that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action.

  • timeout_action (AWSCDK::RDS::TimeoutAction, nil) (defaults to: nil)

    The action to take when the timeout is reached.



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

def initialize(auto_pause: nil, max_capacity: nil, min_capacity: nil, timeout: nil, timeout_action: nil)
  @auto_pause = auto_pause
  Jsii::Type.check_type(@auto_pause, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "autoPause") unless @auto_pause.nil?
  @max_capacity = max_capacity
  Jsii::Type.check_type(@max_capacity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLkF1cm9yYUNhcGFjaXR5VW5pdCJ9")), "maxCapacity") unless @max_capacity.nil?
  @min_capacity = min_capacity
  Jsii::Type.check_type(@min_capacity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLkF1cm9yYUNhcGFjaXR5VW5pdCJ9")), "minCapacity") unless @min_capacity.nil?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
  @timeout_action = timeout_action
  Jsii::Type.check_type(@timeout_action, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLlRpbWVvdXRBY3Rpb24ifQ==")), "timeoutAction") unless @timeout_action.nil?
end

Instance Attribute Details

#auto_pauseAWSCDK::Duration? (readonly)

Note:

Default: - automatic pause enabled after 5 minutes

The time before an Aurora Serverless database cluster is paused.

A database cluster can be paused only when it is idle (it has no connections). Auto pause time must be between 5 minutes and 1 day.

If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it.

Set to 0 to disable

Returns:



38
39
40
# File 'rds/serverless_scaling_options.rb', line 38

def auto_pause
  @auto_pause
end

#max_capacityAWSCDK::RDS::AuroraCapacityUnit? (readonly)

Note:

Default: - determined by Aurora based on database engine

The maximum capacity for an Aurora Serverless database cluster.



43
44
45
# File 'rds/serverless_scaling_options.rb', line 43

def max_capacity
  @max_capacity
end

#min_capacityAWSCDK::RDS::AuroraCapacityUnit? (readonly)

Note:

Default: - determined by Aurora based on database engine

The minimum capacity for an Aurora Serverless database cluster.



48
49
50
# File 'rds/serverless_scaling_options.rb', line 48

def min_capacity
  @min_capacity
end

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: - 5 minutes

The amount of time that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action.

Returns:



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

def timeout
  @timeout
end

#timeout_actionAWSCDK::RDS::TimeoutAction? (readonly)

Note:

Default: - TimeoutAction.ROLLBACK_CAPACITY_CHANGE

The action to take when the timeout is reached.

Selecting ForceApplyCapacityChange will force the capacity to the specified value as soon as possible, even without a scaling point. Selecting RollbackCapacityChange will ignore the capacity change if a scaling point is not found. This is the default behavior.

Returns:



61
62
63
# File 'rds/serverless_scaling_options.rb', line 61

def timeout_action
  @timeout_action
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
# File 'rds/serverless_scaling_options.rb', line 63

def self.jsii_properties
  {
    :auto_pause => "autoPause",
    :max_capacity => "maxCapacity",
    :min_capacity => "minCapacity",
    :timeout => "timeout",
    :timeout_action => "timeoutAction",
  }
end

Instance Method Details

#to_jsiiObject



73
74
75
76
77
78
79
80
81
82
83
# File 'rds/serverless_scaling_options.rb', line 73

def to_jsii
  result = {}
  result.merge!({
    "autoPause" => @auto_pause,
    "maxCapacity" => @max_capacity,
    "minCapacity" => @min_capacity,
    "timeout" => @timeout,
    "timeoutAction" => @timeout_action,
  })
  result.compact
end