UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

116 lines 5.28 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.Domain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Linode Domain resource. This can be used to create, modify, and delete Linode Domains through Linode's managed DNS service. * For more information, see [DNS Manager](https://www.linode.com/docs/platform/manager/dns-manager/) and the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-domain). * * ## Example Usage * * The following example shows how one might use this resource to configure a Domain Record attached to a Linode Domain. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foobar = new linode.Domain("foobar", { * type: "master", * domain: "foobar.example", * soaEmail: "example@foobar.example", * tags: [ * "foo", * "bar", * ], * }); * const foobarDomainRecord = new linode.DomainRecord("foobar", { * domainId: foobar.id, * name: "www", * recordType: "CNAME", * target: "foobar.example", * }); * ``` * * ## Import * * Linodes Domains can be imported using the Linode Domain `id`, e.g. * * ```sh * $ pulumi import linode:index/domain:Domain foobar 1234567 * ``` */ class Domain extends pulumi.CustomResource { /** * Get an existing Domain 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 Domain(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Domain. 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'] === Domain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["axfrIps"] = state ? state.axfrIps : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["expireSec"] = state ? state.expireSec : undefined; resourceInputs["group"] = state ? state.group : undefined; resourceInputs["masterIps"] = state ? state.masterIps : undefined; resourceInputs["refreshSec"] = state ? state.refreshSec : undefined; resourceInputs["retrySec"] = state ? state.retrySec : undefined; resourceInputs["soaEmail"] = state ? state.soaEmail : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["ttlSec"] = state ? state.ttlSec : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["axfrIps"] = args ? args.axfrIps : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["expireSec"] = args ? args.expireSec : undefined; resourceInputs["group"] = args ? args.group : undefined; resourceInputs["masterIps"] = args ? args.masterIps : undefined; resourceInputs["refreshSec"] = args ? args.refreshSec : undefined; resourceInputs["retrySec"] = args ? args.retrySec : undefined; resourceInputs["soaEmail"] = args ? args.soaEmail : undefined; resourceInputs["status"] = args ? args.status : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["ttlSec"] = args ? args.ttlSec : undefined; resourceInputs["type"] = args ? args.type : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Domain.__pulumiType, name, resourceInputs, opts); } } exports.Domain = Domain; /** @internal */ Domain.__pulumiType = 'linode:index/domain:Domain'; //# sourceMappingURL=domain.js.map