1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. TransitRouterPrefixListAssociation
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.cen.TransitRouterPrefixListAssociation

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a Cloud Enterprise Network (CEN) Transit Router Prefix List Association resource.

    For information about Cloud Enterprise Network (CEN) Transit Router Prefix List Association and how to use it, see What is Transit Router Prefix List Association.

    NOTE: Available since v1.188.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.getAccount({});
    const examplePrefixList = new alicloud.vpc.PrefixList("examplePrefixList", {entrys: [{
        cidr: "192.168.0.0/16",
    }]});
    const exampleInstance = new alicloud.cen.Instance("exampleInstance", {
        cenInstanceName: "tf_example",
        description: "an example for cen",
    });
    const exampleTransitRouter = new alicloud.cen.TransitRouter("exampleTransitRouter", {
        transitRouterName: "tf_example",
        cenId: exampleInstance.id,
    });
    const exampleTransitRouterRouteTable = new alicloud.cen.TransitRouterRouteTable("exampleTransitRouterRouteTable", {transitRouterId: exampleTransitRouter.transitRouterId});
    const exampleTransitRouterPrefixListAssociation = new alicloud.cen.TransitRouterPrefixListAssociation("exampleTransitRouterPrefixListAssociation", {
        prefixListId: examplePrefixList.id,
        transitRouterId: exampleTransitRouter.transitRouterId,
        transitRouterTableId: exampleTransitRouterRouteTable.transitRouterRouteTableId,
        nextHop: "BlackHole",
        nextHopType: "BlackHole",
        ownerUid: _default.then(_default => _default.id),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.get_account()
    example_prefix_list = alicloud.vpc.PrefixList("examplePrefixList", entrys=[alicloud.vpc.PrefixListEntryArgs(
        cidr="192.168.0.0/16",
    )])
    example_instance = alicloud.cen.Instance("exampleInstance",
        cen_instance_name="tf_example",
        description="an example for cen")
    example_transit_router = alicloud.cen.TransitRouter("exampleTransitRouter",
        transit_router_name="tf_example",
        cen_id=example_instance.id)
    example_transit_router_route_table = alicloud.cen.TransitRouterRouteTable("exampleTransitRouterRouteTable", transit_router_id=example_transit_router.transit_router_id)
    example_transit_router_prefix_list_association = alicloud.cen.TransitRouterPrefixListAssociation("exampleTransitRouterPrefixListAssociation",
        prefix_list_id=example_prefix_list.id,
        transit_router_id=example_transit_router.transit_router_id,
        transit_router_table_id=example_transit_router_route_table.transit_router_route_table_id,
        next_hop="BlackHole",
        next_hop_type="BlackHole",
        owner_uid=default.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := alicloud.GetAccount(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		examplePrefixList, err := vpc.NewPrefixList(ctx, "examplePrefixList", &vpc.PrefixListArgs{
    			Entrys: vpc.PrefixListEntryArray{
    				&vpc.PrefixListEntryArgs{
    					Cidr: pulumi.String("192.168.0.0/16"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleInstance, err := cen.NewInstance(ctx, "exampleInstance", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String("tf_example"),
    			Description:     pulumi.String("an example for cen"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitRouter, err := cen.NewTransitRouter(ctx, "exampleTransitRouter", &cen.TransitRouterArgs{
    			TransitRouterName: pulumi.String("tf_example"),
    			CenId:             exampleInstance.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitRouterRouteTable, err := cen.NewTransitRouterRouteTable(ctx, "exampleTransitRouterRouteTable", &cen.TransitRouterRouteTableArgs{
    			TransitRouterId: exampleTransitRouter.TransitRouterId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewTransitRouterPrefixListAssociation(ctx, "exampleTransitRouterPrefixListAssociation", &cen.TransitRouterPrefixListAssociationArgs{
    			PrefixListId:         examplePrefixList.ID(),
    			TransitRouterId:      exampleTransitRouter.TransitRouterId,
    			TransitRouterTableId: exampleTransitRouterRouteTable.TransitRouterRouteTableId,
    			NextHop:              pulumi.String("BlackHole"),
    			NextHopType:          pulumi.String("BlackHole"),
    			OwnerUid:             pulumi.String(_default.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.GetAccount.Invoke();
    
        var examplePrefixList = new AliCloud.Vpc.PrefixList("examplePrefixList", new()
        {
            Entrys = new[]
            {
                new AliCloud.Vpc.Inputs.PrefixListEntryArgs
                {
                    Cidr = "192.168.0.0/16",
                },
            },
        });
    
        var exampleInstance = new AliCloud.Cen.Instance("exampleInstance", new()
        {
            CenInstanceName = "tf_example",
            Description = "an example for cen",
        });
    
        var exampleTransitRouter = new AliCloud.Cen.TransitRouter("exampleTransitRouter", new()
        {
            TransitRouterName = "tf_example",
            CenId = exampleInstance.Id,
        });
    
        var exampleTransitRouterRouteTable = new AliCloud.Cen.TransitRouterRouteTable("exampleTransitRouterRouteTable", new()
        {
            TransitRouterId = exampleTransitRouter.TransitRouterId,
        });
    
        var exampleTransitRouterPrefixListAssociation = new AliCloud.Cen.TransitRouterPrefixListAssociation("exampleTransitRouterPrefixListAssociation", new()
        {
            PrefixListId = examplePrefixList.Id,
            TransitRouterId = exampleTransitRouter.TransitRouterId,
            TransitRouterTableId = exampleTransitRouterRouteTable.TransitRouterRouteTableId,
            NextHop = "BlackHole",
            NextHopType = "BlackHole",
            OwnerUid = @default.Apply(@default => @default.Apply(getAccountResult => getAccountResult.Id)),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.vpc.PrefixList;
    import com.pulumi.alicloud.vpc.PrefixListArgs;
    import com.pulumi.alicloud.vpc.inputs.PrefixListEntryArgs;
    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.TransitRouterRouteTable;
    import com.pulumi.alicloud.cen.TransitRouterRouteTableArgs;
    import com.pulumi.alicloud.cen.TransitRouterPrefixListAssociation;
    import com.pulumi.alicloud.cen.TransitRouterPrefixListAssociationArgs;
    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 default = AlicloudFunctions.getAccount();
    
            var examplePrefixList = new PrefixList("examplePrefixList", PrefixListArgs.builder()        
                .entrys(PrefixListEntryArgs.builder()
                    .cidr("192.168.0.0/16")
                    .build())
                .build());
    
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()        
                .cenInstanceName("tf_example")
                .description("an example for cen")
                .build());
    
            var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder()        
                .transitRouterName("tf_example")
                .cenId(exampleInstance.id())
                .build());
    
            var exampleTransitRouterRouteTable = new TransitRouterRouteTable("exampleTransitRouterRouteTable", TransitRouterRouteTableArgs.builder()        
                .transitRouterId(exampleTransitRouter.transitRouterId())
                .build());
    
            var exampleTransitRouterPrefixListAssociation = new TransitRouterPrefixListAssociation("exampleTransitRouterPrefixListAssociation", TransitRouterPrefixListAssociationArgs.builder()        
                .prefixListId(examplePrefixList.id())
                .transitRouterId(exampleTransitRouter.transitRouterId())
                .transitRouterTableId(exampleTransitRouterRouteTable.transitRouterRouteTableId())
                .nextHop("BlackHole")
                .nextHopType("BlackHole")
                .ownerUid(default_.id())
                .build());
    
        }
    }
    
    resources:
      examplePrefixList:
        type: alicloud:vpc:PrefixList
        properties:
          entrys:
            - cidr: 192.168.0.0/16
      exampleInstance:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: tf_example
          description: an example for cen
      exampleTransitRouter:
        type: alicloud:cen:TransitRouter
        properties:
          transitRouterName: tf_example
          cenId: ${exampleInstance.id}
      exampleTransitRouterRouteTable:
        type: alicloud:cen:TransitRouterRouteTable
        properties:
          transitRouterId: ${exampleTransitRouter.transitRouterId}
      exampleTransitRouterPrefixListAssociation:
        type: alicloud:cen:TransitRouterPrefixListAssociation
        properties:
          prefixListId: ${examplePrefixList.id}
          transitRouterId: ${exampleTransitRouter.transitRouterId}
          transitRouterTableId: ${exampleTransitRouterRouteTable.transitRouterRouteTableId}
          nextHop: BlackHole
          nextHopType: BlackHole
          ownerUid: ${default.id}
    variables:
      default:
        fn::invoke:
          Function: alicloud:getAccount
          Arguments: {}
    

    Create TransitRouterPrefixListAssociation Resource

    new TransitRouterPrefixListAssociation(name: string, args: TransitRouterPrefixListAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def TransitRouterPrefixListAssociation(resource_name: str,
                                           opts: Optional[ResourceOptions] = None,
                                           next_hop: Optional[str] = None,
                                           next_hop_type: Optional[str] = None,
                                           owner_uid: Optional[int] = None,
                                           prefix_list_id: Optional[str] = None,
                                           transit_router_id: Optional[str] = None,
                                           transit_router_table_id: Optional[str] = None)
    @overload
    def TransitRouterPrefixListAssociation(resource_name: str,
                                           args: TransitRouterPrefixListAssociationArgs,
                                           opts: Optional[ResourceOptions] = None)
    func NewTransitRouterPrefixListAssociation(ctx *Context, name string, args TransitRouterPrefixListAssociationArgs, opts ...ResourceOption) (*TransitRouterPrefixListAssociation, error)
    public TransitRouterPrefixListAssociation(string name, TransitRouterPrefixListAssociationArgs args, CustomResourceOptions? opts = null)
    public TransitRouterPrefixListAssociation(String name, TransitRouterPrefixListAssociationArgs args)
    public TransitRouterPrefixListAssociation(String name, TransitRouterPrefixListAssociationArgs args, CustomResourceOptions options)
    
    type: alicloud:cen:TransitRouterPrefixListAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args TransitRouterPrefixListAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TransitRouterPrefixListAssociationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TransitRouterPrefixListAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TransitRouterPrefixListAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TransitRouterPrefixListAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TransitRouterPrefixListAssociation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The TransitRouterPrefixListAssociation resource accepts the following input properties:

    NextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    PrefixListId string
    The ID of the prefix list.
    TransitRouterId string
    The ID of the transit router.
    TransitRouterTableId string
    The ID of the route table of the transit router.
    NextHopType string
    The type of the next hop. Valid values:
    OwnerUid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    NextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    PrefixListId string
    The ID of the prefix list.
    TransitRouterId string
    The ID of the transit router.
    TransitRouterTableId string
    The ID of the route table of the transit router.
    NextHopType string
    The type of the next hop. Valid values:
    OwnerUid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    nextHop String
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    prefixListId String
    The ID of the prefix list.
    transitRouterId String
    The ID of the transit router.
    transitRouterTableId String
    The ID of the route table of the transit router.
    nextHopType String
    The type of the next hop. Valid values:
    ownerUid Integer
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    nextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    prefixListId string
    The ID of the prefix list.
    transitRouterId string
    The ID of the transit router.
    transitRouterTableId string
    The ID of the route table of the transit router.
    nextHopType string
    The type of the next hop. Valid values:
    ownerUid number
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    next_hop str
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    prefix_list_id str
    The ID of the prefix list.
    transit_router_id str
    The ID of the transit router.
    transit_router_table_id str
    The ID of the route table of the transit router.
    next_hop_type str
    The type of the next hop. Valid values:
    owner_uid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    nextHop String
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    prefixListId String
    The ID of the prefix list.
    transitRouterId String
    The ID of the transit router.
    transitRouterTableId String
    The ID of the route table of the transit router.
    nextHopType String
    The type of the next hop. Valid values:
    ownerUid Number
    The ID of the Alibaba Cloud account to which the prefix list belongs.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TransitRouterPrefixListAssociation resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the prefix list.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the prefix list.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the prefix list.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the prefix list.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the prefix list.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the prefix list.

    Look up Existing TransitRouterPrefixListAssociation Resource

    Get an existing TransitRouterPrefixListAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TransitRouterPrefixListAssociationState, opts?: CustomResourceOptions): TransitRouterPrefixListAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            next_hop: Optional[str] = None,
            next_hop_type: Optional[str] = None,
            owner_uid: Optional[int] = None,
            prefix_list_id: Optional[str] = None,
            status: Optional[str] = None,
            transit_router_id: Optional[str] = None,
            transit_router_table_id: Optional[str] = None) -> TransitRouterPrefixListAssociation
    func GetTransitRouterPrefixListAssociation(ctx *Context, name string, id IDInput, state *TransitRouterPrefixListAssociationState, opts ...ResourceOption) (*TransitRouterPrefixListAssociation, error)
    public static TransitRouterPrefixListAssociation Get(string name, Input<string> id, TransitRouterPrefixListAssociationState? state, CustomResourceOptions? opts = null)
    public static TransitRouterPrefixListAssociation get(String name, Output<String> id, TransitRouterPrefixListAssociationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    NextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    NextHopType string
    The type of the next hop. Valid values:
    OwnerUid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    PrefixListId string
    The ID of the prefix list.
    Status string
    The status of the prefix list.
    TransitRouterId string
    The ID of the transit router.
    TransitRouterTableId string
    The ID of the route table of the transit router.
    NextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    NextHopType string
    The type of the next hop. Valid values:
    OwnerUid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    PrefixListId string
    The ID of the prefix list.
    Status string
    The status of the prefix list.
    TransitRouterId string
    The ID of the transit router.
    TransitRouterTableId string
    The ID of the route table of the transit router.
    nextHop String
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    nextHopType String
    The type of the next hop. Valid values:
    ownerUid Integer
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    prefixListId String
    The ID of the prefix list.
    status String
    The status of the prefix list.
    transitRouterId String
    The ID of the transit router.
    transitRouterTableId String
    The ID of the route table of the transit router.
    nextHop string
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    nextHopType string
    The type of the next hop. Valid values:
    ownerUid number
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    prefixListId string
    The ID of the prefix list.
    status string
    The status of the prefix list.
    transitRouterId string
    The ID of the transit router.
    transitRouterTableId string
    The ID of the route table of the transit router.
    next_hop str
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    next_hop_type str
    The type of the next hop. Valid values:
    owner_uid int
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    prefix_list_id str
    The ID of the prefix list.
    status str
    The status of the prefix list.
    transit_router_id str
    The ID of the transit router.
    transit_router_table_id str
    The ID of the route table of the transit router.
    nextHop String
    The ID of the next hop. NOTE: If next_hop is set to BlackHole, you must set this parameter to BlackHole.
    nextHopType String
    The type of the next hop. Valid values:
    ownerUid Number
    The ID of the Alibaba Cloud account to which the prefix list belongs.
    prefixListId String
    The ID of the prefix list.
    status String
    The status of the prefix list.
    transitRouterId String
    The ID of the transit router.
    transitRouterTableId String
    The ID of the route table of the transit router.

    Import

    Cloud Enterprise Network (CEN) Transit Router Prefix List Association can be imported using the id, e.g.

    $ pulumi import alicloud:cen/transitRouterPrefixListAssociation:TransitRouterPrefixListAssociation default <prefix_list_id>:<transit_router_id>:<transit_router_table_id>:<next_hop>.
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi