Class CfnAutoScalingConfiguration

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.apprunner.CfnAutoScalingConfiguration
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-02-23T02:06:28.264Z") @Stability(Stable) public class CfnAutoScalingConfiguration extends CfnResource implements IInspectable
Specify an AWS App Runner Automatic Scaling configuration by using the AWS::AppRunner::AutoScalingConfiguration resource in an AWS CloudFormation template.

The AWS::AppRunner::AutoScalingConfiguration resource is an AWS App Runner resource type that specifies an App Runner automatic scaling configuration.

App Runner requires this resource to set non-default auto scaling settings for instances used to process the web requests. You can share an auto scaling configuration across multiple services.

Create multiple revisions of a configuration by calling this action multiple times using the same AutoScalingConfigurationName . The call returns incremental AutoScalingConfigurationRevision values. When you create a service and configure an auto scaling configuration resource, the service uses the latest active revision of the auto scaling configuration by default. You can optionally configure the service to use a specific revision.

Configure a higher MinSize to increase the spread of your App Runner service over more Availability Zones in the AWS Region . The tradeoff is a higher minimal cost.

Configure a lower MaxSize to control your cost. The tradeoff is lower responsiveness during peak demand.

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.apprunner.*;
 CfnAutoScalingConfiguration cfnAutoScalingConfiguration = CfnAutoScalingConfiguration.Builder.create(this, "MyCfnAutoScalingConfiguration")
         .autoScalingConfigurationName("autoScalingConfigurationName")
         .maxConcurrency(123)
         .maxSize(123)
         .minSize(123)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .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

    • CfnAutoScalingConfiguration

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

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

      @Stability(Stable) public CfnAutoScalingConfiguration(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnAutoScalingConfigurationProps 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.
    • CfnAutoScalingConfiguration

      @Stability(Stable) public CfnAutoScalingConfiguration(@NotNull software.constructs.Construct scope, @NotNull String id)
      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.
  • 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.
    • getAttrAutoScalingConfigurationArn

      @Stability(Stable) @NotNull public String getAttrAutoScalingConfigurationArn()
      The Amazon Resource Name (ARN) of this auto scaling configuration.
    • getAttrAutoScalingConfigurationRevision

      @Stability(Stable) @NotNull public Number getAttrAutoScalingConfigurationRevision()
      The revision of this auto scaling configuration.

      It's unique among all the active configurations that share the same AutoScalingConfigurationName .

    • getAttrLatest

      @Stability(Stable) @NotNull public IResolvable getAttrLatest()
      It's set to true for the configuration with the highest Revision among all configurations that share the same AutoScalingConfigurationName .

      It's set to false otherwise. App Runner temporarily doubles the number of provisioned instances during deployments, to maintain the same capacity for both old and new code.

    • getCfnProperties

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

      @Stability(Stable) @Nullable public String getAutoScalingConfigurationName()
      The customer-provided auto scaling configuration name.
    • setAutoScalingConfigurationName

      @Stability(Stable) public void setAutoScalingConfigurationName(@Nullable String value)
      The customer-provided auto scaling configuration name.
    • getMaxConcurrency

      @Stability(Stable) @Nullable public Number getMaxConcurrency()
      The maximum number of concurrent requests that an instance processes.
    • setMaxConcurrency

      @Stability(Stable) public void setMaxConcurrency(@Nullable Number value)
      The maximum number of concurrent requests that an instance processes.
    • getMaxSize

      @Stability(Stable) @Nullable public Number getMaxSize()
      The maximum number of instances that a service scales up to.
    • setMaxSize

      @Stability(Stable) public void setMaxSize(@Nullable Number value)
      The maximum number of instances that a service scales up to.
    • getMinSize

      @Stability(Stable) @Nullable public Number getMinSize()
      The minimum number of instances that App Runner provisions for a service.
    • setMinSize

      @Stability(Stable) public void setMinSize(@Nullable Number value)
      The minimum number of instances that App Runner provisions for a service.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      A list of metadata items that you can associate with your auto scaling configuration resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      A list of metadata items that you can associate with your auto scaling configuration resource.