@equinix-labs/pulumi-equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
109 lines • 5.2 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.SpotMarketRequest = 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 "@equinix-labs/pulumi-equinix";
*
* const req = new equinix.metal.SpotMarketRequest("req", {
* projectId: projectId,
* maxBidPrice: 0.03,
* metro: "ny",
* 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:metal/spotMarketRequest:SpotMarketRequest equinix_metal_spot_market_request {existing_spot_market_request_id}
* ```
*/
class SpotMarketRequest extends pulumi.CustomResource {
/**
* Get an existing SpotMarketRequest 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 SpotMarketRequest(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SpotMarketRequest. 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'] === SpotMarketRequest.__pulumiType;
}
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(SpotMarketRequest.__pulumiType, name, resourceInputs, opts);
}
}
exports.SpotMarketRequest = SpotMarketRequest;
/** @internal */
SpotMarketRequest.__pulumiType = 'equinix:metal/spotMarketRequest:SpotMarketRequest';
//# sourceMappingURL=spotMarketRequest.js.map