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:
- Next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- Prefix
List stringId The ID of the prefix list.
- Transit
Router stringId The ID of the transit router.
- Transit
Router stringTable Id The ID of the route table of the transit router.
- Next
Hop stringType The type of the next hop. Valid values:
- Owner
Uid int The ID of the Alibaba Cloud account to which the prefix list belongs.
- Next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- Prefix
List stringId The ID of the prefix list.
- Transit
Router stringId The ID of the transit router.
- Transit
Router stringTable Id The ID of the route table of the transit router.
- Next
Hop stringType The type of the next hop. Valid values:
- Owner
Uid int The ID of the Alibaba Cloud account to which the prefix list belongs.
- next
Hop String The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- prefix
List StringId The ID of the prefix list.
- transit
Router StringId The ID of the transit router.
- transit
Router StringTable Id The ID of the route table of the transit router.
- next
Hop StringType The type of the next hop. Valid values:
- owner
Uid Integer The ID of the Alibaba Cloud account to which the prefix list belongs.
- next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- prefix
List stringId The ID of the prefix list.
- transit
Router stringId The ID of the transit router.
- transit
Router stringTable Id The ID of the route table of the transit router.
- next
Hop stringType The type of the next hop. Valid values:
- owner
Uid 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 toBlackHole
, you must set this parameter toBlackHole
.- prefix_
list_ strid The ID of the prefix list.
- transit_
router_ strid The ID of the transit router.
- transit_
router_ strtable_ id The ID of the route table of the transit router.
- next_
hop_ strtype The type of the next hop. Valid values:
- owner_
uid int The ID of the Alibaba Cloud account to which the prefix list belongs.
- next
Hop String The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- prefix
List StringId The ID of the prefix list.
- transit
Router StringId The ID of the transit router.
- transit
Router StringTable Id The ID of the route table of the transit router.
- next
Hop StringType The type of the next hop. Valid values:
- owner
Uid 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:
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.
- Next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- Next
Hop stringType 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 stringId The ID of the prefix list.
- Status string
The status of the prefix list.
- Transit
Router stringId The ID of the transit router.
- Transit
Router stringTable Id The ID of the route table of the transit router.
- Next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- Next
Hop stringType 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 stringId The ID of the prefix list.
- Status string
The status of the prefix list.
- Transit
Router stringId The ID of the transit router.
- Transit
Router stringTable Id The ID of the route table of the transit router.
- next
Hop String The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- next
Hop StringType The type of the next hop. Valid values:
- owner
Uid Integer The ID of the Alibaba Cloud account to which the prefix list belongs.
- prefix
List StringId The ID of the prefix list.
- status String
The status of the prefix list.
- transit
Router StringId The ID of the transit router.
- transit
Router StringTable Id The ID of the route table of the transit router.
- next
Hop string The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- next
Hop stringType The type of the next hop. Valid values:
- owner
Uid number The ID of the Alibaba Cloud account to which the prefix list belongs.
- prefix
List stringId The ID of the prefix list.
- status string
The status of the prefix list.
- transit
Router stringId The ID of the transit router.
- transit
Router stringTable Id 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 toBlackHole
, you must set this parameter toBlackHole
.- next_
hop_ strtype 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_ strid The ID of the prefix list.
- status str
The status of the prefix list.
- transit_
router_ strid The ID of the transit router.
- transit_
router_ strtable_ id The ID of the route table of the transit router.
- next
Hop String The ID of the next hop. NOTE: If
next_hop
is set toBlackHole
, you must set this parameter toBlackHole
.- next
Hop StringType The type of the next hop. Valid values:
- owner
Uid Number The ID of the Alibaba Cloud account to which the prefix list belongs.
- prefix
List StringId The ID of the prefix list.
- status String
The status of the prefix list.
- transit
Router StringId The ID of the transit router.
- transit
Router StringTable Id 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.