@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
88 lines • 4 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.Ipv6Range = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Linode IPv6 range.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-ipv6-range).
*
* > **NOTICE:** We highly recommend that users do not remove an IPv6 range created by this Terraform resource outside of Terraform. This is because if a user manually removes an IPv6 range created by Terraform, and then assigns some IPv6 ranges to other linodes outside of Terraform, there is a chance that the same IPv6 range can be assigned to another linode, even though the new range is randomly selected. This will result in the newly assigned IPv6 range being managed by this Terraform resource. In this case, the user should manually taint this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const foobar = new linode.Instance("foobar", {
* label: "my-linode",
* image: "linode/alpine3.19",
* type: "g6-nanode-1",
* region: "us-southeast",
* });
* const foobarIpv6Range = new linode.Ipv6Range("foobar", {
* linodeId: foobar.id,
* prefixLength: 64,
* });
* ```
*/
class Ipv6Range extends pulumi.CustomResource {
/**
* Get an existing Ipv6Range 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 Ipv6Range(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Ipv6Range. 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'] === Ipv6Range.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["isBgp"] = state?.isBgp;
resourceInputs["linodeId"] = state?.linodeId;
resourceInputs["linodes"] = state?.linodes;
resourceInputs["prefixLength"] = state?.prefixLength;
resourceInputs["range"] = state?.range;
resourceInputs["region"] = state?.region;
resourceInputs["routeTarget"] = state?.routeTarget;
}
else {
const args = argsOrState;
if (args?.prefixLength === undefined && !opts.urn) {
throw new Error("Missing required property 'prefixLength'");
}
resourceInputs["linodeId"] = args?.linodeId;
resourceInputs["prefixLength"] = args?.prefixLength;
resourceInputs["routeTarget"] = args?.routeTarget;
resourceInputs["isBgp"] = undefined /*out*/;
resourceInputs["linodes"] = undefined /*out*/;
resourceInputs["range"] = undefined /*out*/;
resourceInputs["region"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Ipv6Range.__pulumiType, name, resourceInputs, opts);
}
}
exports.Ipv6Range = Ipv6Range;
/** @internal */
Ipv6Range.__pulumiType = 'linode:index/ipv6Range:Ipv6Range';
//# sourceMappingURL=ipv6Range.js.map