@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
122 lines • 5.03 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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");
/**
* Manages a DNS zone resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a public DNS zone
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const zoneName = config.requireObject("zoneName");
* const email = config.requireObject("email");
* const description = config.requireObject("description");
* const test = new huaweicloud.dns.Zone("test", {
* email: email,
* zoneType: "public",
* ttl: 3000,
* description: description,
* });
* ```
* ### Create a private DNS zone
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const zoneName = config.requireObject("zoneName");
* const email = config.requireObject("email");
* const description = config.requireObject("description");
* const routerId = config.requireObject("routerId");
* const test = new huaweicloud.dns.Zone("test", {
* email: email,
* zoneType: "private",
* ttl: 3000,
* description: description,
* routers: [{
* routerId: routerId,
* }],
* });
* ```
*
* ## Import
*
* This resource can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Dns/zone:Zone test <id>
* ```
*/
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, Object.assign(Object.assign({}, 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["description"] = state ? state.description : undefined;
resourceInputs["email"] = state ? state.email : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["masters"] = state ? state.masters : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["proxyPattern"] = state ? state.proxyPattern : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["routers"] = state ? state.routers : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["ttl"] = state ? state.ttl : undefined;
resourceInputs["zoneType"] = state ? state.zoneType : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["email"] = args ? args.email : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["proxyPattern"] = args ? args.proxyPattern : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["routers"] = args ? args.routers : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["ttl"] = args ? args.ttl : undefined;
resourceInputs["zoneType"] = args ? args.zoneType : undefined;
resourceInputs["masters"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Zone.__pulumiType, name, resourceInputs, opts);
}
}
exports.Zone = Zone;
/** @internal */
Zone.__pulumiType = 'huaweicloud:Dns/zone:Zone';
//# sourceMappingURL=zone.js.map