UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

98 lines 4.45 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.InstanceIp = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Linode instance IP. * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-add-linode-ip). * * > **NOTICE:** You may need to contact support to increase your instance IP limit before you can allocate additional IPs. * * > **NOTICE:** This resource will reboot the specified instance following IP allocation. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foo = new linode.Instance("foo", { * image: "linode/alpine3.19", * label: "foobar-test", * type: "g6-nanode-1", * region: "us-east", * }); * const fooInstanceIp = new linode.InstanceIp("foo", { * linodeId: foo.id, * "public": true, * }); * ``` */ class InstanceIp extends pulumi.CustomResource { /** * Get an existing InstanceIp 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 InstanceIp(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of InstanceIp. 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'] === InstanceIp.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["applyImmediately"] = state ? state.applyImmediately : undefined; resourceInputs["gateway"] = state ? state.gateway : undefined; resourceInputs["linodeId"] = state ? state.linodeId : undefined; resourceInputs["prefix"] = state ? state.prefix : undefined; resourceInputs["public"] = state ? state.public : undefined; resourceInputs["rdns"] = state ? state.rdns : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["subnetMask"] = state ? state.subnetMask : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["vpcNat11s"] = state ? state.vpcNat11s : undefined; } else { const args = argsOrState; if ((!args || args.linodeId === undefined) && !opts.urn) { throw new Error("Missing required property 'linodeId'"); } resourceInputs["applyImmediately"] = args ? args.applyImmediately : undefined; resourceInputs["linodeId"] = args ? args.linodeId : undefined; resourceInputs["public"] = args ? args.public : undefined; resourceInputs["rdns"] = args ? args.rdns : undefined; resourceInputs["address"] = undefined /*out*/; resourceInputs["gateway"] = undefined /*out*/; resourceInputs["prefix"] = undefined /*out*/; resourceInputs["region"] = undefined /*out*/; resourceInputs["subnetMask"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; resourceInputs["vpcNat11s"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(InstanceIp.__pulumiType, name, resourceInputs, opts); } } exports.InstanceIp = InstanceIp; /** @internal */ InstanceIp.__pulumiType = 'linode:index/instanceIp:InstanceIp'; //# sourceMappingURL=instanceIp.js.map