@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
94 lines • 3.89 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstanceSharedIps = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages IPs shared to a Linode instance.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-share-ips).
*
* > **Beta Notice** IPv6 sharing is currently available through early access.
* To use early access resources, the `apiVersion` provider argument must be set to `v4beta`.
* To learn more, see the early access documentation.
*
* > **Notice** This resource should only be defined once per-instance and should not be used alongside the `sharedIpv4` field in `linode.Instance`.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* // Create a single primary node
* const primaryInstance = new linode.Instance("primary", {
* label: "node-primary",
* type: "g6-nanode-1",
* region: "eu-central",
* });
* // Allocate an IP under the primary node
* const primary = new linode.InstanceIp("primary", {linodeId: primaryInstance.id});
* // Create a secondary node
* const secondary = new linode.Instance("secondary", {
* label: "node-secondary",
* type: "g6-nanode-1",
* region: "eu-central",
* });
* // Share the IP with the secondary node
* const share_primary = new linode.InstanceSharedIps("share-primary", {
* linodeId: secondary.id,
* addresses: [primary.address],
* });
* ```
*/
class InstanceSharedIps extends pulumi.CustomResource {
/**
* Get an existing InstanceSharedIps 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 InstanceSharedIps(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of InstanceSharedIps. 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'] === InstanceSharedIps.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addresses"] = state?.addresses;
resourceInputs["linodeId"] = state?.linodeId;
}
else {
const args = argsOrState;
if (args?.addresses === undefined && !opts.urn) {
throw new Error("Missing required property 'addresses'");
}
if (args?.linodeId === undefined && !opts.urn) {
throw new Error("Missing required property 'linodeId'");
}
resourceInputs["addresses"] = args?.addresses;
resourceInputs["linodeId"] = args?.linodeId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceSharedIps.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceSharedIps = InstanceSharedIps;
/** @internal */
InstanceSharedIps.__pulumiType = 'linode:index/instanceSharedIps:InstanceSharedIps';
//# sourceMappingURL=instanceSharedIps.js.map