UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

129 lines 5.33 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.DnsZone = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Apigee Dns Zone. * * To get more information about DnsZone, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.dnsZones/create) * * How-to Guides * * [Creating a DnsZone](https://cloud.google.com/apigee/docs/api-platform/get-started/create-dns) * * ## Example Usage * * ### Apigee Dns Zone Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const org = new gcp.apigee.Organization("org", { * description: "Terraform-provisioned basic Apigee Org without VPC Peering.", * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * disableVpcPeering: true, * }); * const apigeeDnsZone = new gcp.apigee.DnsZone("apigee_dns_zone", { * orgId: apigeeOrg.id, * dnsZoneId: "test1", * domain: "foo.com", * description: "test", * peeringConfig: { * targetProjectId: current.then(current => current.project), * targetNetworkId: apigeeNetwork.id, * }, * }); * ``` * * ## Import * * DnsZone can be imported using any of these accepted formats: * * * `{{org_id}}/dnsZones/{{dns_zone_id}}` * * * `{{org_id}}/{{dns_zone_id}}` * * When using the `pulumi import` command, DnsZone can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/dnsZone:DnsZone default {{org_id}}/dnsZones/{{dns_zone_id}} * ``` * * ```sh * $ pulumi import gcp:apigee/dnsZone:DnsZone default {{org_id}}/{{dns_zone_id}} * ``` */ class DnsZone extends pulumi.CustomResource { /** * Get an existing DnsZone 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 DnsZone(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DnsZone. 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'] === DnsZone.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dnsZoneId"] = state ? state.dnsZoneId : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["peeringConfig"] = state ? state.peeringConfig : undefined; } else { const args = argsOrState; if ((!args || args.description === undefined) && !opts.urn) { throw new Error("Missing required property 'description'"); } if ((!args || args.dnsZoneId === undefined) && !opts.urn) { throw new Error("Missing required property 'dnsZoneId'"); } if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } if ((!args || args.orgId === undefined) && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if ((!args || args.peeringConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'peeringConfig'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["dnsZoneId"] = args ? args.dnsZoneId : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["peeringConfig"] = args ? args.peeringConfig : undefined; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DnsZone.__pulumiType, name, resourceInputs, opts); } } exports.DnsZone = DnsZone; /** @internal */ DnsZone.__pulumiType = 'gcp:apigee/dnsZone:DnsZone'; //# sourceMappingURL=dnsZone.js.map