Class: AWSCDK::Autoscaling::CfnScalingPolicy::PredictiveScalingPredefinedMetricPairProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/cfn_scaling_policy.rb

Overview

Contains metric pair information for the PredefinedMetricPairSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

For more information, see Predictive scaling in the Amazon EC2 Auto Scaling User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predefined_metric_type:, resource_label: nil) ⇒ PredictiveScalingPredefinedMetricPairProperty

Returns a new instance of PredictiveScalingPredefinedMetricPairProperty.

Parameters:

  • predefined_metric_type (String)

    Indicates which metrics to use.

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

    A label that uniquely identifies a specific Application Load Balancer target group from which to determine the total and average request count served by your Auto Scaling group.



1469
1470
1471
1472
1473
1474
# File 'autoscaling/cfn_scaling_policy.rb', line 1469

def initialize(predefined_metric_type:, resource_label: nil)
  @predefined_metric_type = predefined_metric_type
  Jsii::Type.check_type(@predefined_metric_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "predefinedMetricType")
  @resource_label = resource_label
  Jsii::Type.check_type(@resource_label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceLabel") unless @resource_label.nil?
end

Instance Attribute Details

#predefined_metric_typeString (readonly)

Indicates which metrics to use.

There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization , the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling metric.



1482
1483
1484
# File 'autoscaling/cfn_scaling_policy.rb', line 1482

def predefined_metric_type
  @predefined_metric_type
end

#resource_labelString? (readonly)

A label that uniquely identifies a specific Application Load Balancer target group from which to determine the total and average request count served by your Auto Scaling group.

You can't specify a resource label unless the target group is attached to the Auto Scaling group.

You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:

app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff .

Where:

  • app// is the final portion of the load balancer ARN
  • targetgroup// is the final portion of the target group ARN.

To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.



1500
1501
1502
# File 'autoscaling/cfn_scaling_policy.rb', line 1500

def resource_label
  @resource_label
end

Class Method Details

.jsii_propertiesObject



1502
1503
1504
1505
1506
1507
# File 'autoscaling/cfn_scaling_policy.rb', line 1502

def self.jsii_properties
  {
    :predefined_metric_type => "predefinedMetricType",
    :resource_label => "resourceLabel",
  }
end

Instance Method Details

#to_jsiiObject



1509
1510
1511
1512
1513
1514
1515
1516
# File 'autoscaling/cfn_scaling_policy.rb', line 1509

def to_jsii
  result = {}
  result.merge!({
    "predefinedMetricType" => @predefined_metric_type,
    "resourceLabel" => @resource_label,
  })
  result.compact
end