@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
116 lines • 4.73 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.Domain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Linode Domain resource. This can be used to create, modify, and delete Linode Domains through Linode's managed DNS service.
* For more information, see [DNS Manager](https://www.linode.com/docs/platform/manager/dns-manager/) and the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-domain).
*
* ## Example Usage
*
* The following example shows how one might use this resource to configure a Domain Record attached to a Linode Domain.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const foobar = new linode.Domain("foobar", {
* type: "master",
* domain: "foobar.example",
* soaEmail: "example@foobar.example",
* tags: [
* "foo",
* "bar",
* ],
* });
* const foobarDomainRecord = new linode.DomainRecord("foobar", {
* domainId: foobar.id,
* name: "www",
* recordType: "CNAME",
* target: "foobar.example",
* });
* ```
*
* ## Import
*
* Linodes Domains can be imported using the Linode Domain `id`, e.g.
*
* ```sh
* $ pulumi import linode:index/domain:Domain foobar 1234567
* ```
*/
class Domain extends pulumi.CustomResource {
/**
* Get an existing Domain 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 Domain(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Domain. 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'] === Domain.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["axfrIps"] = state?.axfrIps;
resourceInputs["description"] = state?.description;
resourceInputs["domain"] = state?.domain;
resourceInputs["expireSec"] = state?.expireSec;
resourceInputs["group"] = state?.group;
resourceInputs["masterIps"] = state?.masterIps;
resourceInputs["refreshSec"] = state?.refreshSec;
resourceInputs["retrySec"] = state?.retrySec;
resourceInputs["soaEmail"] = state?.soaEmail;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["ttlSec"] = state?.ttlSec;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.domain === undefined && !opts.urn) {
throw new Error("Missing required property 'domain'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["axfrIps"] = args?.axfrIps;
resourceInputs["description"] = args?.description;
resourceInputs["domain"] = args?.domain;
resourceInputs["expireSec"] = args?.expireSec;
resourceInputs["group"] = args?.group;
resourceInputs["masterIps"] = args?.masterIps;
resourceInputs["refreshSec"] = args?.refreshSec;
resourceInputs["retrySec"] = args?.retrySec;
resourceInputs["soaEmail"] = args?.soaEmail;
resourceInputs["status"] = args?.status;
resourceInputs["tags"] = args?.tags;
resourceInputs["ttlSec"] = args?.ttlSec;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Domain.__pulumiType, name, resourceInputs, opts);
}
}
exports.Domain = Domain;
/** @internal */
Domain.__pulumiType = 'linode:index/domain:Domain';
//# sourceMappingURL=domain.js.map