import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Resource for managing an AWS Outposts Capacity Task. * * A capacity task redistributes the instance pools available on an Outpost rack or server to match the `instancePool` configuration declared in the resource. Starting a capacity task is a long-running, asynchronous operation — Terraform waits for it to reach a terminal state (`COMPLETED`, `CANCELLED`, or `FAILED`) before finishing the apply. * * Because every argument of this resource is marked as forces-new, any change to the configuration results in destroying and re-creating the capacity task. Tasks that are already in a terminal state (`COMPLETED` or `CANCELLED`) are left in place on destroy and only removed from Terraform state; tasks still in flight are cancelled and Terraform waits for them to reach `CANCELLED`. If a task reaches the terminal state `FAILED` during `delete`, the provider tolerates the "already in a terminal state" error returned by `CancelCapacityTask` and considers the resource successfully destroyed. If a create operation produces a `FAILED` task, the resource is not written to Terraform state (the `failureReason` is surfaced in the diagnostic instead), so no follow-up destroy is required. * * ## Example Usage * * ### Minimal * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.outposts.getOutposts({}); * const exampleCapacityTask = new aws.outposts.CapacityTask("example", { * instancePools: [{ * instanceType: "m5.large", * count: 2, * }], * outpostIdentifier: example.then(example => example.arns?.[0]), * }); * ``` * * ### Multiple instance pools, excluded instances, and a specified blocking-instance action * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.outposts.getAssets({ * arn: "arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef", * }); * const exampleCapacityTask = new aws.outposts.CapacityTask("example", { * instancesToExclude: { * instances: [ * "i-0123456789abcdef0", * "i-0fedcba9876543210", * ], * }, * instancePools: [ * { * instanceType: "m5.large", * count: 4, * }, * { * instanceType: "c5.xlarge", * count: 2, * }, * ], * outpostIdentifier: "op-1234567890abcdef", * taskActionOnBlockingInstances: "WAIT_FOR_EVACUATION", * assetId: example.then(example => example.assetIds?.[0]), * }, { * customTimeouts: { * create: "90m", * "delete": "15m", * }, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `outpostIdentifier` (String) Outpost identifier supplied when the task was created (ID or ARN). * * `capacityTaskId` (String) AWS-assigned capacity task ID. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import a Capacity Task using the same composite ID. For example: * * ```sh * $ pulumi import aws:outposts/capacityTask:CapacityTask example op-1234567890abcdef/cap-1a2b3c4d5e6f7g8h9 * ``` */ export declare class CapacityTask extends pulumi.CustomResource { /** * Get an existing CapacityTask 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, state?: CapacityTaskState, opts?: pulumi.CustomResourceOptions): CapacityTask; /** * Returns true if the given object is an instance of CapacityTask. 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 CapacityTask; /** * ID of a specific Outposts asset (hardware server) to target for the capacity task. If omitted, AWS selects an appropriate asset automatically. Discover valid asset IDs with the `aws.outposts.getAssets` data source. Changing this value forces a new resource. */ readonly assetId: pulumi.Output; /** * ID assigned by AWS to the capacity task (for example, `cap-1a2b3c4d5e6f7g8h9`). */ readonly capacityTaskId: pulumi.Output; /** * RFC 3339 timestamp at which the capacity task reached a terminal state (if any). */ readonly completionDate: pulumi.Output; /** * RFC 3339 timestamp at which the capacity task was created. */ readonly creationDate: pulumi.Output; /** * Human-readable reason reported by AWS when the capacity task failed. `null` unless the terminal state is `FAILED`. */ readonly failureReason: pulumi.Output; /** * One or more `instancePool` blocks defining the desired instance-type layout for the Outpost. See below. At least one block is required. Changing any value forces a new resource. */ readonly instancePools: pulumi.Output; /** * Single `instancesToExclude` block specifying user-owned running instances that must not be stopped to free up capacity. See below. Note: AWS does not return this value via the Get/Describe API; after import, you must add the block back to your configuration manually — see Import. */ readonly instancesToExclude: pulumi.Output; /** * ID of the Amazon Web Services Outposts order associated with the capacity task. Changing this value forces a new resource. */ readonly orderId: pulumi.Output; /** * ID or ARN of the Outpost on which to run the capacity task. Both forms are accepted; the provider normalizes the value internally. Changing this value forces a new resource. */ readonly outpostIdentifier: pulumi.Output; /** * 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; /** * Current status of the capacity task. One of `REQUESTED`, `IN_PROGRESS`, `WAITING_FOR_EVACUATION`, `CANCELLATION_IN_PROGRESS`, `COMPLETED`, `CANCELLED`, or `FAILED`. See the [AWS documentation](https://docs.aws.amazon.com/outposts/latest/APIReference/API_GetCapacityTask.html) for semantics. */ readonly status: pulumi.Output; /** * Action to take if running instances block the capacity task. Valid values are `WAIT_FOR_EVACUATION` and `FAIL_TASK`. Changing this value forces a new resource. */ readonly taskActionOnBlockingInstances: pulumi.Output; /** * Configuration block with timeouts. See below. */ readonly timeouts: pulumi.Output; /** * Create a CapacityTask 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: CapacityTaskArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CapacityTask resources. */ export interface CapacityTaskState { /** * ID of a specific Outposts asset (hardware server) to target for the capacity task. If omitted, AWS selects an appropriate asset automatically. Discover valid asset IDs with the `aws.outposts.getAssets` data source. Changing this value forces a new resource. */ assetId?: pulumi.Input; /** * ID assigned by AWS to the capacity task (for example, `cap-1a2b3c4d5e6f7g8h9`). */ capacityTaskId?: pulumi.Input; /** * RFC 3339 timestamp at which the capacity task reached a terminal state (if any). */ completionDate?: pulumi.Input; /** * RFC 3339 timestamp at which the capacity task was created. */ creationDate?: pulumi.Input; /** * Human-readable reason reported by AWS when the capacity task failed. `null` unless the terminal state is `FAILED`. */ failureReason?: pulumi.Input; /** * One or more `instancePool` blocks defining the desired instance-type layout for the Outpost. See below. At least one block is required. Changing any value forces a new resource. */ instancePools?: pulumi.Input[] | undefined>; /** * Single `instancesToExclude` block specifying user-owned running instances that must not be stopped to free up capacity. See below. Note: AWS does not return this value via the Get/Describe API; after import, you must add the block back to your configuration manually — see Import. */ instancesToExclude?: pulumi.Input; /** * ID of the Amazon Web Services Outposts order associated with the capacity task. Changing this value forces a new resource. */ orderId?: pulumi.Input; /** * ID or ARN of the Outpost on which to run the capacity task. Both forms are accepted; the provider normalizes the value internally. Changing this value forces a new resource. */ outpostIdentifier?: pulumi.Input; /** * 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; /** * Current status of the capacity task. One of `REQUESTED`, `IN_PROGRESS`, `WAITING_FOR_EVACUATION`, `CANCELLATION_IN_PROGRESS`, `COMPLETED`, `CANCELLED`, or `FAILED`. See the [AWS documentation](https://docs.aws.amazon.com/outposts/latest/APIReference/API_GetCapacityTask.html) for semantics. */ status?: pulumi.Input; /** * Action to take if running instances block the capacity task. Valid values are `WAIT_FOR_EVACUATION` and `FAIL_TASK`. Changing this value forces a new resource. */ taskActionOnBlockingInstances?: pulumi.Input; /** * Configuration block with timeouts. See below. */ timeouts?: pulumi.Input; } /** * The set of arguments for constructing a CapacityTask resource. */ export interface CapacityTaskArgs { /** * ID of a specific Outposts asset (hardware server) to target for the capacity task. If omitted, AWS selects an appropriate asset automatically. Discover valid asset IDs with the `aws.outposts.getAssets` data source. Changing this value forces a new resource. */ assetId?: pulumi.Input; /** * One or more `instancePool` blocks defining the desired instance-type layout for the Outpost. See below. At least one block is required. Changing any value forces a new resource. */ instancePools?: pulumi.Input[] | undefined>; /** * Single `instancesToExclude` block specifying user-owned running instances that must not be stopped to free up capacity. See below. Note: AWS does not return this value via the Get/Describe API; after import, you must add the block back to your configuration manually — see Import. */ instancesToExclude?: pulumi.Input; /** * ID of the Amazon Web Services Outposts order associated with the capacity task. Changing this value forces a new resource. */ orderId?: pulumi.Input; /** * ID or ARN of the Outpost on which to run the capacity task. Both forms are accepted; the provider normalizes the value internally. Changing this value forces a new resource. */ outpostIdentifier: pulumi.Input; /** * 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; /** * Action to take if running instances block the capacity task. Valid values are `WAIT_FOR_EVACUATION` and `FAIL_TASK`. Changing this value forces a new resource. */ taskActionOnBlockingInstances?: pulumi.Input; /** * Configuration block with timeouts. See below. */ timeouts?: pulumi.Input; } //# sourceMappingURL=capacityTask.d.ts.map