UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

122 lines 5.09 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.Rdns = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Linode RDNS resource. This can be used to create and modify RDNS records. * * Linode RDNS names must have a matching address value in an A or AAAA record. This A or AAAA name must be resolvable at the time the RDNS resource is being associated. * * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/put-ip) and the [Configure your Linode for Reverse DNS](https://www.linode.com/docs/networking/dns/configure-your-linode-for-reverse-dns-classic-manager/) guide. * * ## Example Usage * * The following example shows how one might use this resource to configure an RDNS address for an IP address. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const fooInstance = new linode.Instance("foo", { * image: "linode/alpine3.19", * region: "ca-east", * type: "g6-dedicated-2", * }); * const foo = new linode.Rdns("foo", { * address: fooInstance.ipAddress, * rdns: pulumi.interpolate`${fooInstance.ipAddress}.nip.io`, * }); * ``` * * The following example shows how one might use this resource to configure RDNS for multiple IP addresses. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const myInstance: linode.Instance[] = []; * for (const range = {value: 0}; range.value < 3; range.value++) { * myInstance.push(new linode.Instance(`my_instance-${range.value}`, { * label: `simple_instance-${range.value + 1}`, * image: "linode/ubuntu22.04", * region: "us-central", * type: "g6-standard-1", * rootPass: "terr4form-test", * })); * } * const myRdns: linode.Rdns[] = []; * myInstance.length.apply(rangeBody => { * for (const range = {value: 0}; range.value < rangeBody; range.value++) { * myRdns.push(new linode.Rdns(`my_rdns-${range.value}`, { * address: myInstance[range.value].ipAddress, * rdns: pulumi.interpolate`${myInstance[range.value].ipAddress}.nip.io`, * })); * } * }); * ``` * * ## Import * * Linodes RDNS resources can be imported using the address as the `id`. * * ```sh * $ pulumi import linode:index/rdns:Rdns foo 123.123.123.123 * ``` */ class Rdns extends pulumi.CustomResource { /** * Get an existing Rdns 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 Rdns(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Rdns. 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'] === Rdns.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["rdns"] = state ? state.rdns : undefined; resourceInputs["timeouts"] = state ? state.timeouts : undefined; resourceInputs["waitForAvailable"] = state ? state.waitForAvailable : undefined; } else { const args = argsOrState; if ((!args || args.address === undefined) && !opts.urn) { throw new Error("Missing required property 'address'"); } if ((!args || args.rdns === undefined) && !opts.urn) { throw new Error("Missing required property 'rdns'"); } resourceInputs["address"] = args ? args.address : undefined; resourceInputs["rdns"] = args ? args.rdns : undefined; resourceInputs["timeouts"] = args ? args.timeouts : undefined; resourceInputs["waitForAvailable"] = args ? args.waitForAvailable : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Rdns.__pulumiType, name, resourceInputs, opts); } } exports.Rdns = Rdns; /** @internal */ Rdns.__pulumiType = 'linode:index/rdns:Rdns'; //# sourceMappingURL=rdns.js.map