@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
142 lines • 6.68 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, { ...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?.arn;
resourceInputs["capacityProviderStrategies"] = state?.capacityProviderStrategies;
resourceInputs["cluster"] = state?.cluster;
resourceInputs["externalId"] = state?.externalId;
resourceInputs["forceDelete"] = state?.forceDelete;
resourceInputs["launchType"] = state?.launchType;
resourceInputs["loadBalancers"] = state?.loadBalancers;
resourceInputs["networkConfiguration"] = state?.networkConfiguration;
resourceInputs["platformVersion"] = state?.platformVersion;
resourceInputs["region"] = state?.region;
resourceInputs["scale"] = state?.scale;
resourceInputs["service"] = state?.service;
resourceInputs["serviceRegistries"] = state?.serviceRegistries;
resourceInputs["stabilityStatus"] = state?.stabilityStatus;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["taskDefinition"] = state?.taskDefinition;
resourceInputs["taskSetId"] = state?.taskSetId;
resourceInputs["waitUntilStable"] = state?.waitUntilStable;
resourceInputs["waitUntilStableTimeout"] = state?.waitUntilStableTimeout;
}
else {
const args = argsOrState;
if (args?.cluster === undefined && !opts.urn) {
throw new Error("Missing required property 'cluster'");
}
if (args?.service === undefined && !opts.urn) {
throw new Error("Missing required property 'service'");
}
if (args?.taskDefinition === undefined && !opts.urn) {
throw new Error("Missing required property 'taskDefinition'");
}
resourceInputs["capacityProviderStrategies"] = args?.capacityProviderStrategies;
resourceInputs["cluster"] = args?.cluster;
resourceInputs["externalId"] = args?.externalId;
resourceInputs["forceDelete"] = args?.forceDelete;
resourceInputs["launchType"] = args?.launchType;
resourceInputs["loadBalancers"] = args?.loadBalancers;
resourceInputs["networkConfiguration"] = args?.networkConfiguration;
resourceInputs["platformVersion"] = args?.platformVersion;
resourceInputs["region"] = args?.region;
resourceInputs["scale"] = args?.scale;
resourceInputs["service"] = args?.service;
resourceInputs["serviceRegistries"] = args?.serviceRegistries;
resourceInputs["tags"] = args?.tags;
resourceInputs["taskDefinition"] = args?.taskDefinition;
resourceInputs["waitUntilStable"] = args?.waitUntilStable;
resourceInputs["waitUntilStableTimeout"] = args?.waitUntilStableTimeout;
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
;