Class: AWSCDK::DynamoDB::CfnGlobalTable::CapacityAutoScalingSettingsProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DynamoDB::CfnGlobalTable::CapacityAutoScalingSettingsProperty
- Defined in:
- dynamo_db/cfn_global_table.rb
Overview
Configures a scalable target and an autoscaling policy for a table or global secondary index's read or write capacity.
Instance Attribute Summary collapse
-
#max_capacity ⇒ Numeric
readonly
The maximum provisioned capacity units for the global table.
-
#min_capacity ⇒ Numeric
readonly
The minimum provisioned capacity units for the global table.
-
#seed_capacity ⇒ Numeric?
readonly
When switching billing mode from
PAY_PER_REQUESTtoPROVISIONED, DynamoDB requires you to specify read and write capacity unit values for the table and for each global secondary index. -
#target_tracking_scaling_policy_configuration ⇒ AWSCDK::IResolvable, AWSCDK::DynamoDB::CfnGlobalTable::TargetTrackingScalingPolicyConfigurationProperty
readonly
Defines a target tracking scaling policy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(max_capacity:, min_capacity:, target_tracking_scaling_policy_configuration:, seed_capacity: nil) ⇒ CapacityAutoScalingSettingsProperty
constructor
A new instance of CapacityAutoScalingSettingsProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(max_capacity:, min_capacity:, target_tracking_scaling_policy_configuration:, seed_capacity: nil) ⇒ CapacityAutoScalingSettingsProperty
Returns a new instance of CapacityAutoScalingSettingsProperty.
855 856 857 858 859 860 861 862 863 864 |
# File 'dynamo_db/cfn_global_table.rb', line 855 def initialize(max_capacity:, min_capacity:, target_tracking_scaling_policy_configuration:, seed_capacity: nil) @max_capacity = max_capacity Jsii::Type.check_type(@max_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCapacity") @min_capacity = min_capacity Jsii::Type.check_type(@min_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minCapacity") @target_tracking_scaling_policy_configuration = target_tracking_scaling_policy_configuration.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnGlobalTable::TargetTrackingScalingPolicyConfigurationProperty.new(**target_tracking_scaling_policy_configuration.transform_keys(&:to_sym)) : target_tracking_scaling_policy_configuration Jsii::Type.check_type(@target_tracking_scaling_policy_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5HbG9iYWxUYWJsZS5UYXJnZXRUcmFja2luZ1NjYWxpbmdQb2xpY3lDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "targetTrackingScalingPolicyConfiguration") @seed_capacity = seed_capacity Jsii::Type.check_type(@seed_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "seedCapacity") unless @seed_capacity.nil? end |
Instance Attribute Details
#max_capacity ⇒ Numeric (readonly)
The maximum provisioned capacity units for the global table.
870 871 872 |
# File 'dynamo_db/cfn_global_table.rb', line 870 def max_capacity @max_capacity end |
#min_capacity ⇒ Numeric (readonly)
The minimum provisioned capacity units for the global table.
875 876 877 |
# File 'dynamo_db/cfn_global_table.rb', line 875 def min_capacity @min_capacity end |
#seed_capacity ⇒ Numeric? (readonly)
When switching billing mode from PAY_PER_REQUEST to PROVISIONED , DynamoDB requires you to specify read and write capacity unit values for the table and for each global secondary index.
These values will be applied to all replicas. The table will use these provisioned values until CloudFormation creates the autoscaling policies you configured in your template. CloudFormation cannot determine what capacity the table and its global secondary indexes will require in this time period, since they are application-dependent.
If you want to switch a table's billing mode from PAY_PER_REQUEST to PROVISIONED , you must specify a value for this property for each autoscaled resource. If you specify different values for the same resource in different regions, CloudFormation will use the highest value found in either the SeedCapacity or ReadCapacityUnits properties. For example, if your global secondary index my_gsi has a SeedCapacity of 10 in us-east-1 and a fixed ReadCapacityUnits of 20 in eu-west-1, CloudFormation will initially set the read capacity for my_gsi to 20. Note that if you disable ScaleIn for my_gsi in us-east-1, its read capacity units might not be set back to 10.
You must also specify a value for SeedCapacity when you plan to switch a table's billing mode from PROVISIONED to PAY_PER_REQUEST , because CloudFormation might need to roll back the operation (reverting the billing mode to PROVISIONED ) and this cannot succeed without specifying a value for SeedCapacity .
891 892 893 |
# File 'dynamo_db/cfn_global_table.rb', line 891 def seed_capacity @seed_capacity end |
#target_tracking_scaling_policy_configuration ⇒ AWSCDK::IResolvable, AWSCDK::DynamoDB::CfnGlobalTable::TargetTrackingScalingPolicyConfigurationProperty (readonly)
Defines a target tracking scaling policy.
880 881 882 |
# File 'dynamo_db/cfn_global_table.rb', line 880 def target_tracking_scaling_policy_configuration @target_tracking_scaling_policy_configuration end |
Class Method Details
.jsii_properties ⇒ Object
893 894 895 896 897 898 899 900 |
# File 'dynamo_db/cfn_global_table.rb', line 893 def self.jsii_properties { :max_capacity => "maxCapacity", :min_capacity => "minCapacity", :target_tracking_scaling_policy_configuration => "targetTrackingScalingPolicyConfiguration", :seed_capacity => "seedCapacity", } end |
Instance Method Details
#to_jsii ⇒ Object
902 903 904 905 906 907 908 909 910 911 |
# File 'dynamo_db/cfn_global_table.rb', line 902 def to_jsii result = {} result.merge!({ "maxCapacity" => @max_capacity, "minCapacity" => @min_capacity, "targetTrackingScalingPolicyConfiguration" => @target_tracking_scaling_policy_configuration, "seedCapacity" => @seed_capacity, }) result.compact end |