Class: AWSCDK::AutoScalingPlans::CfnScalingPlan::PredefinedLoadMetricSpecificationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
auto_scaling_plans/cfn_scaling_plan.rb

Overview

PredefinedLoadMetricSpecification is a subproperty of ScalingInstruction that specifies a predefined load metric for predictive scaling to use with a scaling plan.

After creating your scaling plan, you can use the AWS Auto Scaling console to visualize forecasts for the specified metric. For more information, see View scaling information for a resource in the Scaling Plans User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predefined_load_metric_type:, resource_label: nil) ⇒ PredefinedLoadMetricSpecificationProperty

Returns a new instance of PredefinedLoadMetricSpecificationProperty.

Parameters:

  • predefined_load_metric_type (String)

    The metric type.

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

    Identifies the resource associated with the metric type.



804
805
806
807
808
809
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 804

def initialize(predefined_load_metric_type:, resource_label: nil)
  @predefined_load_metric_type = predefined_load_metric_type
  Jsii::Type.check_type(@predefined_load_metric_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "predefinedLoadMetricType")
  @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_load_metric_typeString (readonly)

The metric type.



815
816
817
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 815

def predefined_load_metric_type
  @predefined_load_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 ALBTargetGroupRequestCount and there is a target group for an Application Load Balancer 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 is app///targetgroup//, where:

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

This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.

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.



831
832
833
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 831

def resource_label
  @resource_label
end

Class Method Details

.jsii_propertiesObject



833
834
835
836
837
838
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 833

def self.jsii_properties
  {
    :predefined_load_metric_type => "predefinedLoadMetricType",
    :resource_label => "resourceLabel",
  }
end

Instance Method Details

#to_jsiiObject



840
841
842
843
844
845
846
847
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 840

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