@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
107 lines • 5.28 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.InstanceGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Elastic MapReduce Cluster Instance Group configuration.
* See [Amazon Elastic MapReduce Documentation](https://aws.amazon.com/documentation/emr/) for more information.
*
* > **NOTE:** At this time, Instance Groups cannot be destroyed through the API nor
* web interface. Instance Groups are destroyed when the EMR Cluster is destroyed.
* this provider will resize any Instance Group to zero when destroying the resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const task = new aws.emr.InstanceGroup("task", {
* clusterId: tf_test_cluster.id,
* instanceCount: 1,
* instanceType: "m5.xlarge",
* name: "my little instance group",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import EMR task instance group using their EMR Cluster id and Instance Group id separated by a forward-slash `/`. For example:
*
* ```sh
* $ pulumi import aws:emr/instanceGroup:InstanceGroup task_group j-123456ABCDEF/ig-15EK4O09RZLNR
* ```
*/
class InstanceGroup extends pulumi.CustomResource {
/**
* Get an existing InstanceGroup 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 InstanceGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InstanceGroup. 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'] === InstanceGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoscalingPolicy"] = state ? state.autoscalingPolicy : undefined;
resourceInputs["bidPrice"] = state ? state.bidPrice : undefined;
resourceInputs["clusterId"] = state ? state.clusterId : undefined;
resourceInputs["configurationsJson"] = state ? state.configurationsJson : undefined;
resourceInputs["ebsConfigs"] = state ? state.ebsConfigs : undefined;
resourceInputs["ebsOptimized"] = state ? state.ebsOptimized : undefined;
resourceInputs["instanceCount"] = state ? state.instanceCount : undefined;
resourceInputs["instanceType"] = state ? state.instanceType : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["runningInstanceCount"] = state ? state.runningInstanceCount : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.clusterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
if ((!args || args.instanceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceType'");
}
resourceInputs["autoscalingPolicy"] = args ? args.autoscalingPolicy : undefined;
resourceInputs["bidPrice"] = args ? args.bidPrice : undefined;
resourceInputs["clusterId"] = args ? args.clusterId : undefined;
resourceInputs["configurationsJson"] = args ? args.configurationsJson : undefined;
resourceInputs["ebsConfigs"] = args ? args.ebsConfigs : undefined;
resourceInputs["ebsOptimized"] = args ? args.ebsOptimized : undefined;
resourceInputs["instanceCount"] = args ? args.instanceCount : undefined;
resourceInputs["instanceType"] = args ? args.instanceType : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["runningInstanceCount"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceGroup = InstanceGroup;
/** @internal */
InstanceGroup.__pulumiType = 'aws:emr/instanceGroup:InstanceGroup';
//# sourceMappingURL=instanceGroup.js.map