Class: AWSCDK::Autoscaling::CfnScalingPolicy::PredefinedMetricSpecificationProperty

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

Overview

Contains predefined metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

PredefinedMetricSpecification is a property of the AWS::AutoScaling::ScalingPolicy TargetTrackingConfiguration property type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PredefinedMetricSpecificationProperty.

Parameters:

  • predefined_metric_type (String)

    The metric type. The following predefined metrics are available:.

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



1038
1039
1040
1041
1042
1043
# File 'autoscaling/cfn_scaling_policy.rb', line 1038

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. The following predefined metrics are available:.

  • ASGAverageCPUUtilization - Average CPU utilization of the Auto Scaling group.
  • ASGAverageNetworkIn - Average number of bytes received on all network interfaces by the Auto Scaling group.
  • ASGAverageNetworkOut - Average number of bytes sent out on all network interfaces by the Auto Scaling group.
  • ALBRequestCountPerTarget - Average Application Load Balancer request count per target for your Auto Scaling group.


1054
1055
1056
# File 'autoscaling/cfn_scaling_policy.rb', line 1054

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.



1072
1073
1074
# File 'autoscaling/cfn_scaling_policy.rb', line 1072

def resource_label
  @resource_label
end

Class Method Details

.jsii_propertiesObject



1074
1075
1076
1077
1078
1079
# File 'autoscaling/cfn_scaling_policy.rb', line 1074

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

Instance Method Details

#to_jsiiObject



1081
1082
1083
1084
1085
1086
1087
1088
# File 'autoscaling/cfn_scaling_policy.rb', line 1081

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