UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

136 lines 5.76 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** 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 Route53 Hosted Zone. For managing Domain Name System Security Extensions (DNSSEC), see the `aws.route53.KeySigningKey` and `aws.route53.HostedZoneDnsSec` resources. * * ## Example Usage * * ### Public Zone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const primary = new aws.route53.Zone("primary", {name: "example.com"}); * ``` * * ### Public Subdomain Zone * * For use in subdomains, note that you need to create a * `aws.route53.Record` of type `NS` as well as the subdomain * zone. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.route53.Zone("main", {name: "example.com"}); * const dev = new aws.route53.Zone("dev", { * name: "dev.example.com", * tags: { * Environment: "dev", * }, * }); * const dev_ns = new aws.route53.Record("dev-ns", { * zoneId: main.zoneId, * name: "dev.example.com", * type: aws.route53.RecordType.NS, * ttl: 30, * records: dev.nameServers, * }); * ``` * * ### Private Zone * * > **NOTE:** This provider provides both exclusive VPC associations defined in-line in this resource via `vpc` configuration blocks and a separate ` Zone VPC Association resource. At this time, you cannot use in-line VPC associations in conjunction with any `aws.route53.ZoneAssociation` resources with the same zone ID otherwise it will cause a perpetual difference in plan output. You can optionally use [ `ignoreChanges` ](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to manage additional associations via the `aws.route53.ZoneAssociation` resource. * * > **NOTE:** Private zones require at least one VPC association at all times. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const _private = new aws.route53.Zone("private", { * name: "example.com", * vpcs: [{ * vpcId: example.id, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import Route53 Zones using the zone `id`. For example: * * ```sh * $ pulumi import aws:route53/zone:Zone myzone Z1D633PJN98FT9 * ``` */ 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) { var _a; let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["comment"] = state ? state.comment : undefined; resourceInputs["delegationSetId"] = state ? state.delegationSetId : undefined; resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nameServers"] = state ? state.nameServers : undefined; resourceInputs["primaryNameServer"] = state ? state.primaryNameServer : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["vpcs"] = state ? state.vpcs : undefined; resourceInputs["zoneId"] = state ? state.zoneId : undefined; } else { const args = argsOrState; resourceInputs["comment"] = (_a = (args ? args.comment : undefined)) !== null && _a !== void 0 ? _a : "Managed by Pulumi"; resourceInputs["delegationSetId"] = args ? args.delegationSetId : undefined; resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcs"] = args ? args.vpcs : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["nameServers"] = undefined /*out*/; resourceInputs["primaryNameServer"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["zoneId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Zone.__pulumiType, name, resourceInputs, opts); } } exports.Zone = Zone; /** @internal */ Zone.__pulumiType = 'aws:route53/zone:Zone'; //# sourceMappingURL=zone.js.map