UNPKG

@pulumi/dnsimple

Version:

A Pulumi package for creating and managing dnsimple cloud resources.

119 lines 4.21 kB
"use strict"; // *** 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.Zone = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a DNSimple zone resource. * * > Currently the resource creation acts as an import, so the zone must already exist in DNSimple. The only attribute that will be modified during resource creation is the `active` state of the zone. This is because our API does not allow for the creation of zones. Creation of zones happens through the purchase or creation of domains. We expect this behavior to change in the future. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dnsimple from "@pulumi/dnsimple"; * * // Create a zone * const foobar = new dnsimple.Zone("foobar", {name: dnsimple.zone}); * ``` * * ## Import * * DNSimple zones can be imported using their numeric record ID or the zone name. * * bash * * ```sh * $ pulumi import dnsimple:index/zone:Zone resource_name foo.com * ``` * * The zone ID can be found within [DNSimple Zones API](https://developer.dnsimple.com/v2/zones/#getZone). Check out [Authentication](https://developer.dnsimple.com/v2/#authentication) in API Overview for available options. * * bash * * curl -H 'Authorization: Bearer <ACCESS_TOKEN>' https://api.dnsimple.com/v2/1234/zones/example.com | jq * * { * * "data": { * * "id": 1, * * "account_id": 1234, * * "name": "example.com", * * "reverse": false, * * "secondary": false, * * "last_transferred_at": null, * * "active": true, * * "created_at": "2023-04-18T04:58:01Z", * * "updated_at": "2024-01-16T15:53:18Z" * * } * * } */ class Zone extends pulumi.CustomResource { /** * Get an existing Zone 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 Zone(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Zone. 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'] === Zone.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["active"] = state?.active; resourceInputs["lastTransferredAt"] = state?.lastTransferredAt; resourceInputs["name"] = state?.name; resourceInputs["reverse"] = state?.reverse; resourceInputs["secondary"] = state?.secondary; } else { const args = argsOrState; if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } resourceInputs["active"] = args?.active; resourceInputs["name"] = args?.name; resourceInputs["accountId"] = undefined /*out*/; resourceInputs["lastTransferredAt"] = undefined /*out*/; resourceInputs["reverse"] = undefined /*out*/; resourceInputs["secondary"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Zone.__pulumiType, name, resourceInputs, opts); } } exports.Zone = Zone; /** @internal */ Zone.__pulumiType = 'dnsimple:index/zone:Zone'; //# sourceMappingURL=zone.js.map