1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cen
  5. TransitRouterCidr
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cen.TransitRouterCidr

Explore with Pulumi AI

Provides a Cloud Enterprise Network (CEN) Transit Router Cidr resource.

Used for Vpn Attachment, Connect Attachment, etc. Assign address segments.

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

NOTE: Available since v1.193.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.cen.Instance("example", {
    cenInstanceName: "tf_example",
    description: "an example for cen",
});
const exampleTransitRouter = new alicloud.cen.TransitRouter("example", {
    transitRouterName: "tf_example",
    cenId: example.id,
});
const exampleTransitRouterCidr = new alicloud.cen.TransitRouterCidr("example", {
    transitRouterId: exampleTransitRouter.transitRouterId,
    cidr: "192.168.0.0/16",
    transitRouterCidrName: "tf_example",
    description: "tf_example",
    publishCidrRoute: true,
});
Copy
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.cen.Instance("example",
    cen_instance_name="tf_example",
    description="an example for cen")
example_transit_router = alicloud.cen.TransitRouter("example",
    transit_router_name="tf_example",
    cen_id=example.id)
example_transit_router_cidr = alicloud.cen.TransitRouterCidr("example",
    transit_router_id=example_transit_router.transit_router_id,
    cidr="192.168.0.0/16",
    transit_router_cidr_name="tf_example",
    description="tf_example",
    publish_cidr_route=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := cen.NewInstance(ctx, "example", &cen.InstanceArgs{
			CenInstanceName: pulumi.String("tf_example"),
			Description:     pulumi.String("an example for cen"),
		})
		if err != nil {
			return err
		}
		exampleTransitRouter, err := cen.NewTransitRouter(ctx, "example", &cen.TransitRouterArgs{
			TransitRouterName: pulumi.String("tf_example"),
			CenId:             example.ID(),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterCidr(ctx, "example", &cen.TransitRouterCidrArgs{
			TransitRouterId:       exampleTransitRouter.TransitRouterId,
			Cidr:                  pulumi.String("192.168.0.0/16"),
			TransitRouterCidrName: pulumi.String("tf_example"),
			Description:           pulumi.String("tf_example"),
			PublishCidrRoute:      pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = new AliCloud.Cen.Instance("example", new()
    {
        CenInstanceName = "tf_example",
        Description = "an example for cen",
    });

    var exampleTransitRouter = new AliCloud.Cen.TransitRouter("example", new()
    {
        TransitRouterName = "tf_example",
        CenId = example.Id,
    });

    var exampleTransitRouterCidr = new AliCloud.Cen.TransitRouterCidr("example", new()
    {
        TransitRouterId = exampleTransitRouter.TransitRouterId,
        Cidr = "192.168.0.0/16",
        TransitRouterCidrName = "tf_example",
        Description = "tf_example",
        PublishCidrRoute = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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.TransitRouterCidr;
import com.pulumi.alicloud.cen.TransitRouterCidrArgs;
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) {
        var example = new Instance("example", InstanceArgs.builder()
            .cenInstanceName("tf_example")
            .description("an example for cen")
            .build());

        var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder()
            .transitRouterName("tf_example")
            .cenId(example.id())
            .build());

        var exampleTransitRouterCidr = new TransitRouterCidr("exampleTransitRouterCidr", TransitRouterCidrArgs.builder()
            .transitRouterId(exampleTransitRouter.transitRouterId())
            .cidr("192.168.0.0/16")
            .transitRouterCidrName("tf_example")
            .description("tf_example")
            .publishCidrRoute(true)
            .build());

    }
}
Copy
resources:
  example:
    type: alicloud:cen:Instance
    properties:
      cenInstanceName: tf_example
      description: an example for cen
  exampleTransitRouter:
    type: alicloud:cen:TransitRouter
    name: example
    properties:
      transitRouterName: tf_example
      cenId: ${example.id}
  exampleTransitRouterCidr:
    type: alicloud:cen:TransitRouterCidr
    name: example
    properties:
      transitRouterId: ${exampleTransitRouter.transitRouterId}
      cidr: 192.168.0.0/16
      transitRouterCidrName: tf_example
      description: tf_example
      publishCidrRoute: true
Copy

Create TransitRouterCidr Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TransitRouterCidr(name: string, args: TransitRouterCidrArgs, opts?: CustomResourceOptions);
@overload
def TransitRouterCidr(resource_name: str,
                      args: TransitRouterCidrArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def TransitRouterCidr(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      cidr: Optional[str] = None,
                      transit_router_id: Optional[str] = None,
                      description: Optional[str] = None,
                      publish_cidr_route: Optional[bool] = None,
                      transit_router_cidr_name: Optional[str] = None)
func NewTransitRouterCidr(ctx *Context, name string, args TransitRouterCidrArgs, opts ...ResourceOption) (*TransitRouterCidr, error)
public TransitRouterCidr(string name, TransitRouterCidrArgs args, CustomResourceOptions? opts = null)
public TransitRouterCidr(String name, TransitRouterCidrArgs args)
public TransitRouterCidr(String name, TransitRouterCidrArgs args, CustomResourceOptions options)
type: alicloud:cen:TransitRouterCidr
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TransitRouterCidrArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TransitRouterCidrArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TransitRouterCidrArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TransitRouterCidrArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TransitRouterCidrArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var transitRouterCidrResource = new AliCloud.Cen.TransitRouterCidr("transitRouterCidrResource", new()
{
    Cidr = "string",
    TransitRouterId = "string",
    Description = "string",
    PublishCidrRoute = false,
    TransitRouterCidrName = "string",
});
Copy
example, err := cen.NewTransitRouterCidr(ctx, "transitRouterCidrResource", &cen.TransitRouterCidrArgs{
	Cidr:                  pulumi.String("string"),
	TransitRouterId:       pulumi.String("string"),
	Description:           pulumi.String("string"),
	PublishCidrRoute:      pulumi.Bool(false),
	TransitRouterCidrName: pulumi.String("string"),
})
Copy
var transitRouterCidrResource = new TransitRouterCidr("transitRouterCidrResource", TransitRouterCidrArgs.builder()
    .cidr("string")
    .transitRouterId("string")
    .description("string")
    .publishCidrRoute(false)
    .transitRouterCidrName("string")
    .build());
Copy
transit_router_cidr_resource = alicloud.cen.TransitRouterCidr("transitRouterCidrResource",
    cidr="string",
    transit_router_id="string",
    description="string",
    publish_cidr_route=False,
    transit_router_cidr_name="string")
Copy
const transitRouterCidrResource = new alicloud.cen.TransitRouterCidr("transitRouterCidrResource", {
    cidr: "string",
    transitRouterId: "string",
    description: "string",
    publishCidrRoute: false,
    transitRouterCidrName: "string",
});
Copy
type: alicloud:cen:TransitRouterCidr
properties:
    cidr: string
    description: string
    publishCidrRoute: false
    transitRouterCidrName: string
    transitRouterId: string
Copy

TransitRouterCidr Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TransitRouterCidr resource accepts the following input properties:

Cidr This property is required. string
The new CIDR block of the transit router.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the transit router.
Description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
PublishCidrRoute bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
TransitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
Cidr This property is required. string
The new CIDR block of the transit router.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the transit router.
Description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
PublishCidrRoute bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
TransitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
cidr This property is required. String
The new CIDR block of the transit router.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the transit router.
description String
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute Boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrName String
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
cidr This property is required. string
The new CIDR block of the transit router.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the transit router.
description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
cidr This property is required. str
The new CIDR block of the transit router.
transit_router_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the transit router.
description str
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publish_cidr_route bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transit_router_cidr_name str
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
cidr This property is required. String
The new CIDR block of the transit router.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the transit router.
description String
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute Boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrName String
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
TransitRouterCidrId string
The ID of the CIDR block.
Id string
The provider-assigned unique ID for this managed resource.
TransitRouterCidrId string
The ID of the CIDR block.
id String
The provider-assigned unique ID for this managed resource.
transitRouterCidrId String
The ID of the CIDR block.
id string
The provider-assigned unique ID for this managed resource.
transitRouterCidrId string
The ID of the CIDR block.
id str
The provider-assigned unique ID for this managed resource.
transit_router_cidr_id str
The ID of the CIDR block.
id String
The provider-assigned unique ID for this managed resource.
transitRouterCidrId String
The ID of the CIDR block.

Look up Existing TransitRouterCidr Resource

Get an existing TransitRouterCidr 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?: TransitRouterCidrState, opts?: CustomResourceOptions): TransitRouterCidr
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cidr: Optional[str] = None,
        description: Optional[str] = None,
        publish_cidr_route: Optional[bool] = None,
        transit_router_cidr_id: Optional[str] = None,
        transit_router_cidr_name: Optional[str] = None,
        transit_router_id: Optional[str] = None) -> TransitRouterCidr
func GetTransitRouterCidr(ctx *Context, name string, id IDInput, state *TransitRouterCidrState, opts ...ResourceOption) (*TransitRouterCidr, error)
public static TransitRouterCidr Get(string name, Input<string> id, TransitRouterCidrState? state, CustomResourceOptions? opts = null)
public static TransitRouterCidr get(String name, Output<String> id, TransitRouterCidrState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cen:TransitRouterCidr    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Cidr string
The new CIDR block of the transit router.
Description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
PublishCidrRoute bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
TransitRouterCidrId string
The ID of the CIDR block.
TransitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
TransitRouterId Changes to this property will trigger replacement. string
The ID of the transit router.
Cidr string
The new CIDR block of the transit router.
Description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
PublishCidrRoute bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
TransitRouterCidrId string
The ID of the CIDR block.
TransitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
TransitRouterId Changes to this property will trigger replacement. string
The ID of the transit router.
cidr String
The new CIDR block of the transit router.
description String
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute Boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrId String
The ID of the CIDR block.
transitRouterCidrName String
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
transitRouterId Changes to this property will trigger replacement. String
The ID of the transit router.
cidr string
The new CIDR block of the transit router.
description string
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrId string
The ID of the CIDR block.
transitRouterCidrName string
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
transitRouterId Changes to this property will trigger replacement. string
The ID of the transit router.
cidr str
The new CIDR block of the transit router.
description str
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publish_cidr_route bool
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transit_router_cidr_id str
The ID of the CIDR block.
transit_router_cidr_name str
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
transit_router_id Changes to this property will trigger replacement. str
The ID of the transit router.
cidr String
The new CIDR block of the transit router.
description String
The new description of the transit router CIDR block. The description must be 1 to 256 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
publishCidrRoute Boolean
Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.
transitRouterCidrId String
The ID of the CIDR block.
transitRouterCidrName String
The new name of the transit router CIDR block. The name must be 1 to 128 characters in length, and cannot start with http:// or https://. You can also leave this parameter empty.
transitRouterId Changes to this property will trigger replacement. String
The ID of the transit router.

Import

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

$ pulumi import alicloud:cen/transitRouterCidr:TransitRouterCidr example <transit_router_id>:<transit_router_cidr_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.