UNPKG

@equinix-labs/pulumi-equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

122 lines 5.7 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.NetworkFile = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource `equinix.networkedge.NetworkFile` allows creation and management of Equinix Network Edge files. * * ## Example Usage * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * import * as std from "@pulumi/std"; * * const config = new pulumi.Config(); * const filepath = config.get("filepath") || "fileFolder/fileName.txt"; * const testFile = new equinix.networkedge.NetworkFile("test-file", { * fileName: "fileName.txt", * content: std.fileOutput({ * input: filepath, * }).apply(invoke => invoke.result), * metroCode: equinix.index.Metro.SiliconValley, * deviceTypeCode: "AVIATRIX_EDGE_10", * processType: equinix.networkedge.FileType.CloudInit, * selfManaged: true, * byol: true, * }); * ``` * * ## Import * * This resource can be imported using an existing ID: * * ```sh * $ pulumi import equinix:networkedge/networkFile:NetworkFile example {existing_id} * ``` * * The `content`, `self_managed` and `byol` fields can not be imported. */ class NetworkFile extends pulumi.CustomResource { /** * Get an existing NetworkFile 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 NetworkFile(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NetworkFile. 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'] === NetworkFile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["byol"] = state ? state.byol : undefined; resourceInputs["content"] = state ? state.content : undefined; resourceInputs["deviceTypeCode"] = state ? state.deviceTypeCode : undefined; resourceInputs["fileName"] = state ? state.fileName : undefined; resourceInputs["metroCode"] = state ? state.metroCode : undefined; resourceInputs["processType"] = state ? state.processType : undefined; resourceInputs["selfManaged"] = state ? state.selfManaged : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["uuid"] = state ? state.uuid : undefined; } else { const args = argsOrState; if ((!args || args.byol === undefined) && !opts.urn) { throw new Error("Missing required property 'byol'"); } if ((!args || args.content === undefined) && !opts.urn) { throw new Error("Missing required property 'content'"); } if ((!args || args.deviceTypeCode === undefined) && !opts.urn) { throw new Error("Missing required property 'deviceTypeCode'"); } if ((!args || args.fileName === undefined) && !opts.urn) { throw new Error("Missing required property 'fileName'"); } if ((!args || args.metroCode === undefined) && !opts.urn) { throw new Error("Missing required property 'metroCode'"); } if ((!args || args.processType === undefined) && !opts.urn) { throw new Error("Missing required property 'processType'"); } if ((!args || args.selfManaged === undefined) && !opts.urn) { throw new Error("Missing required property 'selfManaged'"); } resourceInputs["byol"] = args ? args.byol : undefined; resourceInputs["content"] = (args === null || args === void 0 ? void 0 : args.content) ? pulumi.secret(args.content) : undefined; resourceInputs["deviceTypeCode"] = args ? args.deviceTypeCode : undefined; resourceInputs["fileName"] = args ? args.fileName : undefined; resourceInputs["metroCode"] = args ? args.metroCode : undefined; resourceInputs["processType"] = args ? args.processType : undefined; resourceInputs["selfManaged"] = args ? args.selfManaged : undefined; resourceInputs["status"] = undefined /*out*/; resourceInputs["uuid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["content"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(NetworkFile.__pulumiType, name, resourceInputs, opts); } } exports.NetworkFile = NetworkFile; /** @internal */ NetworkFile.__pulumiType = 'equinix:networkedge/networkFile:NetworkFile'; //# sourceMappingURL=networkFile.js.map