Class Policy


  • public class Policy
    extends com.pulumi.resources.CustomResource
    Provides an Application Auto Scaling Policy resource. ## Example Usage ### DynamoDB Table AutoScaling ### ECS Service AutoScaling ### Preserve desired count when updating an autoscaled ECS Service > To preserve the `desiredCount` of an autoscaled ECS Service during updates, use the [`ignoreChanges` resource option](https://www.pulumi.com/docs/concepts/options/ignorechanges/). This prevents Pulumi from resetting the count that autoscaling has set: ### Aurora Read Replica AutoScaling ### Create target tracking scaling policy using metric math ### Predictive Scaling ### MSK / Kafka Autoscaling ## Import ### Identity Schema #### Required * `name` - (String) Name of the scaling policy. * `resourceId` - (String) Resource type and unique identifier string for the resource associated with the scaling policy. * `scalableDimension` - (String) Scalable dimension of the scalable target. * `serviceNamespace` - (String) AWS service namespace of the scalable target. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Application Auto Scaling Policy using the `service-namespace` , `resource-id`, `scalable-dimension` and `policy-name` separated by `/`. For example: ```sh $ pulumi import aws:appautoscaling/policy:Policy test-policy service-namespace/resource-id/scalable-dimension/policy-name ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Policy​(java.lang.String name)  
      Policy​(java.lang.String name, PolicyArgs args)  
      Policy​(java.lang.String name, PolicyArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Constructor Detail

      • Policy

        public Policy​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Policy

        public Policy​(java.lang.String name,
                      PolicyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Policy

        public Policy​(java.lang.String name,
                      PolicyArgs args,
                      @Nullable
                      com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • alarmArns

        public com.pulumi.core.Output<java.util.List<java.lang.String>> alarmArns()
        Returns:
        List of CloudWatch alarm ARNs associated with the scaling policy.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN assigned by AWS to the scaling policy.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the policy. Must be between 1 and 255 characters in length.
      • policyType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> policyType()
        Returns:
        Policy type. Valid values are `StepScaling`, `TargetTrackingScaling`, and `PredictiveScaling`. Defaults to `StepScaling`. Certain services only support only one policy type. For more information see the [Target Tracking Scaling Policies](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html), [Step Scaling Policies](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html), and [Predictive Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-predictive-scaling.html) documentation.
      • predictiveScalingPolicyConfiguration

        public com.pulumi.core.Output<java.util.Optional<PolicyPredictiveScalingPolicyConfiguration>> predictiveScalingPolicyConfiguration()
        Returns:
        Predictive scaling policy configuration, requires `policyType = "PredictiveScaling"`. See supported fields below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • resourceId

        public com.pulumi.core.Output<java.lang.String> resourceId()
        Returns:
        Resource type and unique identifier string for the resource associated with the scaling policy. Documentation can be found in the `ResourceId` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html)
      • scalableDimension

        public com.pulumi.core.Output<java.lang.String> scalableDimension()
        Returns:
        Scalable dimension of the scalable target. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html)
      • serviceNamespace

        public com.pulumi.core.Output<java.lang.String> serviceNamespace()
        Returns:
        AWS service namespace of the scalable target. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html)
      • stepScalingPolicyConfiguration

        public com.pulumi.core.Output<java.util.Optional<PolicyStepScalingPolicyConfiguration>> stepScalingPolicyConfiguration()
        Returns:
        Step scaling policy configuration, requires `policyType = "StepScaling"` (default). See supported fields below.
      • targetTrackingScalingPolicyConfiguration

        public com.pulumi.core.Output<java.util.Optional<PolicyTargetTrackingScalingPolicyConfiguration>> targetTrackingScalingPolicyConfiguration()
        Returns:
        Target tracking policy configuration, requires `policyType = "TargetTrackingScaling"`. See supported fields below.
      • get

        public static Policy get​(java.lang.String name,
                                 com.pulumi.core.Output<java.lang.String> id,
                                 @Nullable
                                 PolicyState state,
                                 @Nullable
                                 com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.