Class ZoneAssociation


  • public class ZoneAssociation
    extends com.pulumi.resources.CustomResource
    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
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.Vpc;
     import com.pulumi.aws.ec2.VpcArgs;
     import com.pulumi.aws.route53.Zone;
     import com.pulumi.aws.route53.ZoneArgs;
     import com.pulumi.aws.route53.inputs.ZoneVpcArgs;
     import com.pulumi.aws.route53.ZoneAssociation;
     import com.pulumi.aws.route53.ZoneAssociationArgs;
     import com.pulumi.resources.CustomResourceOptions;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var primary = new Vpc("primary", VpcArgs.builder()
                 .cidrBlock("10.6.0.0/16")
                 .enableDnsHostnames(true)
                 .enableDnsSupport(true)
                 .build());
     
             var secondary = new Vpc("secondary", VpcArgs.builder()
                 .cidrBlock("10.7.0.0/16")
                 .enableDnsHostnames(true)
                 .enableDnsSupport(true)
                 .build());
     
             var example = new Zone("example", ZoneArgs.builder()
                 .vpcs(ZoneVpcArgs.builder()
                     .vpcId(primary.id())
                     .build())
                 .name("example.com")
                 .build(), CustomResourceOptions.builder()
                     .ignoreChanges("vpcs")
                     .build());
     
             var secondaryZoneAssociation = new ZoneAssociation("secondaryZoneAssociation", ZoneAssociationArgs.builder()
                 .zoneId(example.zoneId())
                 .vpcId(secondary.id())
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `zoneId` (String) The ID of the private hosted zone that you want to associate a VPC with. * `vpcId` (String) The VPC to associate with the private hosted zone. #### Optional * `vpcRegion` (String) The VPC's region. Defaults to the region of the AWS provider. * `accountId` (String) AWS Account where this resource is managed. 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 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ZoneAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ZoneAssociationState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> owningAccount()  
      com.pulumi.core.Output<java.lang.String> vpcId()  
      com.pulumi.core.Output<java.lang.String> vpcRegion()  
      com.pulumi.core.Output<java.lang.String> zoneId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZoneAssociation

        public ZoneAssociation​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • ZoneAssociation

        public ZoneAssociation​(java.lang.String name,
                               ZoneAssociationArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • ZoneAssociation

        public ZoneAssociation​(java.lang.String name,
                               ZoneAssociationArgs args,
                               @Nullable
                               com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • owningAccount

        public com.pulumi.core.Output<java.lang.String> owningAccount()
        Returns:
        The account ID of the account that created the hosted zone.
      • vpcId

        public com.pulumi.core.Output<java.lang.String> vpcId()
        Returns:
        The VPC to associate with the private hosted zone.
      • vpcRegion

        public com.pulumi.core.Output<java.lang.String> vpcRegion()
        Returns:
        The VPC's region. Defaults to the region of the AWS provider.
      • zoneId

        public com.pulumi.core.Output<java.lang.String> zoneId()
        Returns:
        The private hosted zone to associate.
      • get

        public static ZoneAssociation get​(java.lang.String name,
                                          com.pulumi.core.Output<java.lang.String> id,
                                          @Nullable
                                          ZoneAssociationState state,
                                          @Nullable
                                          com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.