Class TransitRouterRouteTableAssociation


  • public class TransitRouterRouteTableAssociation
    extends com.pulumi.resources.CustomResource
    Provides a CEN transit router route table association resource.[What is Cen Transit Router Route Table Association](https://www.alibabacloud.com/help/en/cen/developer-reference/api-cbn-2017-09-12-createtransitroutetableaggregation) > **NOTE:** Available since v1.126.0. ## Example Usage Basic Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.cen.CenFunctions; import com.pulumi.alicloud.cen.inputs.GetTransitRouterAvailableResourcesArgs; import com.pulumi.alicloud.vpc.Network; import com.pulumi.alicloud.vpc.NetworkArgs; import com.pulumi.alicloud.vpc.Switch; import com.pulumi.alicloud.vpc.SwitchArgs; import com.pulumi.alicloud.cen.Instance; import com.pulumi.alicloud.cen.InstanceArgs; import com.pulumi.alicloud.cen.TransitRouter; import com.pulumi.alicloud.cen.TransitRouterArgs; import com.pulumi.alicloud.cen.TransitRouterVpcAttachment; import com.pulumi.alicloud.cen.TransitRouterVpcAttachmentArgs; import com.pulumi.alicloud.cen.inputs.TransitRouterVpcAttachmentZoneMappingArgs; import com.pulumi.alicloud.cen.TransitRouterRouteTable; import com.pulumi.alicloud.cen.TransitRouterRouteTableArgs; import com.pulumi.alicloud.cen.TransitRouterRouteTableAssociation; import com.pulumi.alicloud.cen.TransitRouterRouteTableAssociationArgs; import java.util.List; import java.util.ArrayList; 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) { final var config = ctx.config(); final var name = config.get("name").orElse("tf_example"); final var default = CenFunctions.getTransitRouterAvailableResources(); final var masterZone = default_.resources()[0].masterZones()[0]; final var slaveZone = default_.resources()[0].slaveZones()[1]; var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder() .vpcName(name) .cidrBlock("192.168.0.0/16") .build()); var exampleMaster = new Switch("exampleMaster", SwitchArgs.builder() .vswitchName(name) .cidrBlock("192.168.1.0/24") .vpcId(exampleNetwork.id()) .zoneId(masterZone) .build()); var exampleSlave = new Switch("exampleSlave", SwitchArgs.builder() .vswitchName(name) .cidrBlock("192.168.2.0/24") .vpcId(exampleNetwork.id()) .zoneId(slaveZone) .build()); var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder() .cenInstanceName(name) .protectionLevel("REDUCED") .build()); var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder() .transitRouterName(name) .cenId(exampleInstance.id()) .build()); var exampleTransitRouterVpcAttachment = new TransitRouterVpcAttachment("exampleTransitRouterVpcAttachment", TransitRouterVpcAttachmentArgs.builder() .cenId(exampleInstance.id()) .transitRouterId(exampleTransitRouter.transitRouterId()) .vpcId(exampleNetwork.id()) .zoneMappings( TransitRouterVpcAttachmentZoneMappingArgs.builder() .zoneId(masterZone) .vswitchId(exampleMaster.id()) .build(), TransitRouterVpcAttachmentZoneMappingArgs.builder() .zoneId(slaveZone) .vswitchId(exampleSlave.id()) .build()) .transitRouterAttachmentName(name) .transitRouterAttachmentDescription(name) .build()); var exampleTransitRouterRouteTable = new TransitRouterRouteTable("exampleTransitRouterRouteTable", TransitRouterRouteTableArgs.builder() .transitRouterId(exampleTransitRouter.transitRouterId()) .build()); var exampleTransitRouterRouteTableAssociation = new TransitRouterRouteTableAssociation("exampleTransitRouterRouteTableAssociation", TransitRouterRouteTableAssociationArgs.builder() .transitRouterRouteTableId(exampleTransitRouterRouteTable.transitRouterRouteTableId()) .transitRouterAttachmentId(exampleTransitRouterVpcAttachment.transitRouterAttachmentId()) .build()); } } ``` ## Import CEN transit router route table association can be imported using the id, e.g. ```sh $ pulumi import alicloud:cen/transitRouterRouteTableAssociation:TransitRouterRouteTableAssociation default tr-********:tr-attach-******** ```
    • 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
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> dryRun()  
      static TransitRouterRouteTableAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TransitRouterRouteTableAssociationState 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> status()  
      com.pulumi.core.Output<java.lang.String> transitRouterAttachmentId()  
      com.pulumi.core.Output<java.lang.String> transitRouterRouteTableId()  
      • 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

      • TransitRouterRouteTableAssociation

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

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

        public TransitRouterRouteTableAssociation​(java.lang.String name,
                                                  TransitRouterRouteTableAssociationArgs 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

      • dryRun

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> dryRun()
        Returns:
        The dry run. > **NOTE:** The Zone of CEN has MasterZone and SlaveZone, first zone_id of zone_mapping need be MasterZone. We have a API to describeZones[API](https://help.aliyun.com/document_detail/261356.html)
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        The associating status of the network.
      • transitRouterAttachmentId

        public com.pulumi.core.Output<java.lang.String> transitRouterAttachmentId()
        Returns:
        The ID the transit router attachment.
      • transitRouterRouteTableId

        public com.pulumi.core.Output<java.lang.String> transitRouterRouteTableId()
        Returns:
        The ID of the transit router route table.
      • get

        public static TransitRouterRouteTableAssociation get​(java.lang.String name,
                                                             com.pulumi.core.Output<java.lang.String> id,
                                                             @Nullable
                                                             TransitRouterRouteTableAssociationState 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.