UNPKG

@equinix-labs/pulumi-equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

80 lines 2.81 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.getPortOutput = exports.getPort = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this data source to read ports of existing devices. You can read port by either its UUID, or by a device UUID and port name. * * ## Example Usage * * Create a device and read it's eth0 port to the datasource. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const projectId = "<UUID_of_your_project>"; * const testDevice = new equinix.metal.Device("testDevice", { * hostname: "tfacc-test-device-port", * plan: equinix.metal.Plan.C3MediumX86, * metro: "sv", * operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, * billingCycle: equinix.metal.BillingCycle.Hourly, * projectId: projectId, * }); * const testPort = equinix.metal.getPortOutput({ * deviceId: testDevice.id, * name: "eth0", * }); * ``` */ function getPort(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("equinix:metal/getPort:getPort", { "deviceId": args.deviceId, "name": args.name, "portId": args.portId, }, opts); } exports.getPort = getPort; /** * Use this data source to read ports of existing devices. You can read port by either its UUID, or by a device UUID and port name. * * ## Example Usage * * Create a device and read it's eth0 port to the datasource. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const projectId = "<UUID_of_your_project>"; * const testDevice = new equinix.metal.Device("testDevice", { * hostname: "tfacc-test-device-port", * plan: equinix.metal.Plan.C3MediumX86, * metro: "sv", * operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, * billingCycle: equinix.metal.BillingCycle.Hourly, * projectId: projectId, * }); * const testPort = equinix.metal.getPortOutput({ * deviceId: testDevice.id, * name: "eth0", * }); * ``` */ function getPortOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("equinix:metal/getPort:getPort", { "deviceId": args.deviceId, "name": args.name, "portId": args.portId, }, opts); } exports.getPortOutput = getPortOutput; //# sourceMappingURL=getPort.js.map