@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 5.39 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.InstanceFleet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Elastic MapReduce Cluster Instance Fleet configuration.
* See [Amazon Elastic MapReduce Documentation](https://aws.amazon.com/documentation/emr/) for more information.
*
* > **NOTE:** At this time, Instance Fleets cannot be destroyed through the API nor
* web interface. Instance Fleets are destroyed when the EMR Cluster is destroyed.
* the provider will resize any Instance Fleet 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.InstanceFleet("task", {
* clusterId: cluster.id,
* instanceTypeConfigs: [
* {
* bidPriceAsPercentageOfOnDemandPrice: 100,
* ebsConfigs: [{
* size: 100,
* type: "gp2",
* volumesPerInstance: 1,
* }],
* instanceType: "m4.xlarge",
* weightedCapacity: 1,
* },
* {
* bidPriceAsPercentageOfOnDemandPrice: 100,
* ebsConfigs: [{
* size: 100,
* type: "gp2",
* volumesPerInstance: 1,
* }],
* instanceType: "m4.2xlarge",
* weightedCapacity: 2,
* },
* ],
* launchSpecifications: {
* spotSpecifications: [{
* allocationStrategy: "capacity-optimized",
* blockDurationMinutes: 0,
* timeoutAction: "TERMINATE_CLUSTER",
* timeoutDurationMinutes: 10,
* }],
* },
* name: "task fleet",
* targetOnDemandCapacity: 1,
* targetSpotCapacity: 1,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import EMR Instance Fleet using the EMR Cluster identifier and Instance Fleet identifier separated by a forward slash (`/`). For example:
*
* ```sh
* $ pulumi import aws:emr/instanceFleet:InstanceFleet example j-123456ABCDEF/if-15EK4O09RZLNR
* ```
*/
class InstanceFleet extends pulumi.CustomResource {
/**
* Get an existing InstanceFleet 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 InstanceFleet(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of InstanceFleet. 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'] === InstanceFleet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusterId"] = state?.clusterId;
resourceInputs["instanceTypeConfigs"] = state?.instanceTypeConfigs;
resourceInputs["launchSpecifications"] = state?.launchSpecifications;
resourceInputs["name"] = state?.name;
resourceInputs["provisionedOnDemandCapacity"] = state?.provisionedOnDemandCapacity;
resourceInputs["provisionedSpotCapacity"] = state?.provisionedSpotCapacity;
resourceInputs["region"] = state?.region;
resourceInputs["targetOnDemandCapacity"] = state?.targetOnDemandCapacity;
resourceInputs["targetSpotCapacity"] = state?.targetSpotCapacity;
}
else {
const args = argsOrState;
if (args?.clusterId === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
resourceInputs["clusterId"] = args?.clusterId;
resourceInputs["instanceTypeConfigs"] = args?.instanceTypeConfigs;
resourceInputs["launchSpecifications"] = args?.launchSpecifications;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["targetOnDemandCapacity"] = args?.targetOnDemandCapacity;
resourceInputs["targetSpotCapacity"] = args?.targetSpotCapacity;
resourceInputs["provisionedOnDemandCapacity"] = undefined /*out*/;
resourceInputs["provisionedSpotCapacity"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceFleet.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceFleet = InstanceFleet;
/** @internal */
InstanceFleet.__pulumiType = 'aws:emr/instanceFleet:InstanceFleet';
//# sourceMappingURL=instanceFleet.js.map
;