Class: AWSCDK::ApplicationAutoScaling::ScalableTargetProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/scalable_target_props.rb

Overview

Properties for a scalable target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_capacity:, min_capacity:, resource_id:, scalable_dimension:, service_namespace:, role: nil) ⇒ ScalableTargetProps

Returns a new instance of ScalableTargetProps.

Parameters:

  • max_capacity (Numeric)

    The maximum value that Application Auto Scaling can use to scale a target during a scaling activity.

  • min_capacity (Numeric)

    The minimum value that Application Auto Scaling can use to scale a target during a scaling activity.

  • resource_id (String)

    The resource identifier to associate with this scalable target.

  • scalable_dimension (String)

    The scalable dimension that's associated with the scalable target.

  • service_namespace (AWSCDK::ApplicationAutoScaling::ServiceNamespace)

    The namespace of the AWS service that provides the resource or custom-resource for a resource provided by your own application or service.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    Role that allows Application Auto Scaling to modify your scalable target.



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

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

Instance Attribute Details

#max_capacityNumeric (readonly)

The maximum value that Application Auto Scaling can use to scale a target during a scaling activity.

Returns:

  • (Numeric)


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

def max_capacity
  @max_capacity
end

#min_capacityNumeric (readonly)

The minimum value that Application Auto Scaling can use to scale a target during a scaling activity.

Returns:

  • (Numeric)


35
36
37
# File 'application_auto_scaling/scalable_target_props.rb', line 35

def min_capacity
  @min_capacity
end

#resource_idString (readonly)

The resource identifier to associate with this scalable target.

This string consists of the resource type and unique identifier.

Example value: service/ecsStack-MyECSCluster-AB12CDE3F4GH/ecsStack-MyECSService-AB12CDE3F4GH



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

def resource_id
  @resource_id
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: A role is automatically created

Role that allows Application Auto Scaling to modify your scalable target.

Returns:



66
67
68
# File 'application_auto_scaling/scalable_target_props.rb', line 66

def role
  @role
end

#scalable_dimensionString (readonly)

The scalable dimension that's associated with the scalable target.

Specify the service namespace, resource type, and scaling property.

Example value: ecs:service:DesiredCount



53
54
55
# File 'application_auto_scaling/scalable_target_props.rb', line 53

def scalable_dimension
  @scalable_dimension
end

#service_namespaceAWSCDK::ApplicationAutoScaling::ServiceNamespace (readonly)

The namespace of the AWS service that provides the resource or custom-resource for a resource provided by your own application or service.

For valid AWS service namespace values, see the RegisterScalableTarget action in the Application Auto Scaling API Reference.



61
62
63
# File 'application_auto_scaling/scalable_target_props.rb', line 61

def service_namespace
  @service_namespace
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'application_auto_scaling/scalable_target_props.rb', line 68

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

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
# File 'application_auto_scaling/scalable_target_props.rb', line 79

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