@pulumi/dnsimple
Version:
A Pulumi package for creating and managing dnsimple cloud resources.
141 lines • 5.81 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.RegisteredDomain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a DNSimple registered domain resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dnsimple from "@pulumi/dnsimple";
*
* const aliceMain = new dnsimple.Contact("alice_main", {
* label: "Alice Appleseed",
* firstName: "Alice Main",
* lastName: "Appleseed",
* organizationName: "Contoso",
* jobTitle: "Manager",
* address1: "Level 1, 2 Main St",
* address2: "Marsfield",
* city: "San Francisco",
* stateProvince: "California",
* postalCode: "90210",
* country: "US",
* phone: "+1401239523",
* fax: "+1849491024",
* email: "apple@contoso.com",
* });
* const appleseedBio = new dnsimple.RegisteredDomain("appleseed_bio", {
* name: "appleseed.bio",
* contactId: aliceMain.id,
* autoRenewEnabled: true,
* transferLockEnabled: true,
* whoisPrivacyEnabled: true,
* dnssecEnabled: false,
* extendedAttributes: {
* bio_agree: "I Agree",
* },
* });
* ```
*
* ## Import
*
* DNSimple registered domains can be imported using their domain name and **optionally** with domain registration ID.
*
* **Importing registered domain example.com**
*
* bash
*
* ```sh
* $ pulumi import dnsimple:index/registeredDomain:RegisteredDomain resource_name example.com
* ```
*
* **Importing registered domain example.com with domain registration ID 1234**
*
* bash
*
* ```sh
* $ pulumi import dnsimple:index/registeredDomain:RegisteredDomain resource_name example.com_1234
* ```
*/
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 });
}
/**
* 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["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["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;
/** @internal */
RegisteredDomain.__pulumiType = 'dnsimple:index/registeredDomain:RegisteredDomain';
//# sourceMappingURL=registeredDomain.js.map