Class: AWSCDK::ApplicationAutoScaling::BaseScalableAttributeProps

Inherits:
EnableScalingProps
  • Object
show all
Defined in:
application_auto_scaling/base_scalable_attribute_props.rb

Overview

Properties for a ScalableTableAttribute.

Direct Known Subclasses

ECS::ScalableTaskCountProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_capacity:, min_capacity: nil, dimension:, resource_id:, role:, service_namespace:) ⇒ BaseScalableAttributeProps

Returns a new instance of BaseScalableAttributeProps.

Parameters:

  • max_capacity (Numeric)

    Maximum capacity to scale to.

  • min_capacity (Numeric, nil) (defaults to: nil)

    Minimum capacity to scale to.

  • dimension (String)

    Scalable dimension of the attribute.

  • resource_id (String)

    Resource ID of the attribute.

  • role (AWSCDK::IAM::IRole)

    Role to use for scaling.

  • service_namespace (AWSCDK::ApplicationAutoScaling::ServiceNamespace)

    Service namespace of the scalable attribute.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 13

def initialize(max_capacity:, min_capacity: nil, dimension:, resource_id:, role:, service_namespace:)
  @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") unless @min_capacity.nil?
  @dimension = dimension
  Jsii::Type.check_type(@dimension, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dimension")
  @resource_id = resource_id
  Jsii::Type.check_type(@resource_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceId")
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role")
  @service_namespace = service_namespace
  Jsii::Type.check_type(@service_namespace, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TZXJ2aWNlTmFtZXNwYWNlIn0=")), "serviceNamespace")
end

Instance Attribute Details

#dimensionString (readonly)

Scalable dimension of the attribute.

Returns:

  • (String)


40
41
42
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 40

def dimension
  @dimension
end

#max_capacityNumeric (readonly)

Maximum capacity to scale to.

Returns:

  • (Numeric)


31
32
33
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 31

def max_capacity
  @max_capacity
end

#min_capacityNumeric? (readonly)

Note:

Default: 1

Minimum capacity to scale to.

Returns:

  • (Numeric, nil)


36
37
38
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 36

def min_capacity
  @min_capacity
end

#resource_idString (readonly)

Resource ID of the attribute.

Returns:

  • (String)


44
45
46
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 44

def resource_id
  @resource_id
end

#roleAWSCDK::IAM::IRole (readonly)

Role to use for scaling.

Returns:



48
49
50
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 48

def role
  @role
end

#service_namespaceAWSCDK::ApplicationAutoScaling::ServiceNamespace (readonly)

Service namespace of the scalable attribute.



52
53
54
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 52

def service_namespace
  @service_namespace
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
62
63
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 54

def self.jsii_properties
  {
    :max_capacity => "maxCapacity",
    :min_capacity => "minCapacity",
    :dimension => "dimension",
    :resource_id => "resourceId",
    :role => "role",
    :service_namespace => "serviceNamespace",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'application_auto_scaling/base_scalable_attribute_props.rb', line 65

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "maxCapacity" => @max_capacity,
    "minCapacity" => @min_capacity,
    "dimension" => @dimension,
    "resourceId" => @resource_id,
    "role" => @role,
    "serviceNamespace" => @service_namespace,
  })
  result.compact
end