@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
118 lines • 5.07 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.Record = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage private zone record
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooRecord = new volcengine.private_zone.Record("fooRecord", {
* zid: 2450000,
* host: "www",
* type: "A",
* value: "10.1.1.158",
* weight: 8,
* ttl: 700,
* remark: "tf-test",
* enable: true,
* });
* const fooRecordSets = volcengine.private_zone.getRecordSetsOutput({
* zid: fooRecord.zid,
* host: fooRecord.host,
* searchMode: "EXACT",
* });
* const fooRecordWeightEnabler = new volcengine.private_zone.RecordWeightEnabler("fooRecordWeightEnabler", {
* zid: fooRecord.zid,
* recordSetId: pulumi.all([fooRecordSets, fooRecord.type]).apply(([fooRecordSets, type]) => .filter(set => set.type == type).map(set => (set.recordSetId))[0]),
* weightEnabled: true,
* });
* ```
*
* ## Import
*
* PrivateZoneRecord can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:private_zone/record:Record default resource_id
* ```
*/
class Record extends pulumi.CustomResource {
/**
* Get an existing Record 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 Record(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Record. 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'] === Record.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enable"] = state ? state.enable : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["line"] = state ? state.line : undefined;
resourceInputs["remark"] = state ? state.remark : undefined;
resourceInputs["ttl"] = state ? state.ttl : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["userAccount"] = state ? state.userAccount : undefined;
resourceInputs["value"] = state ? state.value : undefined;
resourceInputs["weight"] = state ? state.weight : undefined;
resourceInputs["zid"] = state ? state.zid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.host === undefined) && !opts.urn) {
throw new Error("Missing required property 'host'");
}
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.zid === undefined) && !opts.urn) {
throw new Error("Missing required property 'zid'");
}
resourceInputs["enable"] = args ? args.enable : undefined;
resourceInputs["host"] = args ? args.host : undefined;
resourceInputs["line"] = args ? args.line : undefined;
resourceInputs["remark"] = args ? args.remark : undefined;
resourceInputs["ttl"] = args ? args.ttl : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["userAccount"] = args ? args.userAccount : undefined;
resourceInputs["value"] = args ? args.value : undefined;
resourceInputs["weight"] = args ? args.weight : undefined;
resourceInputs["zid"] = args ? args.zid : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Record.__pulumiType, name, resourceInputs, opts);
}
}
exports.Record = Record;
/** @internal */
Record.__pulumiType = 'volcengine:private_zone/record:Record';
//# sourceMappingURL=record.js.map