java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.applicationautoscaling.CfnScalableTarget
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:57.251Z") @Stability(Stable) public class CfnScalableTarget extends CfnResource implements IInspectable
The AWS::ApplicationAutoScaling::ScalableTarget resource specifies a resource that Application Auto Scaling can scale, such as an AWS::DynamoDB::Table or AWS::ECS::Service resource.

For more information, see Getting started in the Application Auto Scaling User Guide .

If the resource that you want Application Auto Scaling to scale is not yet created in your account, add a dependency on the resource when registering it as a scalable target using the DependsOn attribute.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.applicationautoscaling.*;
 CfnScalableTarget cfnScalableTarget = CfnScalableTarget.Builder.create(this, "MyCfnScalableTarget")
         .maxCapacity(123)
         .minCapacity(123)
         .resourceId("resourceId")
         .scalableDimension("scalableDimension")
         .serviceNamespace("serviceNamespace")
         // the properties below are optional
         .roleArn("roleArn")
         .scheduledActions(List.of(ScheduledActionProperty.builder()
                 .schedule("schedule")
                 .scheduledActionName("scheduledActionName")
                 // the properties below are optional
                 .endTime(new Date())
                 .scalableTargetAction(ScalableTargetActionProperty.builder()
                         .maxCapacity(123)
                         .minCapacity(123)
                         .build())
                 .startTime(new Date())
                 .timezone("timezone")
                 .build()))
         .suspendedState(SuspendedStateProperty.builder()
                 .dynamicScalingInSuspended(false)
                 .dynamicScalingOutSuspended(false)
                 .scheduledScalingSuspended(false)
                 .build())
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnScalableTarget

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

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

      @Stability(Stable) public CfnScalableTarget(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnScalableTargetProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getMaxCapacity

      @Stability(Stable) @NotNull public Number getMaxCapacity()
      The maximum value that you plan to scale out to.
    • setMaxCapacity

      @Stability(Stable) public void setMaxCapacity(@NotNull Number value)
      The maximum value that you plan to scale out to.
    • getMinCapacity

      @Stability(Stable) @NotNull public Number getMinCapacity()
      The minimum value that you plan to scale in to.
    • setMinCapacity

      @Stability(Stable) public void setMinCapacity(@NotNull Number value)
      The minimum value that you plan to scale in to.
    • getResourceId

      @Stability(Stable) @NotNull public String getResourceId()
      The identifier of the resource associated with the scalable target.
    • setResourceId

      @Stability(Stable) public void setResourceId(@NotNull String value)
      The identifier of the resource associated with the scalable target.
    • getScalableDimension

      @Stability(Stable) @NotNull public String getScalableDimension()
      The scalable dimension associated with the scalable target.
    • setScalableDimension

      @Stability(Stable) public void setScalableDimension(@NotNull String value)
      The scalable dimension associated with the scalable target.
    • getServiceNamespace

      @Stability(Stable) @NotNull public String getServiceNamespace()
      The namespace of the AWS service that provides the resource, or a custom-resource .
    • setServiceNamespace

      @Stability(Stable) public void setServiceNamespace(@NotNull String value)
      The namespace of the AWS service that provides the resource, or a custom-resource .
    • getRoleArn

      @Stability(Stable) @Nullable public String getRoleArn()
      Specify the Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that allows Application Auto Scaling to modify the scalable target on your behalf.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@Nullable String value)
      Specify the Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that allows Application Auto Scaling to modify the scalable target on your behalf.
    • getScheduledActions

      @Stability(Stable) @Nullable public Object getScheduledActions()
      The scheduled actions for the scalable target.
    • setScheduledActions

      @Stability(Stable) public void setScheduledActions(@Nullable IResolvable value)
      The scheduled actions for the scalable target.
    • setScheduledActions

      @Stability(Stable) public void setScheduledActions(@Nullable List<Object> value)
      The scheduled actions for the scalable target.
    • getSuspendedState

      @Stability(Stable) @Nullable public Object getSuspendedState()
      An embedded object that contains attributes and attribute values that are used to suspend and resume automatic scaling.
    • setSuspendedState

      @Stability(Stable) public void setSuspendedState(@Nullable IResolvable value)
      An embedded object that contains attributes and attribute values that are used to suspend and resume automatic scaling.
    • setSuspendedState

      @Stability(Stable) public void setSuspendedState(@Nullable CfnScalableTarget.SuspendedStateProperty value)
      An embedded object that contains attributes and attribute values that are used to suspend and resume automatic scaling.