1. Packages
  2. AWS Classic
  3. API Docs
  4. appautoscaling
  5. Target

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

aws.appautoscaling.Target

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

    Provides an Application AutoScaling ScalableTarget resource. To manage policies which get attached to the target, see the aws.appautoscaling.Policy resource.

    NOTE: Scalable targets created before 2023-03-20 may not have an assigned arn. These resource cannot use tags or participate in default_tags. To prevent pulumi preview showing differences that can never be reconciled, use the lifecycle.ignore_changes meta-argument. See the example below.

    NOTE: The Application Auto Scaling service automatically attempts to manage IAM Service-Linked Roles when registering certain service namespaces for the first time. To manually manage this role, see the aws.iam.ServiceLinkedRole 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/${example.name}`,
        scalableDimension: "dynamodb:table:ReadCapacityUnits",
        serviceNamespace: "dynamodb",
    });
    
    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=f"table/{example['name']}",
        scalable_dimension="dynamodb:table:ReadCapacityUnits",
        service_namespace="dynamodb")
    
    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 {
    		_, err := appautoscaling.NewTarget(ctx, "dynamodb_table_read_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(100),
    			MinCapacity:       pulumi.Int(5),
    			ResourceId:        pulumi.String(fmt.Sprintf("table/%v", example.Name)),
    			ScalableDimension: pulumi.String("dynamodb:table:ReadCapacityUnits"),
    			ServiceNamespace:  pulumi.String("dynamodb"),
    		})
    		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/{example.Name}",
            ScalableDimension = "dynamodb:table:ReadCapacityUnits",
            ServiceNamespace = "dynamodb",
        });
    
    });
    
    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 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(String.format("table/%s", example.name()))
                .scalableDimension("dynamodb:table:ReadCapacityUnits")
                .serviceNamespace("dynamodb")
                .build());
    
        }
    }
    
    resources:
      dynamodbTableReadTarget:
        type: aws:appautoscaling:Target
        name: dynamodb_table_read_target
        properties:
          maxCapacity: 100
          minCapacity: 5
          resourceId: table/${example.name}
          scalableDimension: dynamodb:table:ReadCapacityUnits
          serviceNamespace: dynamodb
    

    DynamoDB Index Autoscaling

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const dynamodbIndexReadTarget = new aws.appautoscaling.Target("dynamodb_index_read_target", {
        maxCapacity: 100,
        minCapacity: 5,
        resourceId: `table/${example.name}/index/${indexName}`,
        scalableDimension: "dynamodb:index:ReadCapacityUnits",
        serviceNamespace: "dynamodb",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    dynamodb_index_read_target = aws.appautoscaling.Target("dynamodb_index_read_target",
        max_capacity=100,
        min_capacity=5,
        resource_id=f"table/{example['name']}/index/{index_name}",
        scalable_dimension="dynamodb:index:ReadCapacityUnits",
        service_namespace="dynamodb")
    
    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 {
    		_, err := appautoscaling.NewTarget(ctx, "dynamodb_index_read_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(100),
    			MinCapacity:       pulumi.Int(5),
    			ResourceId:        pulumi.String(fmt.Sprintf("table/%v/index/%v", example.Name, indexName)),
    			ScalableDimension: pulumi.String("dynamodb:index:ReadCapacityUnits"),
    			ServiceNamespace:  pulumi.String("dynamodb"),
    		})
    		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 dynamodbIndexReadTarget = new Aws.AppAutoScaling.Target("dynamodb_index_read_target", new()
        {
            MaxCapacity = 100,
            MinCapacity = 5,
            ResourceId = $"table/{example.Name}/index/{indexName}",
            ScalableDimension = "dynamodb:index:ReadCapacityUnits",
            ServiceNamespace = "dynamodb",
        });
    
    });
    
    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 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 dynamodbIndexReadTarget = new Target("dynamodbIndexReadTarget", TargetArgs.builder()        
                .maxCapacity(100)
                .minCapacity(5)
                .resourceId(String.format("table/%s/index/%s", example.name(),indexName))
                .scalableDimension("dynamodb:index:ReadCapacityUnits")
                .serviceNamespace("dynamodb")
                .build());
    
        }
    }
    
    resources:
      dynamodbIndexReadTarget:
        type: aws:appautoscaling:Target
        name: dynamodb_index_read_target
        properties:
          maxCapacity: 100
          minCapacity: 5
          resourceId: table/${example.name}/index/${indexName}
          scalableDimension: dynamodb:index:ReadCapacityUnits
          serviceNamespace: dynamodb
    

    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/${example.name}/${exampleAwsEcsService.name}`,
        scalableDimension: "ecs:service:DesiredCount",
        serviceNamespace: "ecs",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_target = aws.appautoscaling.Target("ecs_target",
        max_capacity=4,
        min_capacity=1,
        resource_id=f"service/{example['name']}/{example_aws_ecs_service['name']}",
        scalable_dimension="ecs:service:DesiredCount",
        service_namespace="ecs")
    
    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 {
    		_, err := appautoscaling.NewTarget(ctx, "ecs_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(4),
    			MinCapacity:       pulumi.Int(1),
    			ResourceId:        pulumi.String(fmt.Sprintf("service/%v/%v", example.Name, exampleAwsEcsService.Name)),
    			ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
    			ServiceNamespace:  pulumi.String("ecs"),
    		})
    		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/{example.Name}/{exampleAwsEcsService.Name}",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
    
    });
    
    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 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(String.format("service/%s/%s", example.name(),exampleAwsEcsService.name()))
                .scalableDimension("ecs:service:DesiredCount")
                .serviceNamespace("ecs")
                .build());
    
        }
    }
    
    resources:
      ecsTarget:
        type: aws:appautoscaling:Target
        name: ecs_target
        properties:
          maxCapacity: 4
          minCapacity: 1
          resourceId: service/${example.name}/${exampleAwsEcsService.name}
          scalableDimension: ecs:service:DesiredCount
          serviceNamespace: ecs
    

    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,
    });
    
    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)
    
    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 {
    		_, err := appautoscaling.NewTarget(ctx, "replicas", &appautoscaling.TargetArgs{
    			ServiceNamespace:  pulumi.String("rds"),
    			ScalableDimension: pulumi.String("rds:cluster:ReadReplicaCount"),
    			ResourceId:        pulumi.String(fmt.Sprintf("cluster:%v", example.Id)),
    			MinCapacity:       pulumi.Int(1),
    			MaxCapacity:       pulumi.Int(15),
    		})
    		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,
        });
    
    });
    
    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 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());
    
        }
    }
    
    resources:
      replicas:
        type: aws:appautoscaling:Target
        properties:
          serviceNamespace: rds
          scalableDimension: rds:cluster:ReadReplicaCount
          resourceId: cluster:${example.id}
          minCapacity: 1
          maxCapacity: 15
    

    Suppressing tags_all Differences For Older Resources

    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/${example.name}/${exampleAwsEcsService.name}`,
        scalableDimension: "ecs:service:DesiredCount",
        serviceNamespace: "ecs",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_target = aws.appautoscaling.Target("ecs_target",
        max_capacity=4,
        min_capacity=1,
        resource_id=f"service/{example['name']}/{example_aws_ecs_service['name']}",
        scalable_dimension="ecs:service:DesiredCount",
        service_namespace="ecs")
    
    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 {
    		_, err := appautoscaling.NewTarget(ctx, "ecs_target", &appautoscaling.TargetArgs{
    			MaxCapacity:       pulumi.Int(4),
    			MinCapacity:       pulumi.Int(1),
    			ResourceId:        pulumi.String(fmt.Sprintf("service/%v/%v", example.Name, exampleAwsEcsService.Name)),
    			ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
    			ServiceNamespace:  pulumi.String("ecs"),
    		})
    		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/{example.Name}/{exampleAwsEcsService.Name}",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
    
    });
    
    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 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(String.format("service/%s/%s", example.name(),exampleAwsEcsService.name()))
                .scalableDimension("ecs:service:DesiredCount")
                .serviceNamespace("ecs")
                .build());
    
        }
    }
    
    resources:
      ecsTarget:
        type: aws:appautoscaling:Target
        name: ecs_target
        properties:
          maxCapacity: 4
          minCapacity: 1
          resourceId: service/${example.name}/${exampleAwsEcsService.name}
          scalableDimension: ecs:service:DesiredCount
          serviceNamespace: ecs
    

    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,
    });
    
    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)
    
    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.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
    		}
    		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,
        });
    
    });
    
    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 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());
    
        }
    }
    
    resources:
      mskTarget:
        type: aws:appautoscaling:Target
        name: msk_target
        properties:
          serviceNamespace: kafka
          scalableDimension: kafka:broker-storage:VolumeSize
          resourceId: ${example.arn}
          minCapacity: 1
          maxCapacity: 8
    

    Create Target Resource

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

    Constructor syntax

    new Target(name: string, args: TargetArgs, opts?: CustomResourceOptions);
    @overload
    def Target(resource_name: str,
               args: TargetArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Target(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               max_capacity: Optional[int] = None,
               min_capacity: Optional[int] = None,
               resource_id: Optional[str] = None,
               scalable_dimension: Optional[str] = None,
               service_namespace: Optional[str] = None,
               role_arn: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
    func NewTarget(ctx *Context, name string, args TargetArgs, opts ...ResourceOption) (*Target, error)
    public Target(string name, TargetArgs args, CustomResourceOptions? opts = null)
    public Target(String name, TargetArgs args)
    public Target(String name, TargetArgs args, CustomResourceOptions options)
    
    type: aws:appautoscaling:Target
    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 TargetArgs
    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 TargetArgs
    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 TargetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TargetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TargetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var targetResource = new Aws.AppAutoScaling.Target("targetResource", new()
    {
        MaxCapacity = 0,
        MinCapacity = 0,
        ResourceId = "string",
        ScalableDimension = "string",
        ServiceNamespace = "string",
        RoleArn = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := appautoscaling.NewTarget(ctx, "targetResource", &appautoscaling.TargetArgs{
    	MaxCapacity:       pulumi.Int(0),
    	MinCapacity:       pulumi.Int(0),
    	ResourceId:        pulumi.String("string"),
    	ScalableDimension: pulumi.String("string"),
    	ServiceNamespace:  pulumi.String("string"),
    	RoleArn:           pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var targetResource = new Target("targetResource", TargetArgs.builder()        
        .maxCapacity(0)
        .minCapacity(0)
        .resourceId("string")
        .scalableDimension("string")
        .serviceNamespace("string")
        .roleArn("string")
        .tags(Map.of("string", "string"))
        .build());
    
    target_resource = aws.appautoscaling.Target("targetResource",
        max_capacity=0,
        min_capacity=0,
        resource_id="string",
        scalable_dimension="string",
        service_namespace="string",
        role_arn="string",
        tags={
            "string": "string",
        })
    
    const targetResource = new aws.appautoscaling.Target("targetResource", {
        maxCapacity: 0,
        minCapacity: 0,
        resourceId: "string",
        scalableDimension: "string",
        serviceNamespace: "string",
        roleArn: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:appautoscaling:Target
    properties:
        maxCapacity: 0
        minCapacity: 0
        resourceId: string
        roleArn: string
        scalableDimension: string
        serviceNamespace: string
        tags:
            string: string
    

    Target Resource Properties

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

    Inputs

    The Target resource accepts the following input properties:

    MaxCapacity int
    Max capacity of the scalable target.
    MinCapacity int
    Min capacity of the scalable target.
    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
    RoleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    Tags Dictionary<string, string>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    MaxCapacity int
    Max capacity of the scalable target.
    MinCapacity int
    Min capacity of the scalable target.
    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
    RoleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    Tags map[string]string
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    maxCapacity Integer
    Max capacity of the scalable target.
    minCapacity Integer
    Min capacity of the scalable target.
    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
    roleArn String
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    tags Map<String,String>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    maxCapacity number
    Max capacity of the scalable target.
    minCapacity number
    Min capacity of the scalable target.
    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
    roleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    tags {[key: string]: string}
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    max_capacity int
    Max capacity of the scalable target.
    min_capacity int
    Min capacity of the scalable target.
    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
    role_arn str
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    tags Mapping[str, str]
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    maxCapacity Number
    Max capacity of the scalable target.
    minCapacity Number
    Min capacity of the scalable target.
    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
    roleArn String
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    tags Map<String>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

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

    Arn string
    The ARN of the scalable target.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    The ARN of the scalable target.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the scalable target.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    The ARN of the scalable target.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    The ARN of the scalable target.
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the scalable target.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up Existing Target Resource

    Get an existing Target 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?: TargetState, opts?: CustomResourceOptions): Target
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            max_capacity: Optional[int] = None,
            min_capacity: Optional[int] = None,
            resource_id: Optional[str] = None,
            role_arn: Optional[str] = None,
            scalable_dimension: Optional[str] = None,
            service_namespace: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> Target
    func GetTarget(ctx *Context, name string, id IDInput, state *TargetState, opts ...ResourceOption) (*Target, error)
    public static Target Get(string name, Input<string> id, TargetState? state, CustomResourceOptions? opts = null)
    public static Target get(String name, Output<String> id, TargetState 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:
    Arn string
    The ARN of the scalable target.
    MaxCapacity int
    Max capacity of the scalable target.
    MinCapacity int
    Min capacity of the scalable target.
    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
    RoleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    Tags Dictionary<string, string>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    The ARN of the scalable target.
    MaxCapacity int
    Max capacity of the scalable target.
    MinCapacity int
    Min capacity of the scalable target.
    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
    RoleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    Tags map[string]string
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the scalable target.
    maxCapacity Integer
    Max capacity of the scalable target.
    minCapacity Integer
    Min capacity of the scalable target.
    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
    roleArn String
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    tags Map<String,String>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    The ARN of the scalable target.
    maxCapacity number
    Max capacity of the scalable target.
    minCapacity number
    Min capacity of the scalable target.
    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
    roleArn string
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    tags {[key: string]: string}
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    The ARN of the scalable target.
    max_capacity int
    Max capacity of the scalable target.
    min_capacity int
    Min capacity of the scalable target.
    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
    role_arn str
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    tags Mapping[str, str]
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the scalable target.
    maxCapacity Number
    Max capacity of the scalable target.
    minCapacity Number
    Min capacity of the scalable target.
    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
    roleArn String
    ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role for most services and custom IAM Roles are ignored by the API for those namespaces. See the AWS Application Auto Scaling documentation for more information about how this service interacts with IAM.
    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
    tags Map<String>
    Map of tags to assign to the scalable target. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Import

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

    $ pulumi import aws:appautoscaling/target:Target test-target service-namespace/resource-id/scalable-dimension
    

    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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi