@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 5.16 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.ZoneAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Route53 Hosted Zone VPC association. VPC associations can only be made on private zones. See the `aws.route53.VpcAssociationAuthorization` resource for setting up cross-account associations.
*
* > **NOTE:** Unless explicit association ordering is required (e.g., a separate cross-account association authorization), usage of this resource is not recommended. Use the `vpc` configuration blocks available within the `aws.route53.Zone` resource instead.
*
* > **NOTE:** This provider provides both this standalone Zone VPC Association resource and exclusive VPC associations defined in-line in the `aws.route53.Zone` resource via `vpc` configuration blocks. At this time, you cannot use those in-line VPC associations in conjunction with this resource and 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) in the `aws.route53.Zone` resource to manage additional associations via this resource.
*
* ## Example Usage
*
* ```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 example = new aws.route53.Zone("example", {
* name: "example.com",
* vpcs: [{
* vpcId: primary.id,
* }],
* });
* const secondaryZoneAssociation = new aws.route53.ZoneAssociation("secondary", {
* zoneId: example.zoneId,
* vpcId: secondary.id,
* });
* ```
*
* ## Import
*
* The VPC is _not_ in the same region where you have configured the AWS Provider:
*
* __Using `pulumi import` to import__ Route 53 Hosted Zone Associations using the Hosted Zone ID and VPC ID, separated by a colon (`:`). For example:
*
* The VPC is in the same region where you have configured the AWS Provider:
*
* ```sh
* $ pulumi import aws:route53/zoneAssociation:ZoneAssociation example Z123456ABCDEFG:vpc-12345678
* ```
* The VPC is _not_ in the same region where you have configured the AWS Provider:
*
* ```sh
* $ pulumi import aws:route53/zoneAssociation:ZoneAssociation example Z123456ABCDEFG:vpc-12345678:us-east-2
* ```
*/
class ZoneAssociation extends pulumi.CustomResource {
/**
* Get an existing ZoneAssociation 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 ZoneAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ZoneAssociation. 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'] === ZoneAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["owningAccount"] = state?.owningAccount;
resourceInputs["vpcId"] = state?.vpcId;
resourceInputs["vpcRegion"] = state?.vpcRegion;
resourceInputs["zoneId"] = state?.zoneId;
}
else {
const args = argsOrState;
if (args?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
if (args?.zoneId === undefined && !opts.urn) {
throw new Error("Missing required property 'zoneId'");
}
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["vpcRegion"] = args?.vpcRegion;
resourceInputs["zoneId"] = args?.zoneId;
resourceInputs["owningAccount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ZoneAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.ZoneAssociation = ZoneAssociation;
/** @internal */
ZoneAssociation.__pulumiType = 'aws:route53/zoneAssociation:ZoneAssociation';
//# sourceMappingURL=zoneAssociation.js.map