UNPKG

@cuemby/equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

272 lines 11.9 kB
"use strict"; // *** 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.MetalDevice = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides an Equinix Metal device resource. This can be used to create, * modify, and delete devices. * * > **NOTE:** All arguments including the `rootPassword` and `userData` will be stored in * the raw state as plain-text. * [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * * ## Example Usage * * Create a device and add it to coolProject * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * * const web1 = new equinix.MetalDevice("web1", { * hostname: "tf.coreos2", * plan: "c3.small.x86", * metro: "sv", * operatingSystem: "ubuntu_20_04", * billingCycle: "hourly", * projectId: local.project_id, * }); * ``` * * Same as above, but boot via iPXE initially, using the Ignition Provider for provisioning * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * * const pxe1 = new equinix.MetalDevice("pxe1", { * hostname: "tf.coreos2-pxe", * plan: "c3.small.x86", * metro: "sv", * operatingSystem: "custom_ipxe", * billingCycle: "hourly", * projectId: local.project_id, * ipxeScriptUrl: "https://rawgit.com/cloudnativelabs/pxe/master/metal/coreos-stable-metal.ipxe", * alwaysPxe: false, * userData: data.ignition_config.example.rendered, * }); * ``` * * Create a device without a public IP address in facility ny5, with only a /30 private IPv4 subnet (4 IP addresses) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * * const web1 = new equinix.MetalDevice("web1", { * hostname: "tf.coreos2", * plan: "c3.small.x86", * facilities: ["ny5"], * operatingSystem: "ubuntu_20_04", * billingCycle: "hourly", * projectId: local.project_id, * ipAddresses: [{ * type: "private_ipv4", * cidr: 30, * }], * }); * ``` * * Deploy device on next-available reserved hardware and do custom partitioning. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * * const web1 = new equinix.MetalDevice("web1", { * hostname: "tftest", * plan: "c3.small.x86", * facilities: ["ny5"], * operatingSystem: "ubuntu_20_04", * billingCycle: "hourly", * projectId: local.project_id, * hardwareReservationId: "next-available", * storage: `{ * "disks": [ * { * "device": "/dev/sda", * "wipeTable": true, * "partitions": [ * { * "label": "BIOS", * "number": 1, * "size": "4096" * }, * { * "label": "SWAP", * "number": 2, * "size": "3993600" * }, * { * "label": "ROOT", * "number": 3, * "size": "0" * } * ] * } * ], * "filesystems": [ * { * "mount": { * "device": "/dev/sda3", * "format": "ext4", * "point": "/", * "create": { * "options": [ * "-L", * "ROOT" * ] * } * } * }, * { * "mount": { * "device": "/dev/sda2", * "format": "swap", * "point": "none", * "create": { * "options": [ * "-L", * "SWAP" * ] * } * } * } * ] * } * `, * }); * ``` * * ## Import * * This resource can be imported using an existing device ID * * ```sh * $ pulumi import equinix:index/metalDevice:MetalDevice equinix_metal_device {existing_device_id} * ``` */ class MetalDevice extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessPrivateIpv4"] = state ? state.accessPrivateIpv4 : undefined; resourceInputs["accessPublicIpv4"] = state ? state.accessPublicIpv4 : undefined; resourceInputs["accessPublicIpv6"] = state ? state.accessPublicIpv6 : undefined; resourceInputs["alwaysPxe"] = state ? state.alwaysPxe : undefined; resourceInputs["billingCycle"] = state ? state.billingCycle : undefined; resourceInputs["created"] = state ? state.created : undefined; resourceInputs["customData"] = state ? state.customData : undefined; resourceInputs["deployedFacility"] = state ? state.deployedFacility : undefined; resourceInputs["deployedHardwareReservationId"] = state ? state.deployedHardwareReservationId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["facilities"] = state ? state.facilities : undefined; resourceInputs["forceDetachVolumes"] = state ? state.forceDetachVolumes : undefined; resourceInputs["hardwareReservationId"] = state ? state.hardwareReservationId : undefined; resourceInputs["hostname"] = state ? state.hostname : undefined; resourceInputs["ipAddresses"] = state ? state.ipAddresses : undefined; resourceInputs["ipxeScriptUrl"] = state ? state.ipxeScriptUrl : undefined; resourceInputs["locked"] = state ? state.locked : undefined; resourceInputs["metro"] = state ? state.metro : undefined; resourceInputs["networkType"] = state ? state.networkType : undefined; resourceInputs["networks"] = state ? state.networks : undefined; resourceInputs["operatingSystem"] = state ? state.operatingSystem : undefined; resourceInputs["plan"] = state ? state.plan : undefined; resourceInputs["ports"] = state ? state.ports : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["projectSshKeyIds"] = state ? state.projectSshKeyIds : undefined; resourceInputs["reinstall"] = state ? state.reinstall : undefined; resourceInputs["rootPassword"] = state ? state.rootPassword : undefined; resourceInputs["sshKeyIds"] = state ? state.sshKeyIds : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["storage"] = state ? state.storage : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["terminationTime"] = state ? state.terminationTime : undefined; resourceInputs["updated"] = state ? state.updated : undefined; resourceInputs["userData"] = state ? state.userData : undefined; resourceInputs["userSshKeyIds"] = state ? state.userSshKeyIds : undefined; resourceInputs["waitForReservationDeprovision"] = state ? state.waitForReservationDeprovision : undefined; } else { const args = argsOrState; if ((!args || args.operatingSystem === undefined) && !opts.urn) { throw new Error("Missing required property 'operatingSystem'"); } if ((!args || args.plan === undefined) && !opts.urn) { throw new Error("Missing required property 'plan'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } resourceInputs["alwaysPxe"] = args ? args.alwaysPxe : undefined; resourceInputs["billingCycle"] = args ? args.billingCycle : undefined; resourceInputs["customData"] = args ? args.customData : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["facilities"] = args ? args.facilities : undefined; resourceInputs["forceDetachVolumes"] = args ? args.forceDetachVolumes : undefined; resourceInputs["hardwareReservationId"] = args ? args.hardwareReservationId : undefined; resourceInputs["hostname"] = args ? args.hostname : undefined; resourceInputs["ipAddresses"] = args ? args.ipAddresses : undefined; resourceInputs["ipxeScriptUrl"] = args ? args.ipxeScriptUrl : undefined; resourceInputs["metro"] = args ? args.metro : undefined; resourceInputs["operatingSystem"] = args ? args.operatingSystem : undefined; resourceInputs["plan"] = args ? args.plan : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["projectSshKeyIds"] = args ? args.projectSshKeyIds : undefined; resourceInputs["reinstall"] = args ? args.reinstall : undefined; resourceInputs["storage"] = args ? args.storage : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["terminationTime"] = args ? args.terminationTime : undefined; resourceInputs["userData"] = args ? args.userData : undefined; resourceInputs["userSshKeyIds"] = args ? args.userSshKeyIds : undefined; resourceInputs["waitForReservationDeprovision"] = args ? args.waitForReservationDeprovision : undefined; resourceInputs["accessPrivateIpv4"] = undefined /*out*/; resourceInputs["accessPublicIpv4"] = undefined /*out*/; resourceInputs["accessPublicIpv6"] = undefined /*out*/; resourceInputs["created"] = undefined /*out*/; resourceInputs["deployedFacility"] = undefined /*out*/; resourceInputs["deployedHardwareReservationId"] = undefined /*out*/; resourceInputs["locked"] = undefined /*out*/; resourceInputs["networkType"] = undefined /*out*/; resourceInputs["networks"] = undefined /*out*/; resourceInputs["ports"] = undefined /*out*/; resourceInputs["rootPassword"] = undefined /*out*/; resourceInputs["sshKeyIds"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MetalDevice.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MetalDevice 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 MetalDevice(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MetalDevice. 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'] === MetalDevice.__pulumiType; } } exports.MetalDevice = MetalDevice; /** @internal */ MetalDevice.__pulumiType = 'equinix:index/metalDevice:MetalDevice'; //# sourceMappingURL=metalDevice.js.map