@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
142 lines • 7.43 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaskSet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an ECS task set - effectively a task that is expected to run until an error occurs or a user terminates it (typically a webserver or a database).
*
* See [ECS Task Set section in AWS developer guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-external.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ecs.TaskSet("example", {
* service: exampleAwsEcsService.id,
* cluster: exampleAwsEcsCluster.id,
* taskDefinition: exampleAwsEcsTaskDefinition.arn,
* loadBalancers: [{
* targetGroupArn: exampleAwsLbTargetGroup.arn,
* containerName: "mongo",
* containerPort: 8080,
* }],
* });
* ```
*
* ### Ignoring Changes to Scale
*
* You can utilize the generic resource lifecycle configuration block with `ignoreChanges` to create an ECS service with an initial count of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling).
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ecs.TaskSet("example", {scale: {
* value: 50,
* }});
* ```
*
* ## Import
*
* Using `pulumi import`, import ECS Task Sets using the `task_set_id`, `service`, and `cluster` separated by commas (`,`). For example:
*
* ```sh
* $ pulumi import aws:ecs/taskSet:TaskSet example ecs-svc/7177320696926227436,arn:aws:ecs:us-west-2:123456789101:service/example/example-1234567890,arn:aws:ecs:us-west-2:123456789101:cluster/example
* ```
*/
class TaskSet extends pulumi.CustomResource {
/**
* Get an existing TaskSet 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, id, state, opts) {
return new TaskSet(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TaskSet. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === TaskSet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["capacityProviderStrategies"] = state ? state.capacityProviderStrategies : undefined;
resourceInputs["cluster"] = state ? state.cluster : undefined;
resourceInputs["externalId"] = state ? state.externalId : undefined;
resourceInputs["forceDelete"] = state ? state.forceDelete : undefined;
resourceInputs["launchType"] = state ? state.launchType : undefined;
resourceInputs["loadBalancers"] = state ? state.loadBalancers : undefined;
resourceInputs["networkConfiguration"] = state ? state.networkConfiguration : undefined;
resourceInputs["platformVersion"] = state ? state.platformVersion : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["scale"] = state ? state.scale : undefined;
resourceInputs["service"] = state ? state.service : undefined;
resourceInputs["serviceRegistries"] = state ? state.serviceRegistries : undefined;
resourceInputs["stabilityStatus"] = state ? state.stabilityStatus : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["taskDefinition"] = state ? state.taskDefinition : undefined;
resourceInputs["taskSetId"] = state ? state.taskSetId : undefined;
resourceInputs["waitUntilStable"] = state ? state.waitUntilStable : undefined;
resourceInputs["waitUntilStableTimeout"] = state ? state.waitUntilStableTimeout : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cluster === undefined) && !opts.urn) {
throw new Error("Missing required property 'cluster'");
}
if ((!args || args.service === undefined) && !opts.urn) {
throw new Error("Missing required property 'service'");
}
if ((!args || args.taskDefinition === undefined) && !opts.urn) {
throw new Error("Missing required property 'taskDefinition'");
}
resourceInputs["capacityProviderStrategies"] = args ? args.capacityProviderStrategies : undefined;
resourceInputs["cluster"] = args ? args.cluster : undefined;
resourceInputs["externalId"] = args ? args.externalId : undefined;
resourceInputs["forceDelete"] = args ? args.forceDelete : undefined;
resourceInputs["launchType"] = args ? args.launchType : undefined;
resourceInputs["loadBalancers"] = args ? args.loadBalancers : undefined;
resourceInputs["networkConfiguration"] = args ? args.networkConfiguration : undefined;
resourceInputs["platformVersion"] = args ? args.platformVersion : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["scale"] = args ? args.scale : undefined;
resourceInputs["service"] = args ? args.service : undefined;
resourceInputs["serviceRegistries"] = args ? args.serviceRegistries : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["taskDefinition"] = args ? args.taskDefinition : undefined;
resourceInputs["waitUntilStable"] = args ? args.waitUntilStable : undefined;
resourceInputs["waitUntilStableTimeout"] = args ? args.waitUntilStableTimeout : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["stabilityStatus"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["taskSetId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TaskSet.__pulumiType, name, resourceInputs, opts);
}
}
exports.TaskSet = TaskSet;
/** @internal */
TaskSet.__pulumiType = 'aws:ecs/taskSet:TaskSet';
//# sourceMappingURL=taskSet.js.map