Class: AWSCDK::Autoscaling::CfnScalingPolicy::PredictiveScalingPredefinedScalingMetricProperty

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

Overview

Contains scaling metric information for the PredefinedScalingMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

Does not apply to policies that use a metric pair for the metric specification.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PredictiveScalingPredefinedScalingMetricProperty.

Parameters:

  • predefined_metric_type (String)

    The metric type.

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

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



1529
1530
1531
1532
1533
1534
# File 'autoscaling/cfn_scaling_policy.rb', line 1529

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)

The metric type.



1540
1541
1542
# File 'autoscaling/cfn_scaling_policy.rb', line 1540

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 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.



1558
1559
1560
# File 'autoscaling/cfn_scaling_policy.rb', line 1558

def resource_label
  @resource_label
end

Class Method Details

.jsii_propertiesObject



1560
1561
1562
1563
1564
1565
# File 'autoscaling/cfn_scaling_policy.rb', line 1560

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

Instance Method Details

#to_jsiiObject



1567
1568
1569
1570
1571
1572
1573
1574
# File 'autoscaling/cfn_scaling_policy.rb', line 1567

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