Show / Hide Table of Contents

Class Target

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

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var dynamodbTableReadTarget = new Aws.AppAutoScaling.Target("dynamodbTableReadTarget", new Aws.AppAutoScaling.TargetArgs
    {
        MaxCapacity = 100,
        MinCapacity = 5,
        ResourceId = $"table/{aws_dynamodb_table.Example.Name}",
        ScalableDimension = "dynamodb:table:ReadCapacityUnits",
        ServiceNamespace = "dynamodb",
    });
}

}

DynamoDB Index Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var dynamodbIndexReadTarget = new Aws.AppAutoScaling.Target("dynamodbIndexReadTarget", new Aws.AppAutoScaling.TargetArgs
    {
        MaxCapacity = 100,
        MinCapacity = 5,
        ResourceId = $"table/{aws_dynamodb_table.Example.Name}/index/{@var.Index_name}",
        ScalableDimension = "dynamodb:index:ReadCapacityUnits",
        ServiceNamespace = "dynamodb",
    });
}

}

ECS Service Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var ecsTarget = new Aws.AppAutoScaling.Target("ecsTarget", new Aws.AppAutoScaling.TargetArgs
    {
        MaxCapacity = 4,
        MinCapacity = 1,
        ResourceId = $"service/{aws_ecs_cluster.Example.Name}/{aws_ecs_service.Example.Name}",
        ScalableDimension = "ecs:service:DesiredCount",
        ServiceNamespace = "ecs",
    });
}

}

Aurora Read Replica Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var replicas = new Aws.AppAutoScaling.Target("replicas", new Aws.AppAutoScaling.TargetArgs
    {
        MaxCapacity = 15,
        MinCapacity = 1,
        ResourceId = $"cluster:{aws_rds_cluster.Example.Id}",
        ScalableDimension = "rds:cluster:ReadReplicaCount",
        ServiceNamespace = "rds",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Target
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.AppAutoScaling
Assembly: Pulumi.Aws.dll
Syntax
public class Target : CustomResource

Constructors

View Source

Target(String, TargetArgs, CustomResourceOptions)

Create a Target resource with the given unique name, arguments, and options.

Declaration
public Target(string name, TargetArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

TargetArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

MaxCapacity

The max capacity of the scalable target.

Declaration
public Output<int> MaxCapacity { get; }
Property Value
Type Description
Output<System.Int32>
View Source

MinCapacity

The min capacity of the scalable target.

Declaration
public Output<int> MinCapacity { get; }
Property Value
Type Description
Output<System.Int32>
View Source

ResourceId

The 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

Declaration
public Output<string> ResourceId { get; }
Property Value
Type Description
Output<System.String>
View Source

RoleArn

The 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.

Declaration
public Output<string> RoleArn { get; }
Property Value
Type Description
Output<System.String>
View Source

ScalableDimension

The scalable dimension of the scalable target. Documentation can be found in the ScalableDimension parameter at: AWS Application Auto Scaling API Reference

Declaration
public Output<string> ScalableDimension { get; }
Property Value
Type Description
Output<System.String>
View Source

ServiceNamespace

The AWS service namespace of the scalable target. Documentation can be found in the ServiceNamespace parameter at: AWS Application Auto Scaling API Reference

Declaration
public Output<string> ServiceNamespace { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, TargetState, CustomResourceOptions)

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

Declaration
public static Target Get(string name, Input<string> id, TargetState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

TargetState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Target
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.