@cuemby/equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
113 lines • 5.32 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetalSpotMarketRequest = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides an Equinix Metal Spot Market Request resource to allow you to
* manage spot market requests on your account. For more detail on Spot Market,
* see [this article in Equinix Metal documentation](https://metal.equinix.com/developers/docs/deploy/spot-market/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@cuemby/equinix";
*
* // Create a spot market request
* const req = new equinix.MetalSpotMarketRequest("req", {
* projectId: local.project_id,
* maxBidPrice: 0.03,
* facilities: ["ny5"],
* devicesMin: 1,
* devicesMax: 1,
* instanceParameters: {
* hostname: "testspot",
* billingCycle: "hourly",
* operatingSystem: "ubuntu_20_04",
* plan: "c3.small.x86",
* },
* });
* ```
*
* ## Import
*
* This resource can be imported using an existing spot market request ID
*
* ```sh
* $ pulumi import equinix:index/metalSpotMarketRequest:MetalSpotMarketRequest equinix_metal_spot_market_request {existing_spot_market_request_id}
* ```
*/
class MetalSpotMarketRequest extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["devicesMax"] = state ? state.devicesMax : undefined;
resourceInputs["devicesMin"] = state ? state.devicesMin : undefined;
resourceInputs["facilities"] = state ? state.facilities : undefined;
resourceInputs["instanceParameters"] = state ? state.instanceParameters : undefined;
resourceInputs["maxBidPrice"] = state ? state.maxBidPrice : undefined;
resourceInputs["metro"] = state ? state.metro : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["waitForDevices"] = state ? state.waitForDevices : undefined;
}
else {
const args = argsOrState;
if ((!args || args.devicesMax === undefined) && !opts.urn) {
throw new Error("Missing required property 'devicesMax'");
}
if ((!args || args.devicesMin === undefined) && !opts.urn) {
throw new Error("Missing required property 'devicesMin'");
}
if ((!args || args.instanceParameters === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceParameters'");
}
if ((!args || args.maxBidPrice === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxBidPrice'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
resourceInputs["devicesMax"] = args ? args.devicesMax : undefined;
resourceInputs["devicesMin"] = args ? args.devicesMin : undefined;
resourceInputs["facilities"] = args ? args.facilities : undefined;
resourceInputs["instanceParameters"] = args ? args.instanceParameters : undefined;
resourceInputs["maxBidPrice"] = args ? args.maxBidPrice : undefined;
resourceInputs["metro"] = args ? args.metro : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["waitForDevices"] = args ? args.waitForDevices : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetalSpotMarketRequest.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing MetalSpotMarketRequest 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 MetalSpotMarketRequest(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetalSpotMarketRequest. 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'] === MetalSpotMarketRequest.__pulumiType;
}
}
exports.MetalSpotMarketRequest = MetalSpotMarketRequest;
/** @internal */
MetalSpotMarketRequest.__pulumiType = 'equinix:index/metalSpotMarketRequest:MetalSpotMarketRequest';
//# sourceMappingURL=metalSpotMarketRequest.js.map