@pulumi/dnsimple
Version:
A Pulumi package for creating and managing dnsimple cloud resources.
136 lines • 5.04 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.ZoneRecord = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a DNSimple zone record resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dnsimple from "@pulumi/dnsimple";
*
* // Add a record to the root domain
* const foobar = new dnsimple.ZoneRecord("foobar", {
* zoneName: dnsimpleDomain,
* name: "",
* value: "192.168.0.11",
* type: "A",
* ttl: 3600,
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dnsimple from "@pulumi/dnsimple";
*
* // Add a record to a sub-domain
* const foobar = new dnsimple.ZoneRecord("foobar", {
* zoneName: dnsimpleDomain,
* name: "terraform",
* value: "192.168.0.11",
* type: "A",
* ttl: 3600,
* });
* ```
*
* ## Import
*
* DNSimple resources can be imported using their parent zone name (domain name) and numeric record ID.
*
* **Importing record example.com with record ID 1234**
*
* bash
*
* ```sh
* $ pulumi import dnsimple:index/zoneRecord:ZoneRecord resource_name example.com_1234
* ```
*
* **Importing record www.example.com with record ID 1234**
*
* bash
*
* ```sh
* $ pulumi import dnsimple:index/zoneRecord:ZoneRecord resource_name example.com_1234
* ```
*
* The record ID can be found in the URL when editing a record on the DNSimple web dashboard.
*/
class ZoneRecord extends pulumi.CustomResource {
/**
* Get an existing ZoneRecord 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 ZoneRecord(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ZoneRecord. 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'] === ZoneRecord.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state?.name;
resourceInputs["nameNormalized"] = state?.nameNormalized;
resourceInputs["priority"] = state?.priority;
resourceInputs["qualifiedName"] = state?.qualifiedName;
resourceInputs["regions"] = state?.regions;
resourceInputs["ttl"] = state?.ttl;
resourceInputs["type"] = state?.type;
resourceInputs["value"] = state?.value;
resourceInputs["valueNormalized"] = state?.valueNormalized;
resourceInputs["zoneId"] = state?.zoneId;
resourceInputs["zoneName"] = state?.zoneName;
}
else {
const args = argsOrState;
if (args?.name === undefined && !opts.urn) {
throw new Error("Missing required property 'name'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
if (args?.value === undefined && !opts.urn) {
throw new Error("Missing required property 'value'");
}
if (args?.zoneName === undefined && !opts.urn) {
throw new Error("Missing required property 'zoneName'");
}
resourceInputs["name"] = args?.name;
resourceInputs["priority"] = args?.priority;
resourceInputs["regions"] = args?.regions;
resourceInputs["ttl"] = args?.ttl;
resourceInputs["type"] = args?.type;
resourceInputs["value"] = args?.value;
resourceInputs["zoneName"] = args?.zoneName;
resourceInputs["nameNormalized"] = undefined /*out*/;
resourceInputs["qualifiedName"] = undefined /*out*/;
resourceInputs["valueNormalized"] = undefined /*out*/;
resourceInputs["zoneId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ZoneRecord.__pulumiType, name, resourceInputs, opts);
}
}
exports.ZoneRecord = ZoneRecord;
/** @internal */
ZoneRecord.__pulumiType = 'dnsimple:index/zoneRecord:ZoneRecord';
//# sourceMappingURL=zoneRecord.js.map