alicloud.cen.TransitRouterCidr
Explore with Pulumi AI
Provides a Cloud Enterprise Network (CEN) Transit Router Cidr resource.
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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args TransitRouterCidrArgs
- 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 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 string
- The unique name of the resource.
- args TransitRouterCidrArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TransitRouterCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var transitRouterCidrResource = new TransitRouterCidr("transitRouterCidrResource", TransitRouterCidrArgs.builder()
    .cidr("string")
    .transitRouterId("string")
    .description("string")
    .publishCidrRoute(false)
    .transitRouterCidrName("string")
    .build());
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")
const transitRouterCidrResource = new alicloud.cen.TransitRouterCidr("transitRouterCidrResource", {
    cidr: "string",
    transitRouterId: "string",
    description: "string",
    publishCidrRoute: false,
    transitRouterCidrName: "string",
});
type: alicloud:cen:TransitRouterCidr
properties:
    cidr: string
    description: string
    publishCidrRoute: false
    transitRouterCidrName: string
    transitRouterId: string
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 string
- The cidr of the transit router.
- TransitRouter stringId 
- The ID of the transit router.
- Description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- PublishCidr boolRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- TransitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- Cidr string
- The cidr of the transit router.
- TransitRouter stringId 
- The ID of the transit router.
- Description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- PublishCidr boolRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- TransitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- cidr String
- The cidr of the transit router.
- transitRouter StringId 
- The ID of the transit router.
- description String
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr BooleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter StringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- cidr string
- The cidr of the transit router.
- transitRouter stringId 
- The ID of the transit router.
- description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr booleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- cidr str
- The cidr of the transit router.
- transit_router_ strid 
- The ID of the transit router.
- description str
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publish_cidr_ boolroute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transit_router_ strcidr_ name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- cidr String
- The cidr of the transit router.
- transitRouter StringId 
- The ID of the transit router.
- description String
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr BooleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter StringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
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.
- TransitRouter stringCidr Id 
- The ID of the transit router cidr.
- Id string
- The provider-assigned unique ID for this managed resource.
- TransitRouter stringCidr Id 
- The ID of the transit router cidr.
- id String
- The provider-assigned unique ID for this managed resource.
- transitRouter StringCidr Id 
- The ID of the transit router cidr.
- id string
- The provider-assigned unique ID for this managed resource.
- transitRouter stringCidr Id 
- The ID of the transit router cidr.
- id str
- The provider-assigned unique ID for this managed resource.
- transit_router_ strcidr_ id 
- The ID of the transit router cidr.
- id String
- The provider-assigned unique ID for this managed resource.
- transitRouter StringCidr Id 
- The ID of the transit router cidr.
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) -> TransitRouterCidrfunc 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
- 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.
- Cidr string
- The cidr of the transit router.
- Description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- PublishCidr boolRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- TransitRouter stringCidr Id 
- The ID of the transit router cidr.
- TransitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- TransitRouter stringId 
- The ID of the transit router.
- Cidr string
- The cidr of the transit router.
- Description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- PublishCidr boolRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- TransitRouter stringCidr Id 
- The ID of the transit router cidr.
- TransitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- TransitRouter stringId 
- The ID of the transit router.
- cidr String
- The cidr of the transit router.
- description String
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr BooleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter StringCidr Id 
- The ID of the transit router cidr.
- transitRouter StringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- transitRouter StringId 
- The ID of the transit router.
- cidr string
- The cidr of the transit router.
- description string
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr booleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter stringCidr Id 
- The ID of the transit router cidr.
- transitRouter stringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- transitRouter stringId 
- The ID of the transit router.
- cidr str
- The cidr of the transit router.
- description str
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publish_cidr_ boolroute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transit_router_ strcidr_ id 
- The ID of the transit router cidr.
- transit_router_ strcidr_ name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- transit_router_ strid 
- The ID of the transit router.
- cidr String
- The cidr of the transit router.
- description String
- The description of the transit router. The description must be 2to256characters in length, and it must start with English letters, but cannot start withhttp://orhttps://.
- publishCidr BooleanRoute 
- Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table. Valid values: trueandfalse. Default value:true.
- transitRouter StringCidr Id 
- The ID of the transit router cidr.
- transitRouter StringCidr Name 
- The name of the transit router. The name must be 2to128characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start withhttp://orhttps://.
- transitRouter StringId 
- 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 default <transit_router_id>:<transit_router_cidr_id>.
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 alicloudTerraform Provider.