@pulumi/dnsimple
Version:
A Pulumi package for creating and managing dnsimple cloud resources.
136 lines • 5.45 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, Object.assign(Object.assign({}, 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 ? state.name : undefined;
resourceInputs["nameNormalized"] = state ? state.nameNormalized : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["qualifiedName"] = state ? state.qualifiedName : undefined;
resourceInputs["regions"] = state ? state.regions : undefined;
resourceInputs["ttl"] = state ? state.ttl : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["value"] = state ? state.value : undefined;
resourceInputs["valueNormalized"] = state ? state.valueNormalized : undefined;
resourceInputs["zoneId"] = state ? state.zoneId : undefined;
resourceInputs["zoneName"] = state ? state.zoneName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.name === undefined) && !opts.urn) {
throw new Error("Missing required property 'name'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
if ((!args || args.value === undefined) && !opts.urn) {
throw new Error("Missing required property 'value'");
}
if ((!args || args.zoneName === undefined) && !opts.urn) {
throw new Error("Missing required property 'zoneName'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["regions"] = args ? args.regions : undefined;
resourceInputs["ttl"] = args ? args.ttl : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["value"] = args ? args.value : undefined;
resourceInputs["zoneName"] = args ? args.zoneName : undefined;
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