Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredefinedMetricSpecificationProperty

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

Overview

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

PredefinedMetricSpecification is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingScalingPolicyConfiguration 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.

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

    Identifies the resource associated with the metric type.



768
769
770
771
772
773
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 768

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 ALBRequestCountPerTarget metric type applies only to Spot fleet requests and ECS services.



781
782
783
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 781

def predefined_metric_type
  @predefined_metric_type
end

#resource_labelString? (readonly)

Identifies the resource associated with the metric type.

You can't specify a resource label unless the metric type is ALBRequestCountPerTarget and there is a target group attached to the Spot Fleet or ECS service.

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.



799
800
801
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 799

def resource_label
  @resource_label
end

Class Method Details

.jsii_propertiesObject



801
802
803
804
805
806
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 801

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

Instance Method Details

#to_jsiiObject



808
809
810
811
812
813
814
815
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 808

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