TransitRouterPeerAttachment

class TransitRouterPeerAttachment : KotlinCustomResource

Provides a CEN transit router peer attachment resource that associate the transit router with the CEN instance. What is CEN transit router peer attachment

NOTE: Available since v1.128.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf_example";
const region = config.get("region") || "cn-hangzhou";
const peerRegion = config.get("peerRegion") || "cn-beijing";
const example = new alicloud.cen.Instance("example", {
cenInstanceName: name,
protectionLevel: "REDUCED",
});
const exampleBandwidthPackage = new alicloud.cen.BandwidthPackage("example", {
bandwidth: 5,
cenBandwidthPackageName: "tf_example",
geographicRegionAId: "China",
geographicRegionBId: "China",
});
const exampleBandwidthPackageAttachment = new alicloud.cen.BandwidthPackageAttachment("example", {
instanceId: example.id,
bandwidthPackageId: exampleBandwidthPackage.id,
});
const exampleTransitRouter = new alicloud.cen.TransitRouter("example", {cenId: exampleBandwidthPackageAttachment.instanceId});
const peer = new alicloud.cen.TransitRouter("peer", {cenId: exampleTransitRouter.cenId});
const exampleTransitRouterPeerAttachment = new alicloud.cen.TransitRouterPeerAttachment("example", {
cenId: example.id,
transitRouterId: exampleTransitRouter.transitRouterId,
peerTransitRouterRegionId: peerRegion,
peerTransitRouterId: peer.transitRouterId,
cenBandwidthPackageId: exampleBandwidthPackageAttachment.bandwidthPackageId,
bandwidth: 5,
transitRouterAttachmentDescription: name,
transitRouterAttachmentName: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf_example"
region = config.get("region")
if region is None:
region = "cn-hangzhou"
peer_region = config.get("peerRegion")
if peer_region is None:
peer_region = "cn-beijing"
example = alicloud.cen.Instance("example",
cen_instance_name=name,
protection_level="REDUCED")
example_bandwidth_package = alicloud.cen.BandwidthPackage("example",
bandwidth=5,
cen_bandwidth_package_name="tf_example",
geographic_region_a_id="China",
geographic_region_b_id="China")
example_bandwidth_package_attachment = alicloud.cen.BandwidthPackageAttachment("example",
instance_id=example.id,
bandwidth_package_id=example_bandwidth_package.id)
example_transit_router = alicloud.cen.TransitRouter("example", cen_id=example_bandwidth_package_attachment.instance_id)
peer = alicloud.cen.TransitRouter("peer", cen_id=example_transit_router.cen_id)
example_transit_router_peer_attachment = alicloud.cen.TransitRouterPeerAttachment("example",
cen_id=example.id,
transit_router_id=example_transit_router.transit_router_id,
peer_transit_router_region_id=peer_region,
peer_transit_router_id=peer.transit_router_id,
cen_bandwidth_package_id=example_bandwidth_package_attachment.bandwidth_package_id,
bandwidth=5,
transit_router_attachment_description=name,
transit_router_attachment_name=name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf_example";
var region = config.Get("region") ?? "cn-hangzhou";
var peerRegion = config.Get("peerRegion") ?? "cn-beijing";
var example = new AliCloud.Cen.Instance("example", new()
{
CenInstanceName = name,
ProtectionLevel = "REDUCED",
});
var exampleBandwidthPackage = new AliCloud.Cen.BandwidthPackage("example", new()
{
Bandwidth = 5,
CenBandwidthPackageName = "tf_example",
GeographicRegionAId = "China",
GeographicRegionBId = "China",
});
var exampleBandwidthPackageAttachment = new AliCloud.Cen.BandwidthPackageAttachment("example", new()
{
InstanceId = example.Id,
BandwidthPackageId = exampleBandwidthPackage.Id,
});
var exampleTransitRouter = new AliCloud.Cen.TransitRouter("example", new()
{
CenId = exampleBandwidthPackageAttachment.InstanceId,
});
var peer = new AliCloud.Cen.TransitRouter("peer", new()
{
CenId = exampleTransitRouter.CenId,
});
var exampleTransitRouterPeerAttachment = new AliCloud.Cen.TransitRouterPeerAttachment("example", new()
{
CenId = example.Id,
TransitRouterId = exampleTransitRouter.TransitRouterId,
PeerTransitRouterRegionId = peerRegion,
PeerTransitRouterId = peer.TransitRouterId,
CenBandwidthPackageId = exampleBandwidthPackageAttachment.BandwidthPackageId,
Bandwidth = 5,
TransitRouterAttachmentDescription = name,
TransitRouterAttachmentName = name,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf_example"
if param := cfg.Get("name"); param != "" {
name = param
}
region := "cn-hangzhou"
if param := cfg.Get("region"); param != "" {
region = param
}
peerRegion := "cn-beijing"
if param := cfg.Get("peerRegion"); param != "" {
peerRegion = param
}
example, err := cen.NewInstance(ctx, "example", &cen.InstanceArgs{
CenInstanceName: pulumi.String(name),
ProtectionLevel: pulumi.String("REDUCED"),
})
if err != nil {
return err
}
exampleBandwidthPackage, err := cen.NewBandwidthPackage(ctx, "example", &cen.BandwidthPackageArgs{
Bandwidth: pulumi.Int(5),
CenBandwidthPackageName: pulumi.String("tf_example"),
GeographicRegionAId: pulumi.String("China"),
GeographicRegionBId: pulumi.String("China"),
})
if err != nil {
return err
}
exampleBandwidthPackageAttachment, err := cen.NewBandwidthPackageAttachment(ctx, "example", &cen.BandwidthPackageAttachmentArgs{
InstanceId: example.ID(),
BandwidthPackageId: exampleBandwidthPackage.ID(),
})
if err != nil {
return err
}
exampleTransitRouter, err := cen.NewTransitRouter(ctx, "example", &cen.TransitRouterArgs{
CenId: exampleBandwidthPackageAttachment.InstanceId,
})
if err != nil {
return err
}
peer, err := cen.NewTransitRouter(ctx, "peer", &cen.TransitRouterArgs{
CenId: exampleTransitRouter.CenId,
})
if err != nil {
return err
}
_, err = cen.NewTransitRouterPeerAttachment(ctx, "example", &cen.TransitRouterPeerAttachmentArgs{
CenId: example.ID(),
TransitRouterId: exampleTransitRouter.TransitRouterId,
PeerTransitRouterRegionId: pulumi.String(peerRegion),
PeerTransitRouterId: peer.TransitRouterId,
CenBandwidthPackageId: exampleBandwidthPackageAttachment.BandwidthPackageId,
Bandwidth: pulumi.Int(5),
TransitRouterAttachmentDescription: pulumi.String(name),
TransitRouterAttachmentName: pulumi.String(name),
})
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.cen.Instance;
import com.pulumi.alicloud.cen.InstanceArgs;
import com.pulumi.alicloud.cen.BandwidthPackage;
import com.pulumi.alicloud.cen.BandwidthPackageArgs;
import com.pulumi.alicloud.cen.BandwidthPackageAttachment;
import com.pulumi.alicloud.cen.BandwidthPackageAttachmentArgs;
import com.pulumi.alicloud.cen.TransitRouter;
import com.pulumi.alicloud.cen.TransitRouterArgs;
import com.pulumi.alicloud.cen.TransitRouterPeerAttachment;
import com.pulumi.alicloud.cen.TransitRouterPeerAttachmentArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf_example");
final var region = config.get("region").orElse("cn-hangzhou");
final var peerRegion = config.get("peerRegion").orElse("cn-beijing");
var example = new Instance("example", InstanceArgs.builder()
.cenInstanceName(name)
.protectionLevel("REDUCED")
.build());
var exampleBandwidthPackage = new BandwidthPackage("exampleBandwidthPackage", BandwidthPackageArgs.builder()
.bandwidth(5)
.cenBandwidthPackageName("tf_example")
.geographicRegionAId("China")
.geographicRegionBId("China")
.build());
var exampleBandwidthPackageAttachment = new BandwidthPackageAttachment("exampleBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
.instanceId(example.id())
.bandwidthPackageId(exampleBandwidthPackage.id())
.build());
var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder()
.cenId(exampleBandwidthPackageAttachment.instanceId())
.build());
var peer = new TransitRouter("peer", TransitRouterArgs.builder()
.cenId(exampleTransitRouter.cenId())
.build());
var exampleTransitRouterPeerAttachment = new TransitRouterPeerAttachment("exampleTransitRouterPeerAttachment", TransitRouterPeerAttachmentArgs.builder()
.cenId(example.id())
.transitRouterId(exampleTransitRouter.transitRouterId())
.peerTransitRouterRegionId(peerRegion)
.peerTransitRouterId(peer.transitRouterId())
.cenBandwidthPackageId(exampleBandwidthPackageAttachment.bandwidthPackageId())
.bandwidth(5)
.transitRouterAttachmentDescription(name)
.transitRouterAttachmentName(name)
.build());
}
}
configuration:
name:
type: string
default: tf_example
region:
type: string
default: cn-hangzhou
peerRegion:
type: string
default: cn-beijing
resources:
example:
type: alicloud:cen:Instance
properties:
cenInstanceName: ${name}
protectionLevel: REDUCED
exampleBandwidthPackage:
type: alicloud:cen:BandwidthPackage
name: example
properties:
bandwidth: 5
cenBandwidthPackageName: tf_example
geographicRegionAId: China
geographicRegionBId: China
exampleBandwidthPackageAttachment:
type: alicloud:cen:BandwidthPackageAttachment
name: example
properties:
instanceId: ${example.id}
bandwidthPackageId: ${exampleBandwidthPackage.id}
exampleTransitRouter:
type: alicloud:cen:TransitRouter
name: example
properties:
cenId: ${exampleBandwidthPackageAttachment.instanceId}
peer:
type: alicloud:cen:TransitRouter
properties:
cenId: ${exampleTransitRouter.cenId}
exampleTransitRouterPeerAttachment:
type: alicloud:cen:TransitRouterPeerAttachment
name: example
properties:
cenId: ${example.id}
transitRouterId: ${exampleTransitRouter.transitRouterId}
peerTransitRouterRegionId: ${peerRegion}
peerTransitRouterId: ${peer.transitRouterId}
cenBandwidthPackageId: ${exampleBandwidthPackageAttachment.bandwidthPackageId}
bandwidth: 5
transitRouterAttachmentDescription: ${name}
transitRouterAttachmentName: ${name}

Import

CEN Transit Router Peer Attachment can be imported using the id, e.g.

$ pulumi import alicloud:cen/transitRouterPeerAttachment:TransitRouterPeerAttachment example <id>

Properties

Link copied to clipboard

Auto publish route enabled. The system default value is false.

Link copied to clipboard
val bandwidth: Output<Int>?

The bandwidth of the bandwidth package.

Link copied to clipboard
val bandwidthType: Output<String>

The method that is used to allocate bandwidth to the cross-region connection. Valid values: BandwidthPackage and DataTransfer.

Link copied to clipboard

The ID of the bandwidth package. If you do not enter the ID of the package, it means you are using the test. The system default test is 1bps, demonstrating that you test network connectivity

Link copied to clipboard
val cenId: Output<String>

The ID of the CEN.

Link copied to clipboard
val createTime: Output<String>

The creation time of the resource.

Link copied to clipboard
val defaultLinkType: Output<String>

DefaultLinkType. Valid values: Platinum and Gold.

Link copied to clipboard
val dryRun: Output<Boolean>?

Whether to perform pre-check for this request, including permission, instance status verification, etc.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The ID of the peer transit router.

Link copied to clipboard

The region ID of peer transit router.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceType: Output<String>?

The resource type to attachment. Only support VR and default value is VR.

Link copied to clipboard

Whether to association route table. System default is false.

Link copied to clipboard

Whether to propagation route table. System default is false.

Link copied to clipboard
val status: Output<String>

The status of the resource.

Link copied to clipboard

The description of transit router attachment. The description is 2~256 characters long and must start with a letter or Chinese, but cannot start with http:// or https://.

Link copied to clipboard

The ID of transit router attachment id.

Link copied to clipboard

The name of transit router attachment. The name is 2~128 characters in length, starts with uppercase and lowercase letters or Chinese, and can contain numbers, underscores (_) and dashes (-)

Link copied to clipboard
val transitRouterId: Output<String>?

The ID of the transit router to attach.

Link copied to clipboard
val urn: Output<String>