UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

110 lines 4.17 kB
"use strict"; // *** 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.DnsRecordSet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a DNS Recordset. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const foo = new yandex.VpcNetwork("foo", {}); * const zone1 = new yandex.DnsZone("zone1", { * description: "desc", * labels: { * label1: "label-1-value", * }, * zone: "example.com.", * "public": false, * privateNetworks: [foo.id], * }); * const rs1 = new yandex.DnsRecordSet("rs1", { * zoneId: zone1.id, * type: "A", * ttl: 200, * datas: ["10.1.0.1"], * }); * const rs2 = new yandex.DnsRecordSet("rs2", { * zoneId: zone1.id, * type: "A", * ttl: 200, * datas: ["10.1.0.2"], * }); * ``` * * ## Import * * DNS recordset can be imported using this format * * ```sh * $ pulumi import yandex:index/dnsRecordSet:DnsRecordSet rs1 {{zone_id}}/{{name}}/{{type}} * ``` */ class DnsRecordSet extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["datas"] = state ? state.datas : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ttl"] = state ? state.ttl : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["zoneId"] = state ? state.zoneId : undefined; } else { const args = argsOrState; if ((!args || args.datas === undefined) && !opts.urn) { throw new Error("Missing required property 'datas'"); } if ((!args || args.ttl === undefined) && !opts.urn) { throw new Error("Missing required property 'ttl'"); } 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["datas"] = args ? args.datas : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["ttl"] = args ? args.ttl : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["zoneId"] = args ? args.zoneId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DnsRecordSet.__pulumiType, name, resourceInputs, opts); } /** * Get an existing DnsRecordSet 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 DnsRecordSet(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DnsRecordSet. 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'] === DnsRecordSet.__pulumiType; } } exports.DnsRecordSet = DnsRecordSet; /** @internal */ DnsRecordSet.__pulumiType = 'yandex:index/dnsRecordSet:DnsRecordSet'; //# sourceMappingURL=dnsRecordSet.js.map