@pulumi/dnsimple
Version:
A Pulumi package for creating and managing dnsimple cloud resources.
141 lines • 6.3 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, Object.assign(Object.assign({}, 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 ? state.accountId : undefined;
resourceInputs["autoRenewEnabled"] = state ? state.autoRenewEnabled : undefined;
resourceInputs["contactId"] = state ? state.contactId : undefined;
resourceInputs["dnssecEnabled"] = state ? state.dnssecEnabled : undefined;
resourceInputs["domainRegistration"] = state ? state.domainRegistration : undefined;
resourceInputs["expiresAt"] = state ? state.expiresAt : undefined;
resourceInputs["extendedAttributes"] = state ? state.extendedAttributes : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["premiumPrice"] = state ? state.premiumPrice : undefined;
resourceInputs["registrantChange"] = state ? state.registrantChange : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["timeouts"] = state ? state.timeouts : undefined;
resourceInputs["transferLockEnabled"] = state ? state.transferLockEnabled : undefined;
resourceInputs["unicodeName"] = state ? state.unicodeName : undefined;
resourceInputs["whoisPrivacyEnabled"] = state ? state.whoisPrivacyEnabled : undefined;
}
else {
const args = argsOrState;
if ((!args || args.contactId === undefined) && !opts.urn) {
throw new Error("Missing required property 'contactId'");
}
if ((!args || args.name === undefined) && !opts.urn) {
throw new Error("Missing required property 'name'");
}
resourceInputs["autoRenewEnabled"] = args ? args.autoRenewEnabled : undefined;
resourceInputs["contactId"] = args ? args.contactId : undefined;
resourceInputs["dnssecEnabled"] = args ? args.dnssecEnabled : undefined;
resourceInputs["extendedAttributes"] = args ? args.extendedAttributes : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["premiumPrice"] = args ? args.premiumPrice : undefined;
resourceInputs["timeouts"] = args ? args.timeouts : undefined;
resourceInputs["transferLockEnabled"] = args ? args.transferLockEnabled : undefined;
resourceInputs["whoisPrivacyEnabled"] = args ? args.whoisPrivacyEnabled : undefined;
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