1. Packages
  2. AWS
  3. API Docs
  4. appautoscaling
  5. Policy
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.appautoscaling.Policy

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides an Application AutoScaling Policy resource.

    Example Usage

    DynamoDB Table Autoscaling

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const dynamodbTableReadTarget = new aws.appautoscaling.Target("dynamodb_table_read_target", {
        maxCapacity: 100,
        minCapacity: 5,
        resourceId: "table/tableName",
        scalableDimension: "dynamodb:table:ReadCapacityUnits",
        serviceNamespace: "dynamodb",
    });
    const dynamodbTableReadPolicy = new aws.appautoscaling.Policy("dynamodb_table_read_policy", {
        name: pulumi.interpolate`DynamoDBReadCapacityUtilization:${dynamodbTableReadTarget.resourceId}`,
        policyType: "TargetTrackingScaling",
        resourceId: dynamodbTableReadTarget.resourceId,
        scalableDimension: dynamodbTableReadTarget.scalableDimension,
        serviceNamespace: dynamodbTableReadTarget.serviceNamespace,
        targetTrackingScalingPolicyConfiguration: {
            predefinedMetricSpecification: {
                predefinedMetricType: "DynamoDBReadCapacityUtilization",
            },
            targetValue: 70,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    dynamodb_table_read_target = aws.appautoscaling.Target("dynamodb_table_read_target",
        max_capacity=100,
        min_capacity=5,
        resource_id="table/tableName",
        scalable_dimension="dynamodb:table:ReadCapacityUnits",
        service_namespace="dynamodb")
    dynamodb_table_read_policy = aws.appautoscaling.Policy("dynamodb_table_read_policy",
        name=dynamodb_table_read_target.resource_id.apply(lambda resource_id: f"DynamoDBReadCapacityUtilization:{resource_id}"),
        policy_type="TargetTrackingScaling",
        resource_id=dynamodb_table_read_target.resource_id,
        scalable_dimension=dynamodb_table_read_target.scalable_dimension,
        service_namespace=dynamodb_table_read_target.service_namespace,
        target_tracking_scaling_policy_configuration={
            "predefined_metric_specification": {
                "predefined_metric_type": "DynamoDBReadCapacityUtilization",
            },
            "target_value": 70,
        })
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		dynamodbTableReadTarget, err := appautoscaling.NewTarget(ctx, "dynamodb_table_read_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(100),
    			MinCapacity:       pulumi.Int(5),
    			ResourceId:        pulumi.String("table/tableName"),
    			ScalableDimension: pulumi.String("dynamodb:table:ReadCapacityUnits"),
    			ServiceNamespace:  pulumi.String("dynamodb"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appautoscaling.NewPolicy(ctx, "dynamodb_table_read_policy", &appautoscaling.PolicyArgs{
    			Name: dynamodbTableReadTarget.ResourceId.ApplyT(func(resourceId string) (string, error) {
    				return fmt.Sprintf("DynamoDBReadCapacityUtilization:%v", resourceId), nil
    			}).(pulumi.StringOutput),
    			PolicyType:        pulumi.String("TargetTrackingScaling"),
    			ResourceId:        dynamodbTableReadTarget.ResourceId,
    			ScalableDimension: dynamodbTableReadTarget.ScalableDimension,
    			ServiceNamespace:  dynamodbTableReadTarget.ServiceNamespace,
    			TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
    				PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
    					PredefinedMetricType: pulumi.String("DynamoDBReadCapacityUtilization"),
    				},
    				TargetValue: pulumi.Float64(70),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var dynamodbTableReadTarget = new Aws.AppAutoScaling.Target("dynamodb_table_read_target", new()
        {
            MaxCapacity = 100,
            MinCapacity = 5,
            ResourceId = "table/tableName",
            ScalableDimension = "dynamodb:table:ReadCapacityUnits",
            ServiceNamespace = "dynamodb",
        });
    
        var dynamodbTableReadPolicy = new Aws.AppAutoScaling.Policy("dynamodb_table_read_policy", new()
        {
            Name = dynamodbTableReadTarget.ResourceId.Apply(resourceId => $"DynamoDBReadCapacityUtilization:{resourceId}"),
            PolicyType = "TargetTrackingScaling",
            ResourceId = dynamodbTableReadTarget.ResourceId,
            ScalableDimension = dynamodbTableReadTarget.ScalableDimension,
            ServiceNamespace = dynamodbTableReadTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
                {
                    PredefinedMetricType = "DynamoDBReadCapacityUtilization",
                },
                TargetValue = 70,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Target;
    import com.pulumi.aws.appautoscaling.TargetArgs;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var dynamodbTableReadTarget = new Target("dynamodbTableReadTarget", TargetArgs.builder()
                .maxCapacity(100)
                .minCapacity(5)
                .resourceId("table/tableName")
                .scalableDimension("dynamodb:table:ReadCapacityUnits")
                .serviceNamespace("dynamodb")
                .build());
    
            var dynamodbTableReadPolicy = new Policy("dynamodbTableReadPolicy", PolicyArgs.builder()
                .name(dynamodbTableReadTarget.resourceId().applyValue(resourceId -> String.format("DynamoDBReadCapacityUtilization:%s", resourceId)))
                .policyType("TargetTrackingScaling")
                .resourceId(dynamodbTableReadTarget.resourceId())
                .scalableDimension(dynamodbTableReadTarget.scalableDimension())
                .serviceNamespace(dynamodbTableReadTarget.serviceNamespace())
                .targetTrackingScalingPolicyConfiguration(PolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
                    .predefinedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs.builder()
                        .predefinedMetricType("DynamoDBReadCapacityUtilization")
                        .build())
                    .targetValue(70)
                    .build())
                .build());
    
        }
    }
    
    resources:
      dynamodbTableReadTarget:
        type: aws:appautoscaling:Target
        name: dynamodb_table_read_target
        properties:
          maxCapacity: 100
          minCapacity: 5
          resourceId: table/tableName
          scalableDimension: dynamodb:table:ReadCapacityUnits
          serviceNamespace: dynamodb
      dynamodbTableReadPolicy:
        type: aws:appautoscaling:Policy
        name: dynamodb_table_read_policy
        properties:
          name: DynamoDBReadCapacityUtilization:${dynamodbTableReadTarget.resourceId}
          policyType: TargetTrackingScaling
          resourceId: ${dynamodbTableReadTarget.resourceId}
          scalableDimension: ${dynamodbTableReadTarget.scalableDimension}
          serviceNamespace: ${dynamodbTableReadTarget.serviceNamespace}
          targetTrackingScalingPolicyConfiguration:
            predefinedMetricSpecification:
              predefinedMetricType: DynamoDBReadCapacityUtilization
            targetValue: 70
    

    ECS Service Autoscaling

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ecsTarget = new aws.appautoscaling.Target("ecs_target", {
        maxCapacity: 4,
        minCapacity: 1,
        resourceId: "service/clusterName/serviceName",
        scalableDimension: "ecs:service:DesiredCount",
        serviceNamespace: "ecs",
    });
    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {
        name: "scale-down",
        policyType: "StepScaling",
        resourceId: ecsTarget.resourceId,
        scalableDimension: ecsTarget.scalableDimension,
        serviceNamespace: ecsTarget.serviceNamespace,
        stepScalingPolicyConfiguration: {
            adjustmentType: "ChangeInCapacity",
            cooldown: 60,
            metricAggregationType: "Maximum",
            stepAdjustments: [{
                metricIntervalUpperBound: "0",
                scalingAdjustment: -1,
            }],
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_target = aws.appautoscaling.Target("ecs_target",
        max_capacity=4,
        min_capacity=1,
        resource_id="service/clusterName/serviceName",
        scalable_dimension="ecs:service:DesiredCount",
        service_namespace="ecs")
    ecs_policy = aws.appautoscaling.Policy("ecs_policy",
        name="scale-down",
        policy_type="StepScaling",
        resource_id=ecs_target.resource_id,
        scalable_dimension=ecs_target.scalable_dimension,
        service_namespace=ecs_target.service_namespace,
        step_scaling_policy_configuration={
            "adjustment_type": "ChangeInCapacity",
            "cooldown": 60,
            "metric_aggregation_type": "Maximum",
            "step_adjustments": [{
                "metric_interval_upper_bound": "0",
                "scaling_adjustment": -1,
            }],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ecsTarget, err := appautoscaling.NewTarget(ctx, "ecs_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(4),
    			MinCapacity:       pulumi.Int(1),
    			ResourceId:        pulumi.String("service/clusterName/serviceName"),
    			ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
    			ServiceNamespace:  pulumi.String("ecs"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			Name:              pulumi.String("scale-down"),
    			PolicyType:        pulumi.String("StepScaling"),
    			ResourceId:        ecsTarget.ResourceId,
    			ScalableDimension: ecsTarget.ScalableDimension,
    			ServiceNamespace:  ecsTarget.ServiceNamespace,
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				AdjustmentType:        pulumi.String("ChangeInCapacity"),
    				Cooldown:              pulumi.Int(60),
    				MetricAggregationType: pulumi.String("Maximum"),
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalUpperBound: pulumi.String("0"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsTarget = new Aws.AppAutoScaling.Target("ecs_target", new()
        {
            MaxCapacity = 4,
            MinCapacity = 1,
            ResourceId = "service/clusterName/serviceName",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
    
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            Name = "scale-down",
            PolicyType = "StepScaling",
            ResourceId = ecsTarget.ResourceId,
            ScalableDimension = ecsTarget.ScalableDimension,
            ServiceNamespace = ecsTarget.ServiceNamespace,
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                AdjustmentType = "ChangeInCapacity",
                Cooldown = 60,
                MetricAggregationType = "Maximum",
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalUpperBound = "0",
                        ScalingAdjustment = -1,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Target;
    import com.pulumi.aws.appautoscaling.TargetArgs;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsTarget = new Target("ecsTarget", TargetArgs.builder()
                .maxCapacity(4)
                .minCapacity(1)
                .resourceId("service/clusterName/serviceName")
                .scalableDimension("ecs:service:DesiredCount")
                .serviceNamespace("ecs")
                .build());
    
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .name("scale-down")
                .policyType("StepScaling")
                .resourceId(ecsTarget.resourceId())
                .scalableDimension(ecsTarget.scalableDimension())
                .serviceNamespace(ecsTarget.serviceNamespace())
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .adjustmentType("ChangeInCapacity")
                    .cooldown(60)
                    .metricAggregationType("Maximum")
                    .stepAdjustments(PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                        .metricIntervalUpperBound(0)
                        .scalingAdjustment(-1)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsTarget:
        type: aws:appautoscaling:Target
        name: ecs_target
        properties:
          maxCapacity: 4
          minCapacity: 1
          resourceId: service/clusterName/serviceName
          scalableDimension: ecs:service:DesiredCount
          serviceNamespace: ecs
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          name: scale-down
          policyType: StepScaling
          resourceId: ${ecsTarget.resourceId}
          scalableDimension: ${ecsTarget.scalableDimension}
          serviceNamespace: ${ecsTarget.serviceNamespace}
          stepScalingPolicyConfiguration:
            adjustmentType: ChangeInCapacity
            cooldown: 60
            metricAggregationType: Maximum
            stepAdjustments:
              - metricIntervalUpperBound: 0
                scalingAdjustment: -1
    

    Preserve desired count when updating an autoscaled ECS Service

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ecsService = new aws.ecs.Service("ecs_service", {
        name: "serviceName",
        cluster: "clusterName",
        taskDefinition: "taskDefinitionFamily:1",
        desiredCount: 2,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_service = aws.ecs.Service("ecs_service",
        name="serviceName",
        cluster="clusterName",
        task_definition="taskDefinitionFamily:1",
        desired_count=2)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.NewService(ctx, "ecs_service", &ecs.ServiceArgs{
    			Name:           pulumi.String("serviceName"),
    			Cluster:        pulumi.String("clusterName"),
    			TaskDefinition: pulumi.String("taskDefinitionFamily:1"),
    			DesiredCount:   pulumi.Int(2),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsService = new Aws.Ecs.Service("ecs_service", new()
        {
            Name = "serviceName",
            Cluster = "clusterName",
            TaskDefinition = "taskDefinitionFamily:1",
            DesiredCount = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ecs.Service;
    import com.pulumi.aws.ecs.ServiceArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsService = new Service("ecsService", ServiceArgs.builder()
                .name("serviceName")
                .cluster("clusterName")
                .taskDefinition("taskDefinitionFamily:1")
                .desiredCount(2)
                .build());
    
        }
    }
    
    resources:
      ecsService:
        type: aws:ecs:Service
        name: ecs_service
        properties:
          name: serviceName
          cluster: clusterName
          taskDefinition: taskDefinitionFamily:1
          desiredCount: 2
    

    Aurora Read Replica Autoscaling

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const replicas = new aws.appautoscaling.Target("replicas", {
        serviceNamespace: "rds",
        scalableDimension: "rds:cluster:ReadReplicaCount",
        resourceId: `cluster:${example.id}`,
        minCapacity: 1,
        maxCapacity: 15,
    });
    const replicasPolicy = new aws.appautoscaling.Policy("replicas", {
        name: "cpu-auto-scaling",
        serviceNamespace: replicas.serviceNamespace,
        scalableDimension: replicas.scalableDimension,
        resourceId: replicas.resourceId,
        policyType: "TargetTrackingScaling",
        targetTrackingScalingPolicyConfiguration: {
            predefinedMetricSpecification: {
                predefinedMetricType: "RDSReaderAverageCPUUtilization",
            },
            targetValue: 75,
            scaleInCooldown: 300,
            scaleOutCooldown: 300,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    replicas = aws.appautoscaling.Target("replicas",
        service_namespace="rds",
        scalable_dimension="rds:cluster:ReadReplicaCount",
        resource_id=f"cluster:{example['id']}",
        min_capacity=1,
        max_capacity=15)
    replicas_policy = aws.appautoscaling.Policy("replicas",
        name="cpu-auto-scaling",
        service_namespace=replicas.service_namespace,
        scalable_dimension=replicas.scalable_dimension,
        resource_id=replicas.resource_id,
        policy_type="TargetTrackingScaling",
        target_tracking_scaling_policy_configuration={
            "predefined_metric_specification": {
                "predefined_metric_type": "RDSReaderAverageCPUUtilization",
            },
            "target_value": 75,
            "scale_in_cooldown": 300,
            "scale_out_cooldown": 300,
        })
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		replicas, err := appautoscaling.NewTarget(ctx, "replicas", &appautoscaling.TargetArgs{
    			ServiceNamespace:  pulumi.String("rds"),
    			ScalableDimension: pulumi.String("rds:cluster:ReadReplicaCount"),
    			ResourceId:        pulumi.Sprintf("cluster:%v", example.Id),
    			MinCapacity:       pulumi.Int(1),
    			MaxCapacity:       pulumi.Int(15),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appautoscaling.NewPolicy(ctx, "replicas", &appautoscaling.PolicyArgs{
    			Name:              pulumi.String("cpu-auto-scaling"),
    			ServiceNamespace:  replicas.ServiceNamespace,
    			ScalableDimension: replicas.ScalableDimension,
    			ResourceId:        replicas.ResourceId,
    			PolicyType:        pulumi.String("TargetTrackingScaling"),
    			TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
    				PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
    					PredefinedMetricType: pulumi.String("RDSReaderAverageCPUUtilization"),
    				},
    				TargetValue:      pulumi.Float64(75),
    				ScaleInCooldown:  pulumi.Int(300),
    				ScaleOutCooldown: pulumi.Int(300),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var replicas = new Aws.AppAutoScaling.Target("replicas", new()
        {
            ServiceNamespace = "rds",
            ScalableDimension = "rds:cluster:ReadReplicaCount",
            ResourceId = $"cluster:{example.Id}",
            MinCapacity = 1,
            MaxCapacity = 15,
        });
    
        var replicasPolicy = new Aws.AppAutoScaling.Policy("replicas", new()
        {
            Name = "cpu-auto-scaling",
            ServiceNamespace = replicas.ServiceNamespace,
            ScalableDimension = replicas.ScalableDimension,
            ResourceId = replicas.ResourceId,
            PolicyType = "TargetTrackingScaling",
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
                {
                    PredefinedMetricType = "RDSReaderAverageCPUUtilization",
                },
                TargetValue = 75,
                ScaleInCooldown = 300,
                ScaleOutCooldown = 300,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Target;
    import com.pulumi.aws.appautoscaling.TargetArgs;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var replicas = new Target("replicas", TargetArgs.builder()
                .serviceNamespace("rds")
                .scalableDimension("rds:cluster:ReadReplicaCount")
                .resourceId(String.format("cluster:%s", example.id()))
                .minCapacity(1)
                .maxCapacity(15)
                .build());
    
            var replicasPolicy = new Policy("replicasPolicy", PolicyArgs.builder()
                .name("cpu-auto-scaling")
                .serviceNamespace(replicas.serviceNamespace())
                .scalableDimension(replicas.scalableDimension())
                .resourceId(replicas.resourceId())
                .policyType("TargetTrackingScaling")
                .targetTrackingScalingPolicyConfiguration(PolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
                    .predefinedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs.builder()
                        .predefinedMetricType("RDSReaderAverageCPUUtilization")
                        .build())
                    .targetValue(75)
                    .scaleInCooldown(300)
                    .scaleOutCooldown(300)
                    .build())
                .build());
    
        }
    }
    
    resources:
      replicas:
        type: aws:appautoscaling:Target
        properties:
          serviceNamespace: rds
          scalableDimension: rds:cluster:ReadReplicaCount
          resourceId: cluster:${example.id}
          minCapacity: 1
          maxCapacity: 15
      replicasPolicy:
        type: aws:appautoscaling:Policy
        name: replicas
        properties:
          name: cpu-auto-scaling
          serviceNamespace: ${replicas.serviceNamespace}
          scalableDimension: ${replicas.scalableDimension}
          resourceId: ${replicas.resourceId}
          policyType: TargetTrackingScaling
          targetTrackingScalingPolicyConfiguration:
            predefinedMetricSpecification:
              predefinedMetricType: RDSReaderAverageCPUUtilization
            targetValue: 75
            scaleInCooldown: 300
            scaleOutCooldown: 300
    

    Create target tracking scaling policy using metric math

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ecsTarget = new aws.appautoscaling.Target("ecs_target", {
        maxCapacity: 4,
        minCapacity: 1,
        resourceId: "service/clusterName/serviceName",
        scalableDimension: "ecs:service:DesiredCount",
        serviceNamespace: "ecs",
    });
    const example = new aws.appautoscaling.Policy("example", {
        name: "foo",
        policyType: "TargetTrackingScaling",
        resourceId: ecsTarget.resourceId,
        scalableDimension: ecsTarget.scalableDimension,
        serviceNamespace: ecsTarget.serviceNamespace,
        targetTrackingScalingPolicyConfiguration: {
            targetValue: 100,
            customizedMetricSpecification: {
                metrics: [
                    {
                        label: "Get the queue size (the number of messages waiting to be processed)",
                        id: "m1",
                        metricStat: {
                            metric: {
                                metricName: "ApproximateNumberOfMessagesVisible",
                                namespace: "AWS/SQS",
                                dimensions: [{
                                    name: "QueueName",
                                    value: "my-queue",
                                }],
                            },
                            stat: "Sum",
                        },
                        returnData: false,
                    },
                    {
                        label: "Get the ECS running task count (the number of currently running tasks)",
                        id: "m2",
                        metricStat: {
                            metric: {
                                metricName: "RunningTaskCount",
                                namespace: "ECS/ContainerInsights",
                                dimensions: [
                                    {
                                        name: "ClusterName",
                                        value: "default",
                                    },
                                    {
                                        name: "ServiceName",
                                        value: "web-app",
                                    },
                                ],
                            },
                            stat: "Average",
                        },
                        returnData: false,
                    },
                    {
                        label: "Calculate the backlog per instance",
                        id: "e1",
                        expression: "m1 / m2",
                        returnData: true,
                    },
                ],
            },
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_target = aws.appautoscaling.Target("ecs_target",
        max_capacity=4,
        min_capacity=1,
        resource_id="service/clusterName/serviceName",
        scalable_dimension="ecs:service:DesiredCount",
        service_namespace="ecs")
    example = aws.appautoscaling.Policy("example",
        name="foo",
        policy_type="TargetTrackingScaling",
        resource_id=ecs_target.resource_id,
        scalable_dimension=ecs_target.scalable_dimension,
        service_namespace=ecs_target.service_namespace,
        target_tracking_scaling_policy_configuration={
            "target_value": 100,
            "customized_metric_specification": {
                "metrics": [
                    {
                        "label": "Get the queue size (the number of messages waiting to be processed)",
                        "id": "m1",
                        "metric_stat": {
                            "metric": {
                                "metric_name": "ApproximateNumberOfMessagesVisible",
                                "namespace": "AWS/SQS",
                                "dimensions": [{
                                    "name": "QueueName",
                                    "value": "my-queue",
                                }],
                            },
                            "stat": "Sum",
                        },
                        "return_data": False,
                    },
                    {
                        "label": "Get the ECS running task count (the number of currently running tasks)",
                        "id": "m2",
                        "metric_stat": {
                            "metric": {
                                "metric_name": "RunningTaskCount",
                                "namespace": "ECS/ContainerInsights",
                                "dimensions": [
                                    {
                                        "name": "ClusterName",
                                        "value": "default",
                                    },
                                    {
                                        "name": "ServiceName",
                                        "value": "web-app",
                                    },
                                ],
                            },
                            "stat": "Average",
                        },
                        "return_data": False,
                    },
                    {
                        "label": "Calculate the backlog per instance",
                        "id": "e1",
                        "expression": "m1 / m2",
                        "return_data": True,
                    },
                ],
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ecsTarget, err := appautoscaling.NewTarget(ctx, "ecs_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(4),
    			MinCapacity:       pulumi.Int(1),
    			ResourceId:        pulumi.String("service/clusterName/serviceName"),
    			ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
    			ServiceNamespace:  pulumi.String("ecs"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appautoscaling.NewPolicy(ctx, "example", &appautoscaling.PolicyArgs{
    			Name:              pulumi.String("foo"),
    			PolicyType:        pulumi.String("TargetTrackingScaling"),
    			ResourceId:        ecsTarget.ResourceId,
    			ScalableDimension: ecsTarget.ScalableDimension,
    			ServiceNamespace:  ecsTarget.ServiceNamespace,
    			TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
    				TargetValue: pulumi.Float64(100),
    				CustomizedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs{
    					Metrics: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArray{
    						&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs{
    							Label: pulumi.String("Get the queue size (the number of messages waiting to be processed)"),
    							Id:    pulumi.String("m1"),
    							MetricStat: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs{
    								Metric: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs{
    									MetricName: pulumi.String("ApproximateNumberOfMessagesVisible"),
    									Namespace:  pulumi.String("AWS/SQS"),
    									Dimensions: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArray{
    										&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs{
    											Name:  pulumi.String("QueueName"),
    											Value: pulumi.String("my-queue"),
    										},
    									},
    								},
    								Stat: pulumi.String("Sum"),
    							},
    							ReturnData: pulumi.Bool(false),
    						},
    						&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs{
    							Label: pulumi.String("Get the ECS running task count (the number of currently running tasks)"),
    							Id:    pulumi.String("m2"),
    							MetricStat: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs{
    								Metric: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs{
    									MetricName: pulumi.String("RunningTaskCount"),
    									Namespace:  pulumi.String("ECS/ContainerInsights"),
    									Dimensions: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArray{
    										&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs{
    											Name:  pulumi.String("ClusterName"),
    											Value: pulumi.String("default"),
    										},
    										&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs{
    											Name:  pulumi.String("ServiceName"),
    											Value: pulumi.String("web-app"),
    										},
    									},
    								},
    								Stat: pulumi.String("Average"),
    							},
    							ReturnData: pulumi.Bool(false),
    						},
    						&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs{
    							Label:      pulumi.String("Calculate the backlog per instance"),
    							Id:         pulumi.String("e1"),
    							Expression: pulumi.String("m1 / m2"),
    							ReturnData: pulumi.Bool(true),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsTarget = new Aws.AppAutoScaling.Target("ecs_target", new()
        {
            MaxCapacity = 4,
            MinCapacity = 1,
            ResourceId = "service/clusterName/serviceName",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
    
        var example = new Aws.AppAutoScaling.Policy("example", new()
        {
            Name = "foo",
            PolicyType = "TargetTrackingScaling",
            ResourceId = ecsTarget.ResourceId,
            ScalableDimension = ecsTarget.ScalableDimension,
            ServiceNamespace = ecsTarget.ServiceNamespace,
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                TargetValue = 100,
                CustomizedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs
                {
                    Metrics = new[]
                    {
                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs
                        {
                            Label = "Get the queue size (the number of messages waiting to be processed)",
                            Id = "m1",
                            MetricStat = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs
                            {
                                Metric = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs
                                {
                                    MetricName = "ApproximateNumberOfMessagesVisible",
                                    Namespace = "AWS/SQS",
                                    Dimensions = new[]
                                    {
                                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs
                                        {
                                            Name = "QueueName",
                                            Value = "my-queue",
                                        },
                                    },
                                },
                                Stat = "Sum",
                            },
                            ReturnData = false,
                        },
                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs
                        {
                            Label = "Get the ECS running task count (the number of currently running tasks)",
                            Id = "m2",
                            MetricStat = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs
                            {
                                Metric = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs
                                {
                                    MetricName = "RunningTaskCount",
                                    Namespace = "ECS/ContainerInsights",
                                    Dimensions = new[]
                                    {
                                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs
                                        {
                                            Name = "ClusterName",
                                            Value = "default",
                                        },
                                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs
                                        {
                                            Name = "ServiceName",
                                            Value = "web-app",
                                        },
                                    },
                                },
                                Stat = "Average",
                            },
                            ReturnData = false,
                        },
                        new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs
                        {
                            Label = "Calculate the backlog per instance",
                            Id = "e1",
                            Expression = "m1 / m2",
                            ReturnData = true,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Target;
    import com.pulumi.aws.appautoscaling.TargetArgs;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsTarget = new Target("ecsTarget", TargetArgs.builder()
                .maxCapacity(4)
                .minCapacity(1)
                .resourceId("service/clusterName/serviceName")
                .scalableDimension("ecs:service:DesiredCount")
                .serviceNamespace("ecs")
                .build());
    
            var example = new Policy("example", PolicyArgs.builder()
                .name("foo")
                .policyType("TargetTrackingScaling")
                .resourceId(ecsTarget.resourceId())
                .scalableDimension(ecsTarget.scalableDimension())
                .serviceNamespace(ecsTarget.serviceNamespace())
                .targetTrackingScalingPolicyConfiguration(PolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
                    .targetValue(100)
                    .customizedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs.builder()
                        .metrics(                    
                            PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs.builder()
                                .label("Get the queue size (the number of messages waiting to be processed)")
                                .id("m1")
                                .metricStat(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs.builder()
                                    .metric(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs.builder()
                                        .metricName("ApproximateNumberOfMessagesVisible")
                                        .namespace("AWS/SQS")
                                        .dimensions(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs.builder()
                                            .name("QueueName")
                                            .value("my-queue")
                                            .build())
                                        .build())
                                    .stat("Sum")
                                    .build())
                                .returnData(false)
                                .build(),
                            PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs.builder()
                                .label("Get the ECS running task count (the number of currently running tasks)")
                                .id("m2")
                                .metricStat(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs.builder()
                                    .metric(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs.builder()
                                        .metricName("RunningTaskCount")
                                        .namespace("ECS/ContainerInsights")
                                        .dimensions(                                    
                                            PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs.builder()
                                                .name("ClusterName")
                                                .value("default")
                                                .build(),
                                            PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs.builder()
                                                .name("ServiceName")
                                                .value("web-app")
                                                .build())
                                        .build())
                                    .stat("Average")
                                    .build())
                                .returnData(false)
                                .build(),
                            PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs.builder()
                                .label("Calculate the backlog per instance")
                                .id("e1")
                                .expression("m1 / m2")
                                .returnData(true)
                                .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsTarget:
        type: aws:appautoscaling:Target
        name: ecs_target
        properties:
          maxCapacity: 4
          minCapacity: 1
          resourceId: service/clusterName/serviceName
          scalableDimension: ecs:service:DesiredCount
          serviceNamespace: ecs
      example:
        type: aws:appautoscaling:Policy
        properties:
          name: foo
          policyType: TargetTrackingScaling
          resourceId: ${ecsTarget.resourceId}
          scalableDimension: ${ecsTarget.scalableDimension}
          serviceNamespace: ${ecsTarget.serviceNamespace}
          targetTrackingScalingPolicyConfiguration:
            targetValue: 100
            customizedMetricSpecification:
              metrics:
                - label: Get the queue size (the number of messages waiting to be processed)
                  id: m1
                  metricStat:
                    metric:
                      metricName: ApproximateNumberOfMessagesVisible
                      namespace: AWS/SQS
                      dimensions:
                        - name: QueueName
                          value: my-queue
                    stat: Sum
                  returnData: false
                - label: Get the ECS running task count (the number of currently running tasks)
                  id: m2
                  metricStat:
                    metric:
                      metricName: RunningTaskCount
                      namespace: ECS/ContainerInsights
                      dimensions:
                        - name: ClusterName
                          value: default
                        - name: ServiceName
                          value: web-app
                    stat: Average
                  returnData: false
                - label: Calculate the backlog per instance
                  id: e1
                  expression: m1 / m2
                  returnData: true
    

    MSK / Kafka Autoscaling

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const mskTarget = new aws.appautoscaling.Target("msk_target", {
        serviceNamespace: "kafka",
        scalableDimension: "kafka:broker-storage:VolumeSize",
        resourceId: example.arn,
        minCapacity: 1,
        maxCapacity: 8,
    });
    const targets = new aws.appautoscaling.Policy("targets", {
        name: "storage-size-auto-scaling",
        serviceNamespace: mskTarget.serviceNamespace,
        scalableDimension: mskTarget.scalableDimension,
        resourceId: mskTarget.resourceId,
        policyType: "TargetTrackingScaling",
        targetTrackingScalingPolicyConfiguration: {
            predefinedMetricSpecification: {
                predefinedMetricType: "KafkaBrokerStorageUtilization",
            },
            targetValue: 55,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    msk_target = aws.appautoscaling.Target("msk_target",
        service_namespace="kafka",
        scalable_dimension="kafka:broker-storage:VolumeSize",
        resource_id=example["arn"],
        min_capacity=1,
        max_capacity=8)
    targets = aws.appautoscaling.Policy("targets",
        name="storage-size-auto-scaling",
        service_namespace=msk_target.service_namespace,
        scalable_dimension=msk_target.scalable_dimension,
        resource_id=msk_target.resource_id,
        policy_type="TargetTrackingScaling",
        target_tracking_scaling_policy_configuration={
            "predefined_metric_specification": {
                "predefined_metric_type": "KafkaBrokerStorageUtilization",
            },
            "target_value": 55,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		mskTarget, err := appautoscaling.NewTarget(ctx, "msk_target", &appautoscaling.TargetArgs{
    			ServiceNamespace:  pulumi.String("kafka"),
    			ScalableDimension: pulumi.String("kafka:broker-storage:VolumeSize"),
    			ResourceId:        pulumi.Any(example.Arn),
    			MinCapacity:       pulumi.Int(1),
    			MaxCapacity:       pulumi.Int(8),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appautoscaling.NewPolicy(ctx, "targets", &appautoscaling.PolicyArgs{
    			Name:              pulumi.String("storage-size-auto-scaling"),
    			ServiceNamespace:  mskTarget.ServiceNamespace,
    			ScalableDimension: mskTarget.ScalableDimension,
    			ResourceId:        mskTarget.ResourceId,
    			PolicyType:        pulumi.String("TargetTrackingScaling"),
    			TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
    				PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
    					PredefinedMetricType: pulumi.String("KafkaBrokerStorageUtilization"),
    				},
    				TargetValue: pulumi.Float64(55),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var mskTarget = new Aws.AppAutoScaling.Target("msk_target", new()
        {
            ServiceNamespace = "kafka",
            ScalableDimension = "kafka:broker-storage:VolumeSize",
            ResourceId = example.Arn,
            MinCapacity = 1,
            MaxCapacity = 8,
        });
    
        var targets = new Aws.AppAutoScaling.Policy("targets", new()
        {
            Name = "storage-size-auto-scaling",
            ServiceNamespace = mskTarget.ServiceNamespace,
            ScalableDimension = mskTarget.ScalableDimension,
            ResourceId = mskTarget.ResourceId,
            PolicyType = "TargetTrackingScaling",
            TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
            {
                PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
                {
                    PredefinedMetricType = "KafkaBrokerStorageUtilization",
                },
                TargetValue = 55,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Target;
    import com.pulumi.aws.appautoscaling.TargetArgs;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var mskTarget = new Target("mskTarget", TargetArgs.builder()
                .serviceNamespace("kafka")
                .scalableDimension("kafka:broker-storage:VolumeSize")
                .resourceId(example.arn())
                .minCapacity(1)
                .maxCapacity(8)
                .build());
    
            var targets = new Policy("targets", PolicyArgs.builder()
                .name("storage-size-auto-scaling")
                .serviceNamespace(mskTarget.serviceNamespace())
                .scalableDimension(mskTarget.scalableDimension())
                .resourceId(mskTarget.resourceId())
                .policyType("TargetTrackingScaling")
                .targetTrackingScalingPolicyConfiguration(PolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
                    .predefinedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs.builder()
                        .predefinedMetricType("KafkaBrokerStorageUtilization")
                        .build())
                    .targetValue(55)
                    .build())
                .build());
    
        }
    }
    
    resources:
      mskTarget:
        type: aws:appautoscaling:Target
        name: msk_target
        properties:
          serviceNamespace: kafka
          scalableDimension: kafka:broker-storage:VolumeSize
          resourceId: ${example.arn}
          minCapacity: 1
          maxCapacity: 8
      targets:
        type: aws:appautoscaling:Policy
        properties:
          name: storage-size-auto-scaling
          serviceNamespace: ${mskTarget.serviceNamespace}
          scalableDimension: ${mskTarget.scalableDimension}
          resourceId: ${mskTarget.resourceId}
          policyType: TargetTrackingScaling
          targetTrackingScalingPolicyConfiguration:
            predefinedMetricSpecification:
              predefinedMetricType: KafkaBrokerStorageUtilization
            targetValue: 55
    

    Create Policy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);
    @overload
    def Policy(resource_name: str,
               args: PolicyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Policy(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               resource_id: Optional[str] = None,
               scalable_dimension: Optional[str] = None,
               service_namespace: Optional[str] = None,
               name: Optional[str] = None,
               policy_type: Optional[str] = None,
               step_scaling_policy_configuration: Optional[PolicyStepScalingPolicyConfigurationArgs] = None,
               target_tracking_scaling_policy_configuration: Optional[PolicyTargetTrackingScalingPolicyConfigurationArgs] = None)
    func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
    public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
    public Policy(String name, PolicyArgs args)
    public Policy(String name, PolicyArgs args, CustomResourceOptions options)
    
    type: aws:appautoscaling:Policy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var awsPolicyResource = new Aws.AppAutoScaling.Policy("awsPolicyResource", new()
    {
        ResourceId = "string",
        ScalableDimension = "string",
        ServiceNamespace = "string",
        Name = "string",
        PolicyType = "string",
        StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
        {
            AdjustmentType = "string",
            Cooldown = 0,
            MetricAggregationType = "string",
            MinAdjustmentMagnitude = 0,
            StepAdjustments = new[]
            {
                new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                {
                    ScalingAdjustment = 0,
                    MetricIntervalLowerBound = "string",
                    MetricIntervalUpperBound = "string",
                },
            },
        },
        TargetTrackingScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationArgs
        {
            TargetValue = 0,
            CustomizedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs
            {
                Dimensions = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArgs
                    {
                        Name = "string",
                        Value = "string",
                    },
                },
                MetricName = "string",
                Metrics = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs
                    {
                        Id = "string",
                        Expression = "string",
                        Label = "string",
                        MetricStat = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs
                        {
                            Metric = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs
                            {
                                MetricName = "string",
                                Namespace = "string",
                                Dimensions = new[]
                                {
                                    new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs
                                    {
                                        Name = "string",
                                        Value = "string",
                                    },
                                },
                            },
                            Stat = "string",
                            Unit = "string",
                        },
                        ReturnData = false,
                    },
                },
                Namespace = "string",
                Statistic = "string",
                Unit = "string",
            },
            DisableScaleIn = false,
            PredefinedMetricSpecification = new Aws.AppAutoScaling.Inputs.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs
            {
                PredefinedMetricType = "string",
                ResourceLabel = "string",
            },
            ScaleInCooldown = 0,
            ScaleOutCooldown = 0,
        },
    });
    
    example, err := appautoscaling.NewPolicy(ctx, "awsPolicyResource", &appautoscaling.PolicyArgs{
    	ResourceId:        pulumi.String("string"),
    	ScalableDimension: pulumi.String("string"),
    	ServiceNamespace:  pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	PolicyType:        pulumi.String("string"),
    	StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    		AdjustmentType:         pulumi.String("string"),
    		Cooldown:               pulumi.Int(0),
    		MetricAggregationType:  pulumi.String("string"),
    		MinAdjustmentMagnitude: pulumi.Int(0),
    		StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    			&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    				ScalingAdjustment:        pulumi.Int(0),
    				MetricIntervalLowerBound: pulumi.String("string"),
    				MetricIntervalUpperBound: pulumi.String("string"),
    			},
    		},
    	},
    	TargetTrackingScalingPolicyConfiguration: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationArgs{
    		TargetValue: pulumi.Float64(0),
    		CustomizedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs{
    			Dimensions: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArray{
    				&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArgs{
    					Name:  pulumi.String("string"),
    					Value: pulumi.String("string"),
    				},
    			},
    			MetricName: pulumi.String("string"),
    			Metrics: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArray{
    				&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs{
    					Id:         pulumi.String("string"),
    					Expression: pulumi.String("string"),
    					Label:      pulumi.String("string"),
    					MetricStat: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs{
    						Metric: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs{
    							MetricName: pulumi.String("string"),
    							Namespace:  pulumi.String("string"),
    							Dimensions: appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArray{
    								&appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs{
    									Name:  pulumi.String("string"),
    									Value: pulumi.String("string"),
    								},
    							},
    						},
    						Stat: pulumi.String("string"),
    						Unit: pulumi.String("string"),
    					},
    					ReturnData: pulumi.Bool(false),
    				},
    			},
    			Namespace: pulumi.String("string"),
    			Statistic: pulumi.String("string"),
    			Unit:      pulumi.String("string"),
    		},
    		DisableScaleIn: pulumi.Bool(false),
    		PredefinedMetricSpecification: &appautoscaling.PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs{
    			PredefinedMetricType: pulumi.String("string"),
    			ResourceLabel:        pulumi.String("string"),
    		},
    		ScaleInCooldown:  pulumi.Int(0),
    		ScaleOutCooldown: pulumi.Int(0),
    	},
    })
    
    var awsPolicyResource = new Policy("awsPolicyResource", PolicyArgs.builder()
        .resourceId("string")
        .scalableDimension("string")
        .serviceNamespace("string")
        .name("string")
        .policyType("string")
        .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
            .adjustmentType("string")
            .cooldown(0)
            .metricAggregationType("string")
            .minAdjustmentMagnitude(0)
            .stepAdjustments(PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                .scalingAdjustment(0)
                .metricIntervalLowerBound("string")
                .metricIntervalUpperBound("string")
                .build())
            .build())
        .targetTrackingScalingPolicyConfiguration(PolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
            .targetValue(0)
            .customizedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs.builder()
                .dimensions(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArgs.builder()
                    .name("string")
                    .value("string")
                    .build())
                .metricName("string")
                .metrics(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs.builder()
                    .id("string")
                    .expression("string")
                    .label("string")
                    .metricStat(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs.builder()
                        .metric(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs.builder()
                            .metricName("string")
                            .namespace("string")
                            .dimensions(PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs.builder()
                                .name("string")
                                .value("string")
                                .build())
                            .build())
                        .stat("string")
                        .unit("string")
                        .build())
                    .returnData(false)
                    .build())
                .namespace("string")
                .statistic("string")
                .unit("string")
                .build())
            .disableScaleIn(false)
            .predefinedMetricSpecification(PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs.builder()
                .predefinedMetricType("string")
                .resourceLabel("string")
                .build())
            .scaleInCooldown(0)
            .scaleOutCooldown(0)
            .build())
        .build());
    
    aws_policy_resource = aws.appautoscaling.Policy("awsPolicyResource",
        resource_id="string",
        scalable_dimension="string",
        service_namespace="string",
        name="string",
        policy_type="string",
        step_scaling_policy_configuration={
            "adjustment_type": "string",
            "cooldown": 0,
            "metric_aggregation_type": "string",
            "min_adjustment_magnitude": 0,
            "step_adjustments": [{
                "scaling_adjustment": 0,
                "metric_interval_lower_bound": "string",
                "metric_interval_upper_bound": "string",
            }],
        },
        target_tracking_scaling_policy_configuration={
            "target_value": 0,
            "customized_metric_specification": {
                "dimensions": [{
                    "name": "string",
                    "value": "string",
                }],
                "metric_name": "string",
                "metrics": [{
                    "id": "string",
                    "expression": "string",
                    "label": "string",
                    "metric_stat": {
                        "metric": {
                            "metric_name": "string",
                            "namespace": "string",
                            "dimensions": [{
                                "name": "string",
                                "value": "string",
                            }],
                        },
                        "stat": "string",
                        "unit": "string",
                    },
                    "return_data": False,
                }],
                "namespace": "string",
                "statistic": "string",
                "unit": "string",
            },
            "disable_scale_in": False,
            "predefined_metric_specification": {
                "predefined_metric_type": "string",
                "resource_label": "string",
            },
            "scale_in_cooldown": 0,
            "scale_out_cooldown": 0,
        })
    
    const awsPolicyResource = new aws.appautoscaling.Policy("awsPolicyResource", {
        resourceId: "string",
        scalableDimension: "string",
        serviceNamespace: "string",
        name: "string",
        policyType: "string",
        stepScalingPolicyConfiguration: {
            adjustmentType: "string",
            cooldown: 0,
            metricAggregationType: "string",
            minAdjustmentMagnitude: 0,
            stepAdjustments: [{
                scalingAdjustment: 0,
                metricIntervalLowerBound: "string",
                metricIntervalUpperBound: "string",
            }],
        },
        targetTrackingScalingPolicyConfiguration: {
            targetValue: 0,
            customizedMetricSpecification: {
                dimensions: [{
                    name: "string",
                    value: "string",
                }],
                metricName: "string",
                metrics: [{
                    id: "string",
                    expression: "string",
                    label: "string",
                    metricStat: {
                        metric: {
                            metricName: "string",
                            namespace: "string",
                            dimensions: [{
                                name: "string",
                                value: "string",
                            }],
                        },
                        stat: "string",
                        unit: "string",
                    },
                    returnData: false,
                }],
                namespace: "string",
                statistic: "string",
                unit: "string",
            },
            disableScaleIn: false,
            predefinedMetricSpecification: {
                predefinedMetricType: "string",
                resourceLabel: "string",
            },
            scaleInCooldown: 0,
            scaleOutCooldown: 0,
        },
    });
    
    type: aws:appautoscaling:Policy
    properties:
        name: string
        policyType: string
        resourceId: string
        scalableDimension: string
        serviceNamespace: string
        stepScalingPolicyConfiguration:
            adjustmentType: string
            cooldown: 0
            metricAggregationType: string
            minAdjustmentMagnitude: 0
            stepAdjustments:
                - metricIntervalLowerBound: string
                  metricIntervalUpperBound: string
                  scalingAdjustment: 0
        targetTrackingScalingPolicyConfiguration:
            customizedMetricSpecification:
                dimensions:
                    - name: string
                      value: string
                metricName: string
                metrics:
                    - expression: string
                      id: string
                      label: string
                      metricStat:
                        metric:
                            dimensions:
                                - name: string
                                  value: string
                            metricName: string
                            namespace: string
                        stat: string
                        unit: string
                      returnData: false
                namespace: string
                statistic: string
                unit: string
            disableScaleIn: false
            predefinedMetricSpecification:
                predefinedMetricType: string
                resourceLabel: string
            scaleInCooldown: 0
            scaleOutCooldown: 0
            targetValue: 0
    

    Policy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Policy resource accepts the following input properties:

    ResourceId string
    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
    ScalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    ServiceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    Name string
    Name of the policy. Must be between 1 and 255 characters in length.
    PolicyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    StepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    ResourceId string
    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
    ScalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    ServiceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    Name string
    Name of the policy. Must be between 1 and 255 characters in length.
    PolicyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    StepScalingPolicyConfiguration PolicyStepScalingPolicyConfigurationArgs
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfigurationArgs
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    resourceId String
    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
    scalableDimension String
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace String
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    name String
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType String
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    resourceId string
    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
    scalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    name string
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    resource_id str
    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
    scalable_dimension str
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    service_namespace str
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    name str
    Name of the policy. Must be between 1 and 255 characters in length.
    policy_type str
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    step_scaling_policy_configuration PolicyStepScalingPolicyConfigurationArgs
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    target_tracking_scaling_policy_configuration PolicyTargetTrackingScalingPolicyConfigurationArgs
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    resourceId String
    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
    scalableDimension String
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace String
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    name String
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType String
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    stepScalingPolicyConfiguration Property Map
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration Property Map
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:

    AlarmArns List<string>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    Arn string
    ARN assigned by AWS to the scaling policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    AlarmArns []string
    List of CloudWatch alarm ARNs associated with the scaling policy.
    Arn string
    ARN assigned by AWS to the scaling policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    alarmArns List<String>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn String
    ARN assigned by AWS to the scaling policy.
    id String
    The provider-assigned unique ID for this managed resource.
    alarmArns string[]
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn string
    ARN assigned by AWS to the scaling policy.
    id string
    The provider-assigned unique ID for this managed resource.
    alarm_arns Sequence[str]
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn str
    ARN assigned by AWS to the scaling policy.
    id str
    The provider-assigned unique ID for this managed resource.
    alarmArns List<String>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn String
    ARN assigned by AWS to the scaling policy.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Policy Resource

    Get an existing Policy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PolicyState, opts?: CustomResourceOptions): Policy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alarm_arns: Optional[Sequence[str]] = None,
            arn: Optional[str] = None,
            name: Optional[str] = None,
            policy_type: Optional[str] = None,
            resource_id: Optional[str] = None,
            scalable_dimension: Optional[str] = None,
            service_namespace: Optional[str] = None,
            step_scaling_policy_configuration: Optional[PolicyStepScalingPolicyConfigurationArgs] = None,
            target_tracking_scaling_policy_configuration: Optional[PolicyTargetTrackingScalingPolicyConfigurationArgs] = None) -> Policy
    func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
    public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
    public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AlarmArns List<string>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    Arn string
    ARN assigned by AWS to the scaling policy.
    Name string
    Name of the policy. Must be between 1 and 255 characters in length.
    PolicyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    ResourceId string
    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
    ScalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    ServiceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    StepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    AlarmArns []string
    List of CloudWatch alarm ARNs associated with the scaling policy.
    Arn string
    ARN assigned by AWS to the scaling policy.
    Name string
    Name of the policy. Must be between 1 and 255 characters in length.
    PolicyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    ResourceId string
    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
    ScalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    ServiceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    StepScalingPolicyConfiguration PolicyStepScalingPolicyConfigurationArgs
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    TargetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfigurationArgs
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    alarmArns List<String>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn String
    ARN assigned by AWS to the scaling policy.
    name String
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType String
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    resourceId String
    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
    scalableDimension String
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace String
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    alarmArns string[]
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn string
    ARN assigned by AWS to the scaling policy.
    name string
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType string
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    resourceId string
    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
    scalableDimension string
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace string
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    stepScalingPolicyConfiguration PolicyStepScalingPolicyConfiguration
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration PolicyTargetTrackingScalingPolicyConfiguration
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    alarm_arns Sequence[str]
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn str
    ARN assigned by AWS to the scaling policy.
    name str
    Name of the policy. Must be between 1 and 255 characters in length.
    policy_type str
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    resource_id str
    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
    scalable_dimension str
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    service_namespace str
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    step_scaling_policy_configuration PolicyStepScalingPolicyConfigurationArgs
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    target_tracking_scaling_policy_configuration PolicyTargetTrackingScalingPolicyConfigurationArgs
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.
    alarmArns List<String>
    List of CloudWatch alarm ARNs associated with the scaling policy.
    arn String
    ARN assigned by AWS to the scaling policy.
    name String
    Name of the policy. Must be between 1 and 255 characters in length.
    policyType String
    Policy type. Valid values are StepScaling and TargetTrackingScaling. Defaults to StepScaling. Certain services only support only one policy type. For more information see the Target Tracking Scaling Policies and Step Scaling Policies documentation.
    resourceId String
    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
    scalableDimension String
    Scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference
    serviceNamespace String
    AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference
    stepScalingPolicyConfiguration Property Map
    Step scaling policy configuration, requires policy_type = "StepScaling" (default). See supported fields below.
    targetTrackingScalingPolicyConfiguration Property Map
    Target tracking policy, requires policy_type = "TargetTrackingScaling". See supported fields below.

    Supporting Types

    PolicyStepScalingPolicyConfiguration, PolicyStepScalingPolicyConfigurationArgs

    AdjustmentType string
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    Cooldown int
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    MetricAggregationType string
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    MinAdjustmentMagnitude int
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    StepAdjustments List<PolicyStepScalingPolicyConfigurationStepAdjustment>
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    
    AdjustmentType string
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    Cooldown int
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    MetricAggregationType string
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    MinAdjustmentMagnitude int
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    StepAdjustments []PolicyStepScalingPolicyConfigurationStepAdjustment
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    
    adjustmentType String
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    cooldown Integer
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    metricAggregationType String
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    minAdjustmentMagnitude Integer
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    stepAdjustments List<PolicyStepScalingPolicyConfigurationStepAdjustment>
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    
    adjustmentType string
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    cooldown number
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    metricAggregationType string
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    minAdjustmentMagnitude number
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    stepAdjustments PolicyStepScalingPolicyConfigurationStepAdjustment[]
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    
    adjustment_type str
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    cooldown int
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    metric_aggregation_type str
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    min_adjustment_magnitude int
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    step_adjustments Sequence[PolicyStepScalingPolicyConfigurationStepAdjustment]
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    
    adjustmentType String
    Whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
    cooldown Number
    Amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
    metricAggregationType String
    Aggregation type for the policy's metrics. Valid values are "Minimum", "Maximum", and "Average". Without a value, AWS will treat the aggregation type as "Average".
    minAdjustmentMagnitude Number
    Minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount.
    stepAdjustments List<Property Map>
    Set of adjustments that manage scaling. These have the following structure:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    

    const ecsPolicy = new aws.appautoscaling.Policy("ecs_policy", {stepScalingPolicyConfiguration: { stepAdjustments: [ { metricIntervalLowerBound: "1", metricIntervalUpperBound: "2", scalingAdjustment: -1, }, { metricIntervalLowerBound: "2", metricIntervalUpperBound: "3", scalingAdjustment: 1, }, ], }});

    import pulumi
    import pulumi_aws as aws
    
    ecs_policy = aws.appautoscaling.Policy("ecs_policy", step_scaling_policy_configuration={
        "step_adjustments": [
            {
                "metric_interval_lower_bound": "1",
                "metric_interval_upper_bound": "2",
                "scaling_adjustment": -1,
            },
            {
                "metric_interval_lower_bound": "2",
                "metric_interval_upper_bound": "3",
                "scaling_adjustment": 1,
            },
        ],
    })
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var ecsPolicy = new Aws.AppAutoScaling.Policy("ecs_policy", new()
        {
            StepScalingPolicyConfiguration = new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationArgs
            {
                StepAdjustments = new[]
                {
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "1",
                        MetricIntervalUpperBound = "2",
                        ScalingAdjustment = -1,
                    },
                    new Aws.AppAutoScaling.Inputs.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs
                    {
                        MetricIntervalLowerBound = "2",
                        MetricIntervalUpperBound = "3",
                        ScalingAdjustment = 1,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appautoscaling"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := appautoscaling.NewPolicy(ctx, "ecs_policy", &appautoscaling.PolicyArgs{
    			StepScalingPolicyConfiguration: &appautoscaling.PolicyStepScalingPolicyConfigurationArgs{
    				StepAdjustments: appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArray{
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("1"),
    						MetricIntervalUpperBound: pulumi.String("2"),
    						ScalingAdjustment:        pulumi.Int(-1),
    					},
    					&appautoscaling.PolicyStepScalingPolicyConfigurationStepAdjustmentArgs{
    						MetricIntervalLowerBound: pulumi.String("2"),
    						MetricIntervalUpperBound: pulumi.String("3"),
    						ScalingAdjustment:        pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.appautoscaling.Policy;
    import com.pulumi.aws.appautoscaling.PolicyArgs;
    import com.pulumi.aws.appautoscaling.inputs.PolicyStepScalingPolicyConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var ecsPolicy = new Policy("ecsPolicy", PolicyArgs.builder()
                .stepScalingPolicyConfiguration(PolicyStepScalingPolicyConfigurationArgs.builder()
                    .stepAdjustments(                
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(1)
                            .metricIntervalUpperBound(2)
                            .scalingAdjustment(-1)
                            .build(),
                        PolicyStepScalingPolicyConfigurationStepAdjustmentArgs.builder()
                            .metricIntervalLowerBound(2)
                            .metricIntervalUpperBound(3)
                            .scalingAdjustment(1)
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      ecsPolicy:
        type: aws:appautoscaling:Policy
        name: ecs_policy
        properties:
          stepScalingPolicyConfiguration:
            stepAdjustments:
              - metricIntervalLowerBound: 1
                metricIntervalUpperBound: 2
                scalingAdjustment: -1
              - metricIntervalLowerBound: 2
                metricIntervalUpperBound: 3
                scalingAdjustment: 1
    

    PolicyStepScalingPolicyConfigurationStepAdjustment, PolicyStepScalingPolicyConfigurationStepAdjustmentArgs

    ScalingAdjustment int
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    MetricIntervalLowerBound string
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    MetricIntervalUpperBound string
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.
    ScalingAdjustment int
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    MetricIntervalLowerBound string
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    MetricIntervalUpperBound string
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.
    scalingAdjustment Integer
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    metricIntervalLowerBound String
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    metricIntervalUpperBound String
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.
    scalingAdjustment number
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    metricIntervalLowerBound string
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    metricIntervalUpperBound string
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.
    scaling_adjustment int
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    metric_interval_lower_bound str
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    metric_interval_upper_bound str
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.
    scalingAdjustment Number
    Number of members by which to scale, when the adjustment bounds are breached. A positive value scales up. A negative value scales down.
    metricIntervalLowerBound String
    Lower bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as negative infinity.
    metricIntervalUpperBound String
    Upper bound for the difference between the alarm threshold and the CloudWatch metric. Without a value, AWS will treat this bound as infinity. The upper bound must be greater than the lower bound.

    PolicyTargetTrackingScalingPolicyConfiguration, PolicyTargetTrackingScalingPolicyConfigurationArgs

    TargetValue double
    Target value for the metric.
    CustomizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    DisableScaleIn bool
    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. The default value is false.
    PredefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
    Predefined metric. See supported fields below.
    ScaleInCooldown int
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    ScaleOutCooldown int
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
    TargetValue float64
    Target value for the metric.
    CustomizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    DisableScaleIn bool
    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. The default value is false.
    PredefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
    Predefined metric. See supported fields below.
    ScaleInCooldown int
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    ScaleOutCooldown int
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
    targetValue Double
    Target value for the metric.
    customizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    disableScaleIn Boolean
    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. The default value is false.
    predefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
    Predefined metric. See supported fields below.
    scaleInCooldown Integer
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    scaleOutCooldown Integer
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
    targetValue number
    Target value for the metric.
    customizedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    disableScaleIn boolean
    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. The default value is false.
    predefinedMetricSpecification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
    Predefined metric. See supported fields below.
    scaleInCooldown number
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    scaleOutCooldown number
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
    target_value float
    Target value for the metric.
    customized_metric_specification PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    disable_scale_in bool
    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. The default value is false.
    predefined_metric_specification PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification
    Predefined metric. See supported fields below.
    scale_in_cooldown int
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    scale_out_cooldown int
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.
    targetValue Number
    Target value for the metric.
    customizedMetricSpecification Property Map
    Custom CloudWatch metric. Documentation can be found at: AWS Customized Metric Specification. See supported fields below.
    disableScaleIn Boolean
    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. The default value is false.
    predefinedMetricSpecification Property Map
    Predefined metric. See supported fields below.
    scaleInCooldown Number
    Amount of time, in seconds, after a scale in activity completes before another scale in activity can start.
    scaleOutCooldown Number
    Amount of time, in seconds, after a scale out activity completes before another scale out activity can start.

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecification, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationArgs

    Dimensions List<PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension>
    Dimensions of the metric.
    MetricName string
    Name of the metric.
    Metrics List<PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric>
    Metrics to include, as a metric data query.
    Namespace string
    Namespace of the metric.
    Statistic string
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    Unit string
    Unit of the metrics to return.
    Dimensions []PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension
    Dimensions of the metric.
    MetricName string
    Name of the metric.
    Metrics []PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric
    Metrics to include, as a metric data query.
    Namespace string
    Namespace of the metric.
    Statistic string
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    Unit string
    Unit of the metrics to return.
    dimensions List<PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension>
    Dimensions of the metric.
    metricName String
    Name of the metric.
    metrics List<PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric>
    Metrics to include, as a metric data query.
    namespace String
    Namespace of the metric.
    statistic String
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    unit String
    Unit of the metrics to return.
    dimensions PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension[]
    Dimensions of the metric.
    metricName string
    Name of the metric.
    metrics PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric[]
    Metrics to include, as a metric data query.
    namespace string
    Namespace of the metric.
    statistic string
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    unit string
    Unit of the metrics to return.
    dimensions Sequence[PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension]
    Dimensions of the metric.
    metric_name str
    Name of the metric.
    metrics Sequence[PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric]
    Metrics to include, as a metric data query.
    namespace str
    Namespace of the metric.
    statistic str
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    unit str
    Unit of the metrics to return.
    dimensions List<Property Map>
    Dimensions of the metric.
    metricName String
    Name of the metric.
    metrics List<Property Map>
    Metrics to include, as a metric data query.
    namespace String
    Namespace of the metric.
    statistic String
    Statistic of the metric. Valid values: Average, Minimum, Maximum, SampleCount, and Sum.
    unit String
    Unit of the metrics to return.

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimension, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationDimensionArgs

    Name string
    Name of the dimension.
    Value string
    Value of the dimension.
    Name string
    Name of the dimension.
    Value string
    Value of the dimension.
    name String
    Name of the dimension.
    value String
    Value of the dimension.
    name string
    Name of the dimension.
    value string
    Value of the dimension.
    name str
    Name of the dimension.
    value str
    Value of the dimension.
    name String
    Name of the dimension.
    value String
    Value of the dimension.

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetric, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricArgs

    Id string
    Short name for the metric used in target tracking scaling policy.
    Expression string
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    Label string
    Human-readable label for this metric or expression.
    MetricStat PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    ReturnData bool
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true
    Id string
    Short name for the metric used in target tracking scaling policy.
    Expression string
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    Label string
    Human-readable label for this metric or expression.
    MetricStat PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    ReturnData bool
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true
    id String
    Short name for the metric used in target tracking scaling policy.
    expression String
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    label String
    Human-readable label for this metric or expression.
    metricStat PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    returnData Boolean
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true
    id string
    Short name for the metric used in target tracking scaling policy.
    expression string
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    label string
    Human-readable label for this metric or expression.
    metricStat PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    returnData boolean
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true
    id str
    Short name for the metric used in target tracking scaling policy.
    expression str
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    label str
    Human-readable label for this metric or expression.
    metric_stat PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    return_data bool
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true
    id String
    Short name for the metric used in target tracking scaling policy.
    expression String
    Math expression used on the returned metric. You must specify either expression or metric_stat, but not both.
    label String
    Human-readable label for this metric or expression.
    metricStat Property Map
    Structure that defines CloudWatch metric to be used in target tracking scaling policy. You must specify either expression or metric_stat, but not both.
    returnData Boolean
    Boolean that indicates whether to return the timestamps and raw data values of this metric, the default is true

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStat, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatArgs

    Metric PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    Stat string
    Statistic of the metrics to return.
    Unit string
    Unit of the metrics to return.
    Metric PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    Stat string
    Statistic of the metrics to return.
    Unit string
    Unit of the metrics to return.
    metric PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    stat String
    Statistic of the metrics to return.
    unit String
    Unit of the metrics to return.
    metric PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    stat string
    Statistic of the metrics to return.
    unit string
    Unit of the metrics to return.
    metric PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    stat str
    Statistic of the metrics to return.
    unit str
    Unit of the metrics to return.
    metric Property Map
    Structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
    stat String
    Statistic of the metrics to return.
    unit String
    Unit of the metrics to return.

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetric, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricArgs

    metricName String
    Name of the metric.
    namespace String
    Namespace of the metric.
    dimensions List<Property Map>
    Dimensions of the metric.

    PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimension, PolicyTargetTrackingScalingPolicyConfigurationCustomizedMetricSpecificationMetricMetricStatMetricDimensionArgs

    Name string
    Name of the dimension.
    Value string
    Value of the dimension.
    Name string
    Name of the dimension.
    Value string
    Value of the dimension.
    name String
    Name of the dimension.
    value String
    Value of the dimension.
    name string
    Name of the dimension.
    value string
    Value of the dimension.
    name str
    Name of the dimension.
    value str
    Value of the dimension.
    name String
    Name of the dimension.
    value String
    Value of the dimension.

    PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecification, PolicyTargetTrackingScalingPolicyConfigurationPredefinedMetricSpecificationArgs

    PredefinedMetricType string
    Metric type.
    ResourceLabel string
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.
    PredefinedMetricType string
    Metric type.
    ResourceLabel string
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.
    predefinedMetricType String
    Metric type.
    resourceLabel String
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.
    predefinedMetricType string
    Metric type.
    resourceLabel string
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.
    predefined_metric_type str
    Metric type.
    resource_label str
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.
    predefinedMetricType String
    Metric type.
    resourceLabel String
    Reserved for future use if the predefined_metric_type is not ALBRequestCountPerTarget. If the predefined_metric_type is ALBRequestCountPerTarget, you must specify this argument. Documentation can be found at: AWS Predefined Scaling Metric Specification. Must be less than or equal to 1023 characters in length.

    Import

    Using pulumi import, import Application AutoScaling Policy using the service-namespace , resource-id, scalable-dimension and policy-name separated by /. For example:

    $ pulumi import aws:appautoscaling/policy:Policy test-policy service-namespace/resource-id/scalable-dimension/policy-name
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi