UNPKG

@pulumi/dnsimple

Version:

A Pulumi package for creating and managing dnsimple cloud resources.

200 lines • 8.77 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RegisteredDomain = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Provides a DNSimple registered domain resource. * * ## Example Usage * * The simplest example below requires a contact (existing or a new one to be created) and basic domain information. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dnsimple from "@pulumi/dnsimple"; * * const aliceMain = new dnsimple.Contact("alice_main", { * label: "Alice", * firstName: "Alice", * lastName: "Appleseed", * organizationName: "Contoso", * jobTitle: "Manager", * address1: "Level 1, 2 Main St", * city: "San Francisco", * stateProvince: "California", * postalCode: "90210", * country: "US", * phone: "+1.401239523", * email: "apple@contoso.com", * }); * const exampleCom = new dnsimple.RegisteredDomain("example_com", { * name: "example.com", * contactId: aliceMain.id.apply(x =>Number(x)), * }); * ``` * * ### Example with more settings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dnsimple from "@pulumi/dnsimple"; * * const exampleCom = new dnsimple.RegisteredDomain("example_com", { * name: "example.com", * contactId: Number(aliceMain.id), * autoRenewEnabled: true, * transferLockEnabled: true, * whoisPrivacyEnabled: true, * dnssecEnabled: false, * trustee: false, * }); * ``` * * ### Example with extended attributes * * Some domain extensions require additional information during registration. You can check if a domain extension requires extended attributes using the [TLD Extended Attributes API](https://developer.dnsimple.com/v2/tlds/#getTldExtendedAttributes). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dnsimple from "@pulumi/dnsimple"; * * const exampleBio = new dnsimple.RegisteredDomain("example_bio", { * name: "example.bio", * contactId: Number(aliceMain.id), * autoRenewEnabled: true, * extendedAttributes: { * bio_agree: "I Agree", * }, * }); * ``` * * ## Slow domain registrations * * Some TLDs have registration processes that can take hours or days to complete. When this happens, the provider will save the domain in a partial state and display the following message: * * > domain registration is not complete, current state: registering. You can try to run terraform again to try and converge the domain registration * * This is expected behavior. You can re-run `pulumi up` to check if the registration has completed. The provider will automatically attempt to converge the domain registration on each apply until the registration is complete. * * ## Import * * DNSimple registered domains can be imported using their domain name and **optionally** with domain registration ID. * * **Importing registered domain example.com:** * * ```sh * $ pulumi import dnsimple:index/registeredDomain:RegisteredDomain example example.com * ``` * * **Importing registered domain example.com with domain registration ID 1234:** * * ```sh * $ pulumi import dnsimple:index/registeredDomain:RegisteredDomain example example.com_1234 * ``` * * > **Note:** At present there is no way to retrieve the domain registration ID from the DNSimple API or UI. You will need to have noted the ID when you created the domain registration. Prefer using the domain name only when importing. */ class RegisteredDomain extends pulumi.CustomResource { /** * Get an existing RegisteredDomain 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 RegisteredDomain(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'dnsimple:index/registeredDomain:RegisteredDomain'; /** * Returns true if the given object is an instance of RegisteredDomain. 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'] === RegisteredDomain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["autoRenewEnabled"] = state?.autoRenewEnabled; resourceInputs["contactId"] = state?.contactId; resourceInputs["dnssecEnabled"] = state?.dnssecEnabled; resourceInputs["domainRegistration"] = state?.domainRegistration; resourceInputs["expiresAt"] = state?.expiresAt; resourceInputs["extendedAttributes"] = state?.extendedAttributes; resourceInputs["name"] = state?.name; resourceInputs["premiumPrice"] = state?.premiumPrice; resourceInputs["registrantChange"] = state?.registrantChange; resourceInputs["state"] = state?.state; resourceInputs["timeouts"] = state?.timeouts; resourceInputs["transferLockEnabled"] = state?.transferLockEnabled; resourceInputs["trustee"] = state?.trustee; resourceInputs["unicodeName"] = state?.unicodeName; resourceInputs["whoisPrivacyEnabled"] = state?.whoisPrivacyEnabled; } else { const args = argsOrState; if (args?.contactId === undefined && !opts.urn) { throw new Error("Missing required property 'contactId'"); } if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } resourceInputs["autoRenewEnabled"] = args?.autoRenewEnabled; resourceInputs["contactId"] = args?.contactId; resourceInputs["dnssecEnabled"] = args?.dnssecEnabled; resourceInputs["extendedAttributes"] = args?.extendedAttributes; resourceInputs["name"] = args?.name; resourceInputs["premiumPrice"] = args?.premiumPrice; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["transferLockEnabled"] = args?.transferLockEnabled; resourceInputs["trustee"] = args?.trustee; resourceInputs["whoisPrivacyEnabled"] = args?.whoisPrivacyEnabled; resourceInputs["accountId"] = undefined /*out*/; resourceInputs["domainRegistration"] = undefined /*out*/; resourceInputs["expiresAt"] = undefined /*out*/; resourceInputs["registrantChange"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["unicodeName"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RegisteredDomain.__pulumiType, name, resourceInputs, opts); } } exports.RegisteredDomain = RegisteredDomain; //# sourceMappingURL=registeredDomain.js.map