@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
150 lines • 5.76 kB
JavaScript
;
// *** 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 primary = new aws.ec2.Vpc("primary", {
* cidrBlock: "10.6.0.0/16",
* enableDnsHostnames: true,
* enableDnsSupport: true,
* });
* const secondary = new aws.ec2.Vpc("secondary", {
* cidrBlock: "10.7.0.0/16",
* enableDnsHostnames: true,
* enableDnsSupport: true,
* });
* const _private = new aws.route53.Zone("private", {
* name: "example.com",
* vpcs: [
* {
* vpcId: primary.id,
* },
* {
* vpcId: secondary.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, { ...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) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["comment"] = state?.comment;
resourceInputs["delegationSetId"] = state?.delegationSetId;
resourceInputs["forceDestroy"] = state?.forceDestroy;
resourceInputs["name"] = state?.name;
resourceInputs["nameServers"] = state?.nameServers;
resourceInputs["primaryNameServer"] = state?.primaryNameServer;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcs"] = state?.vpcs;
resourceInputs["zoneId"] = state?.zoneId;
}
else {
const args = argsOrState;
resourceInputs["comment"] = (args?.comment) ?? "Managed by Pulumi";
resourceInputs["delegationSetId"] = args?.delegationSetId;
resourceInputs["forceDestroy"] = args?.forceDestroy;
resourceInputs["name"] = args?.name;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcs"] = args?.vpcs;
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