UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

280 lines (279 loc) • 14 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 `defaultTags`. 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](https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-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 * * ```typescript * 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", * }); * ``` * * ### DynamoDB Index Autoscaling * * ```typescript * 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", * }); * ``` * * ### ECS Service Autoscaling * * ```typescript * 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", * }); * ``` * * ### Aurora Read Replica Autoscaling * * ```typescript * 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, * }); * ``` * * ### Suppressing `tagsAll` Differences For Older Resources * * ```typescript * 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", * }); * ``` * * ### MSK / Kafka Autoscaling * * ```typescript * 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 * * Using `pulumi import`, import Application AutoScaling Target using the `service-namespace` , `resource-id` and `scalable-dimension` separated by `/`. For example: * * ```sh * $ pulumi import aws:appautoscaling/target:Target test-target service-namespace/resource-id/scalable-dimension * ``` */ export declare class Target extends pulumi.CustomResource { /** * Get an existing Target resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetState, opts?: pulumi.CustomResourceOptions): Target; /** * Returns true if the given object is an instance of Target. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Target; /** * The ARN of the scalable target. */ readonly arn: pulumi.Output<string>; /** * Max capacity of the scalable target. */ readonly maxCapacity: pulumi.Output<number>; /** * Min capacity of the scalable target. */ readonly minCapacity: pulumi.Output<number>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<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](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ readonly resourceId: pulumi.Output<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](https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-roles) for more information about how this service interacts with IAM. */ readonly roleArn: pulumi.Output<string>; /** * Scalable dimension of the scalable target. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ readonly scalableDimension: pulumi.Output<string>; /** * AWS service namespace of the scalable target. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ readonly serviceNamespace: pulumi.Output<string>; /** * Specifies whether the scaling activities for a scalable target are in a suspended state. */ readonly suspendedState: pulumi.Output<outputs.appautoscaling.TargetSuspendedState>; /** * Map of tags to assign to the scalable target. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * Create a Target resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TargetArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Target resources. */ export interface TargetState { /** * The ARN of the scalable target. */ arn?: pulumi.Input<string>; /** * Max capacity of the scalable target. */ maxCapacity?: pulumi.Input<number>; /** * Min capacity of the scalable target. */ minCapacity?: pulumi.Input<number>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<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](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ resourceId?: pulumi.Input<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](https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-roles) for more information about how this service interacts with IAM. */ roleArn?: pulumi.Input<string>; /** * Scalable dimension of the scalable target. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ scalableDimension?: pulumi.Input<string>; /** * AWS service namespace of the scalable target. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ serviceNamespace?: pulumi.Input<string>; /** * Specifies whether the scaling activities for a scalable target are in a suspended state. */ suspendedState?: pulumi.Input<inputs.appautoscaling.TargetSuspendedState>; /** * Map of tags to assign to the scalable target. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; } /** * The set of arguments for constructing a Target resource. */ export interface TargetArgs { /** * Max capacity of the scalable target. */ maxCapacity: pulumi.Input<number>; /** * Min capacity of the scalable target. */ minCapacity: pulumi.Input<number>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<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](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ resourceId: pulumi.Input<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](https://docs.aws.amazon.com/autoscaling/application/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-roles) for more information about how this service interacts with IAM. */ roleArn?: pulumi.Input<string>; /** * Scalable dimension of the scalable target. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ scalableDimension: pulumi.Input<string>; /** * AWS service namespace of the scalable target. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) */ serviceNamespace: pulumi.Input<string>; /** * Specifies whether the scaling activities for a scalable target are in a suspended state. */ suspendedState?: pulumi.Input<inputs.appautoscaling.TargetSuspendedState>; /** * Map of tags to assign to the scalable target. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }