@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
138 lines • 5.81 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.Recordset = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a DNS record set resource within HuaweiCloud.
*
* ## Example Usage
* ### Record Set with Public Zone
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const publicZoneId = config.requireObject("publicZoneId");
* const publicRecordsetName = config.requireObject("publicRecordsetName");
* const description = config.requireObject("description");
* const test = new huaweicloud.dns.Recordset("test", {
* zoneId: publicZoneId,
* type: "A",
* description: description,
* status: "ENABLE",
* ttl: 300,
* records: ["10.1.0.0"],
* lineId: "Dianxin_Shanxi",
* weight: 3,
* tags: {
* key1: "value1",
* key2: "value2",
* },
* });
* ```
* ### Record Set with Private Zone
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const privateZoneId = config.requireObject("privateZoneId");
* const privateRecordsetName = config.requireObject("privateRecordsetName");
* const description = config.requireObject("description");
* const test = new huaweicloud.dns.Recordset("test", {
* zoneId: privateZoneId,
* description: description,
* ttl: 3000,
* type: "A",
* records: ["10.0.0.1"],
* });
* ```
*
* ## Import
*
* The DNS recordset can be imported using `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Dns/recordset:Recordset test <id>
* ```
*/
class Recordset extends pulumi.CustomResource {
/**
* Get an existing Recordset 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 Recordset(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Recordset. 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'] === Recordset.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["lineId"] = state ? state.lineId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["records"] = state ? state.records : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["ttl"] = state ? state.ttl : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["weight"] = state ? state.weight : undefined;
resourceInputs["zoneId"] = state ? state.zoneId : undefined;
resourceInputs["zoneName"] = state ? state.zoneName : undefined;
resourceInputs["zoneType"] = state ? state.zoneType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.records === undefined) && !opts.urn) {
throw new Error("Missing required property 'records'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
if ((!args || args.zoneId === undefined) && !opts.urn) {
throw new Error("Missing required property 'zoneId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["lineId"] = args ? args.lineId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["records"] = args ? args.records : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["ttl"] = args ? args.ttl : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["weight"] = args ? args.weight : undefined;
resourceInputs["zoneId"] = args ? args.zoneId : undefined;
resourceInputs["zoneName"] = undefined /*out*/;
resourceInputs["zoneType"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Recordset.__pulumiType, name, resourceInputs, opts);
}
}
exports.Recordset = Recordset;
/** @internal */
Recordset.__pulumiType = 'huaweicloud:Dns/recordset:Recordset';
//# sourceMappingURL=recordset.js.map