alicloud.cen.TransitRouterPrefixListAssociation

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 in v1.188.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultAccount = AliCloud.GetAccount.Invoke();

    var defaultPrefixList = new AliCloud.Vpc.PrefixList("defaultPrefixList", new()
    {
        Entrys = new[]
        {
            new AliCloud.Vpc.Inputs.PrefixListEntryArgs
            {
                Cidr = "192.168.0.0/16",
            },
        },
    });

    var defaultInstance = new AliCloud.Cen.Instance("defaultInstance", new()
    {
        CenInstanceName = "tf-example",
    });

    var defaultTransitRouter = new AliCloud.Cen.TransitRouter("defaultTransitRouter", new()
    {
        CenId = defaultInstance.Id,
    });

    var defaultTransitRouterRouteTable = new AliCloud.Cen.TransitRouterRouteTable("defaultTransitRouterRouteTable", new()
    {
        TransitRouterId = defaultTransitRouter.TransitRouterId,
    });

    var defaultTransitRouterPrefixListAssociation = new AliCloud.Cen.TransitRouterPrefixListAssociation("defaultTransitRouterPrefixListAssociation", new()
    {
        PrefixListId = defaultPrefixList.Id,
        TransitRouterId = defaultTransitRouter.TransitRouterId,
        TransitRouterTableId = defaultTransitRouterRouteTable.TransitRouterRouteTableId,
        NextHop = "BlackHole",
        NextHopType = "BlackHole",
        OwnerUid = defaultAccount.Apply(getAccountResult => getAccountResult.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 {
		defaultAccount, err := alicloud.GetAccount(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultPrefixList, err := vpc.NewPrefixList(ctx, "defaultPrefixList", &vpc.PrefixListArgs{
			Entrys: vpc.PrefixListEntryArray{
				&vpc.PrefixListEntryArgs{
					Cidr: pulumi.String("192.168.0.0/16"),
				},
			},
		})
		if err != nil {
			return err
		}
		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", &cen.InstanceArgs{
			CenInstanceName: pulumi.String("tf-example"),
		})
		if err != nil {
			return err
		}
		defaultTransitRouter, err := cen.NewTransitRouter(ctx, "defaultTransitRouter", &cen.TransitRouterArgs{
			CenId: defaultInstance.ID(),
		})
		if err != nil {
			return err
		}
		defaultTransitRouterRouteTable, err := cen.NewTransitRouterRouteTable(ctx, "defaultTransitRouterRouteTable", &cen.TransitRouterRouteTableArgs{
			TransitRouterId: defaultTransitRouter.TransitRouterId,
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterPrefixListAssociation(ctx, "defaultTransitRouterPrefixListAssociation", &cen.TransitRouterPrefixListAssociationArgs{
			PrefixListId:         defaultPrefixList.ID(),
			TransitRouterId:      defaultTransitRouter.TransitRouterId,
			TransitRouterTableId: defaultTransitRouterRouteTable.TransitRouterRouteTableId,
			NextHop:              pulumi.String("BlackHole"),
			NextHopType:          pulumi.String("BlackHole"),
			OwnerUid:             *pulumi.String(defaultAccount.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 defaultAccount = AlicloudFunctions.getAccount();

        var defaultPrefixList = new PrefixList("defaultPrefixList", PrefixListArgs.builder()        
            .entrys(PrefixListEntryArgs.builder()
                .cidr("192.168.0.0/16")
                .build())
            .build());

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
            .cenInstanceName("tf-example")
            .build());

        var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()        
            .cenId(defaultInstance.id())
            .build());

        var defaultTransitRouterRouteTable = new TransitRouterRouteTable("defaultTransitRouterRouteTable", TransitRouterRouteTableArgs.builder()        
            .transitRouterId(defaultTransitRouter.transitRouterId())
            .build());

        var defaultTransitRouterPrefixListAssociation = new TransitRouterPrefixListAssociation("defaultTransitRouterPrefixListAssociation", TransitRouterPrefixListAssociationArgs.builder()        
            .prefixListId(defaultPrefixList.id())
            .transitRouterId(defaultTransitRouter.transitRouterId())
            .transitRouterTableId(defaultTransitRouterRouteTable.transitRouterRouteTableId())
            .nextHop("BlackHole")
            .nextHopType("BlackHole")
            .ownerUid(defaultAccount.applyValue(getAccountResult -> getAccountResult.id()))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_account = alicloud.get_account()
default_prefix_list = alicloud.vpc.PrefixList("defaultPrefixList", entrys=[alicloud.vpc.PrefixListEntryArgs(
    cidr="192.168.0.0/16",
)])
default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name="tf-example")
default_transit_router = alicloud.cen.TransitRouter("defaultTransitRouter", cen_id=default_instance.id)
default_transit_router_route_table = alicloud.cen.TransitRouterRouteTable("defaultTransitRouterRouteTable", transit_router_id=default_transit_router.transit_router_id)
default_transit_router_prefix_list_association = alicloud.cen.TransitRouterPrefixListAssociation("defaultTransitRouterPrefixListAssociation",
    prefix_list_id=default_prefix_list.id,
    transit_router_id=default_transit_router.transit_router_id,
    transit_router_table_id=default_transit_router_route_table.transit_router_route_table_id,
    next_hop="BlackHole",
    next_hop_type="BlackHole",
    owner_uid=default_account.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultAccount = alicloud.getAccount({});
const defaultPrefixList = new alicloud.vpc.PrefixList("defaultPrefixList", {entrys: [{
    cidr: "192.168.0.0/16",
}]});
const defaultInstance = new alicloud.cen.Instance("defaultInstance", {cenInstanceName: "tf-example"});
const defaultTransitRouter = new alicloud.cen.TransitRouter("defaultTransitRouter", {cenId: defaultInstance.id});
const defaultTransitRouterRouteTable = new alicloud.cen.TransitRouterRouteTable("defaultTransitRouterRouteTable", {transitRouterId: defaultTransitRouter.transitRouterId});
const defaultTransitRouterPrefixListAssociation = new alicloud.cen.TransitRouterPrefixListAssociation("defaultTransitRouterPrefixListAssociation", {
    prefixListId: defaultPrefixList.id,
    transitRouterId: defaultTransitRouter.transitRouterId,
    transitRouterTableId: defaultTransitRouterRouteTable.transitRouterRouteTableId,
    nextHop: "BlackHole",
    nextHopType: "BlackHole",
    ownerUid: defaultAccount.then(defaultAccount => defaultAccount.id),
});
resources:
  defaultPrefixList:
    type: alicloud:vpc:PrefixList
    properties:
      entrys:
        - cidr: 192.168.0.0/16
  defaultInstance:
    type: alicloud:cen:Instance
    properties:
      cenInstanceName: tf-example
  defaultTransitRouter:
    type: alicloud:cen:TransitRouter
    properties:
      cenId: ${defaultInstance.id}
  defaultTransitRouterRouteTable:
    type: alicloud:cen:TransitRouterRouteTable
    properties:
      transitRouterId: ${defaultTransitRouter.transitRouterId}
  defaultTransitRouterPrefixListAssociation:
    type: alicloud:cen:TransitRouterPrefixListAssociation
    properties:
      prefixListId: ${defaultPrefixList.id}
      transitRouterId: ${defaultTransitRouter.transitRouterId}
      transitRouterTableId: ${defaultTransitRouterRouteTable.transitRouterRouteTableId}
      nextHop: BlackHole
      nextHopType: BlackHole
      ownerUid: ${defaultAccount.id}
variables:
  defaultAccount:
    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.