BandwidthLimit

class BandwidthLimit : KotlinCustomResource

Provides a CEN cross-regional interconnection bandwidth resource. To connect networks in different regions, you must set cross-region interconnection bandwidth after buying a bandwidth package. The total bandwidth set for all the interconnected regions of a bandwidth package cannot exceed the bandwidth of the bandwidth package. By default, 1 Kbps bandwidth is provided for connectivity test. To run normal business, you must buy a bandwidth package and set a proper interconnection bandwidth. For example, a CEN instance is bound to a bandwidth package of 20 Mbps and the interconnection areas are Mainland China and North America. You can set the cross-region interconnection bandwidth between US West 1 and China East 1, China East 2, China South 1, and so on. However, the total bandwidth set for all the interconnected regions cannot exceed 20 Mbps. For information about CEN and how to use it, see Cross-region interconnection bandwidth

NOTE: Available since v1.18.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.Provider;
import com.pulumi.alicloud.ProviderArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.cen.Instance;
import com.pulumi.alicloud.cen.InstanceArgs;
import com.pulumi.alicloud.cen.InstanceAttachment;
import com.pulumi.alicloud.cen.InstanceAttachmentArgs;
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.BandwidthLimit;
import com.pulumi.alicloud.cen.BandwidthLimitArgs;
import com.pulumi.resources.CustomResourceOptions;
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 region1 = config.get("region1").orElse("eu-central-1");
final var region2 = config.get("region2").orElse("ap-southeast-1");
var ec = new Provider("ec", ProviderArgs.builder()
.region(region1)
.build());
var as = new Provider("as", ProviderArgs.builder()
.region(region2)
.build());
var vpc1 = new Network("vpc1", NetworkArgs.builder()
.vpcName("tf-example")
.cidrBlock("192.168.0.0/16")
.build(), CustomResourceOptions.builder()
.provider(alicloud.ec())
.build());
var vpc2 = new Network("vpc2", NetworkArgs.builder()
.vpcName("tf-example")
.cidrBlock("172.16.0.0/12")
.build(), CustomResourceOptions.builder()
.provider(alicloud.as())
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.cenInstanceName("tf_example")
.description("an example for cen")
.build());
var example1 = new InstanceAttachment("example1", InstanceAttachmentArgs.builder()
.instanceId(exampleInstance.id())
.childInstanceId(vpc1.id())
.childInstanceType("VPC")
.childInstanceRegionId(region1)
.build());
var example2 = new InstanceAttachment("example2", InstanceAttachmentArgs.builder()
.instanceId(exampleInstance.id())
.childInstanceId(vpc2.id())
.childInstanceType("VPC")
.childInstanceRegionId(region2)
.build());
var exampleBandwidthPackage = new BandwidthPackage("exampleBandwidthPackage", BandwidthPackageArgs.builder()
.bandwidth(5)
.cenBandwidthPackageName("tf_example")
.geographicRegionAId("Europe")
.geographicRegionBId("Asia-Pacific")
.build());
var exampleBandwidthPackageAttachment = new BandwidthPackageAttachment("exampleBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
.instanceId(exampleInstance.id())
.bandwidthPackageId(exampleBandwidthPackage.id())
.build());
var exampleBandwidthLimit = new BandwidthLimit("exampleBandwidthLimit", BandwidthLimitArgs.builder()
.instanceId(exampleBandwidthPackageAttachment.instanceId())
.regionIds(
example1.childInstanceRegionId(),
example2.childInstanceRegionId())
.bandwidthLimit(4)
.build());
}
}

Import

CEN bandwidth limit can be imported using the id, e.g.

$ pulumi import alicloud:cen/bandwidthLimit:BandwidthLimit example cen-abc123456:cn-beijing:eu-west-1

Properties

Link copied to clipboard
val bandwidthLimit: Output<Int>

The bandwidth configured for the interconnected regions communication. ->NOTE: The "alicloud_cen_bandwidthlimit" resource depends on the related "alicloud.cen.BandwidthPackageAttachment" resource and "alicloud.cen.InstanceAttachment" resource.

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

The ID of the CEN.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val regionIds: Output<List<String>>

List of the two regions to interconnect. Must be two different regions.

Link copied to clipboard
val urn: Output<String>