Class: AWSCDK::ECS::RequestCountScalingProps

Inherits:
ApplicationAutoScaling::BaseTargetTrackingProps
  • Object
show all
Defined in:
ecs/request_count_scaling_props.rb

Overview

The properties for enabling scaling based on Application Load Balancer (ALB) request counts.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(disable_scale_in: nil, policy_name: nil, scale_in_cooldown: nil, scale_out_cooldown: nil, requests_per_target:, target_group:) ⇒ RequestCountScalingProps

Returns a new instance of RequestCountScalingProps.

Parameters:

  • disable_scale_in (Boolean, nil) (defaults to: nil)

    Indicates whether scale in by the target tracking policy is disabled.

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

    A name for the scaling policy.

  • scale_in_cooldown (AWSCDK::Duration, nil) (defaults to: nil)

    Period after a scale in activity completes before another scale in activity can start.

  • scale_out_cooldown (AWSCDK::Duration, nil) (defaults to: nil)

    Period after a scale out activity completes before another scale out activity can start.

  • requests_per_target (Numeric)

    The number of ALB requests per target.

  • target_group (AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup)

    The ALB target group name.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ecs/request_count_scaling_props.rb', line 13

def initialize(disable_scale_in: nil, policy_name: nil, scale_in_cooldown: nil, scale_out_cooldown: nil, requests_per_target:, target_group:)
  @disable_scale_in = disable_scale_in
  Jsii::Type.check_type(@disable_scale_in, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableScaleIn") unless @disable_scale_in.nil?
  @policy_name = policy_name
  Jsii::Type.check_type(@policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyName") unless @policy_name.nil?
  @scale_in_cooldown = scale_in_cooldown
  Jsii::Type.check_type(@scale_in_cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "scaleInCooldown") unless @scale_in_cooldown.nil?
  @scale_out_cooldown = scale_out_cooldown
  Jsii::Type.check_type(@scale_out_cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "scaleOutCooldown") unless @scale_out_cooldown.nil?
  @requests_per_target = requests_per_target
  Jsii::Type.check_type(@requests_per_target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "requestsPerTarget")
  @target_group = target_group
  Jsii::Type.check_type(@target_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BcHBsaWNhdGlvblRhcmdldEdyb3VwIn0=")), "targetGroup")
end

Instance Attribute Details

#disable_scale_inBoolean? (readonly)

Note:

Default: false

Indicates whether scale in by the target tracking policy is disabled.

If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.

Returns:

  • (Boolean, nil)


37
38
39
# File 'ecs/request_count_scaling_props.rb', line 37

def disable_scale_in
  @disable_scale_in
end

#policy_nameString? (readonly)

Note:

Default: - Automatically generated name.

A name for the scaling policy.

Returns:

  • (String, nil)


42
43
44
# File 'ecs/request_count_scaling_props.rb', line 42

def policy_name
  @policy_name
end

#requests_per_targetNumeric (readonly)

The number of ALB requests per target.

Returns:

  • (Numeric)


56
57
58
# File 'ecs/request_count_scaling_props.rb', line 56

def requests_per_target
  @requests_per_target
end

#scale_in_cooldownAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

Period after a scale in activity completes before another scale in activity can start.

Returns:



47
48
49
# File 'ecs/request_count_scaling_props.rb', line 47

def scale_in_cooldown
  @scale_in_cooldown
end

#scale_out_cooldownAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency

Period after a scale out activity completes before another scale out activity can start.

Returns:



52
53
54
# File 'ecs/request_count_scaling_props.rb', line 52

def scale_out_cooldown
  @scale_out_cooldown
end

#target_groupAWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup (readonly)

The ALB target group name.



60
61
62
# File 'ecs/request_count_scaling_props.rb', line 60

def target_group
  @target_group
end

Class Method Details

.jsii_propertiesObject



62
63
64
65
66
67
68
69
70
71
# File 'ecs/request_count_scaling_props.rb', line 62

def self.jsii_properties
  {
    :disable_scale_in => "disableScaleIn",
    :policy_name => "policyName",
    :scale_in_cooldown => "scaleInCooldown",
    :scale_out_cooldown => "scaleOutCooldown",
    :requests_per_target => "requestsPerTarget",
    :target_group => "targetGroup",
  }
end

Instance Method Details

#to_jsiiObject



73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'ecs/request_count_scaling_props.rb', line 73

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "disableScaleIn" => @disable_scale_in,
    "policyName" => @policy_name,
    "scaleInCooldown" => @scale_in_cooldown,
    "scaleOutCooldown" => @scale_out_cooldown,
    "requestsPerTarget" => @requests_per_target,
    "targetGroup" => @target_group,
  })
  result.compact
end