Class BaseScalableAttribute

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.applicationautoscaling.BaseScalableAttribute
All Implemented Interfaces:
IScalableTargetRef, IEnvironmentAware, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
ScalableInstanceCount, ScalableTaskCount

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-23T11:19:39.347Z") @Stability(Stable) public abstract class BaseScalableAttribute extends software.constructs.Construct implements IScalableTargetRef
Represent an attribute for which autoscaling can be configured.

This class is basically a light wrapper around ScalableTarget, but with all methods protected instead of public so they can be selectively exposed and/or more specific versions of them can be exposed by derived classes for individual services support autoscaling.

Typical use cases:

  • Hide away the PredefinedMetric enum for target tracking policies.
  • Don't expose all scaling methods (for example Dynamo tables don't support Step Scaling, so the Dynamo subclass won't expose this method).
  • Constructor Details

    • BaseScalableAttribute

      protected BaseScalableAttribute(software.amazon.jsii.JsiiObjectRef objRef)
    • BaseScalableAttribute

      protected BaseScalableAttribute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • BaseScalableAttribute

      @Stability(Stable) protected BaseScalableAttribute(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull BaseScalableAttributeProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • doScaleOnMetric

      @Stability(Stable) protected void doScaleOnMetric(@NotNull String id, @NotNull BasicStepScalingPolicyProps props)
      Scale out or in based on a metric value.

      Parameters:
      id - This parameter is required.
      props - This parameter is required.
    • doScaleOnSchedule

      @Stability(Stable) protected void doScaleOnSchedule(@NotNull String id, @NotNull ScalingSchedule props)
      Scale out or in based on time.

      Parameters:
      id - This parameter is required.
      props - This parameter is required.
    • doScaleToTrackMetric

      @Stability(Stable) protected void doScaleToTrackMetric(@NotNull String id, @NotNull BasicTargetTrackingScalingPolicyProps props)
      Scale out or in in order to keep a metric around a target value.

      Parameters:
      id - This parameter is required.
      props - This parameter is required.
    • getEnv

      @Stability(Stable) @NotNull public ResourceEnvironment getEnv()
      The environment this resource belongs to.

      For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

      For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

      Specified by:
      getEnv in interface IEnvironmentAware
    • getProps

      @Stability(Stable) @NotNull protected BaseScalableAttributeProps getProps()
    • getScalableTargetRef

      @Stability(Stable) @NotNull public ScalableTargetReference getScalableTargetRef()
      A reference to a ScalableTarget resource.
      Specified by:
      getScalableTargetRef in interface IScalableTargetRef