1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CcnBandwidthLimit
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.CcnBandwidthLimit

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to limit CCN bandwidth.

    Example Usage

    Set the upper limit of regional outbound bandwidth

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const config = new pulumi.Config();
    const otherRegion1 = config.get("otherRegion1") || "ap-shanghai";
    const main = new tencentcloud.Ccn("main", {
        description: "ci-temp-test-ccn-des",
        qos: "AG",
    });
    const limit1 = new tencentcloud.CcnBandwidthLimit("limit1", {
        ccnId: main.ccnId,
        region: otherRegion1,
        bandwidthLimit: 500,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    config = pulumi.Config()
    other_region1 = config.get("otherRegion1")
    if other_region1 is None:
        other_region1 = "ap-shanghai"
    main = tencentcloud.Ccn("main",
        description="ci-temp-test-ccn-des",
        qos="AG")
    limit1 = tencentcloud.CcnBandwidthLimit("limit1",
        ccn_id=main.ccn_id,
        region=other_region1,
        bandwidth_limit=500)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"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, "")
    		otherRegion1 := "ap-shanghai"
    		if param := cfg.Get("otherRegion1"); param != "" {
    			otherRegion1 = param
    		}
    		main, err := tencentcloud.NewCcn(ctx, "main", &tencentcloud.CcnArgs{
    			Description: pulumi.String("ci-temp-test-ccn-des"),
    			Qos:         pulumi.String("AG"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCcnBandwidthLimit(ctx, "limit1", &tencentcloud.CcnBandwidthLimitArgs{
    			CcnId:          main.CcnId,
    			Region:         pulumi.String(otherRegion1),
    			BandwidthLimit: pulumi.Float64(500),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var otherRegion1 = config.Get("otherRegion1") ?? "ap-shanghai";
        var main = new Tencentcloud.Ccn("main", new()
        {
            Description = "ci-temp-test-ccn-des",
            Qos = "AG",
        });
    
        var limit1 = new Tencentcloud.CcnBandwidthLimit("limit1", new()
        {
            CcnId = main.CcnId,
            Region = otherRegion1,
            BandwidthLimit = 500,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Ccn;
    import com.pulumi.tencentcloud.CcnArgs;
    import com.pulumi.tencentcloud.CcnBandwidthLimit;
    import com.pulumi.tencentcloud.CcnBandwidthLimitArgs;
    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 otherRegion1 = config.get("otherRegion1").orElse("ap-shanghai");
            var main = new Ccn("main", CcnArgs.builder()
                .description("ci-temp-test-ccn-des")
                .qos("AG")
                .build());
    
            var limit1 = new CcnBandwidthLimit("limit1", CcnBandwidthLimitArgs.builder()
                .ccnId(main.ccnId())
                .region(otherRegion1)
                .bandwidthLimit(500)
                .build());
    
        }
    }
    
    configuration:
      otherRegion1:
        type: string
        default: ap-shanghai
    resources:
      main:
        type: tencentcloud:Ccn
        properties:
          description: ci-temp-test-ccn-des
          qos: AG
      limit1:
        type: tencentcloud:CcnBandwidthLimit
        properties:
          ccnId: ${main.ccnId}
          region: ${otherRegion1}
          bandwidthLimit: 500
    

    Set the upper limit between regions

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const config = new pulumi.Config();
    const otherRegion1 = config.get("otherRegion1") || "ap-shanghai";
    const otherRegion2 = config.get("otherRegion2") || "ap-nanjing";
    const main = new tencentcloud.Ccn("main", {
        description: "ci-temp-test-ccn-des",
        qos: "AG",
        bandwidthLimitType: "INTER_REGION_LIMIT",
    });
    const limit1 = new tencentcloud.CcnBandwidthLimit("limit1", {
        ccnId: main.ccnId,
        region: otherRegion1,
        dstRegion: otherRegion2,
        bandwidthLimit: 100,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    config = pulumi.Config()
    other_region1 = config.get("otherRegion1")
    if other_region1 is None:
        other_region1 = "ap-shanghai"
    other_region2 = config.get("otherRegion2")
    if other_region2 is None:
        other_region2 = "ap-nanjing"
    main = tencentcloud.Ccn("main",
        description="ci-temp-test-ccn-des",
        qos="AG",
        bandwidth_limit_type="INTER_REGION_LIMIT")
    limit1 = tencentcloud.CcnBandwidthLimit("limit1",
        ccn_id=main.ccn_id,
        region=other_region1,
        dst_region=other_region2,
        bandwidth_limit=100)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"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, "")
    		otherRegion1 := "ap-shanghai"
    		if param := cfg.Get("otherRegion1"); param != "" {
    			otherRegion1 = param
    		}
    		otherRegion2 := "ap-nanjing"
    		if param := cfg.Get("otherRegion2"); param != "" {
    			otherRegion2 = param
    		}
    		main, err := tencentcloud.NewCcn(ctx, "main", &tencentcloud.CcnArgs{
    			Description:        pulumi.String("ci-temp-test-ccn-des"),
    			Qos:                pulumi.String("AG"),
    			BandwidthLimitType: pulumi.String("INTER_REGION_LIMIT"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCcnBandwidthLimit(ctx, "limit1", &tencentcloud.CcnBandwidthLimitArgs{
    			CcnId:          main.CcnId,
    			Region:         pulumi.String(otherRegion1),
    			DstRegion:      pulumi.String(otherRegion2),
    			BandwidthLimit: pulumi.Float64(100),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var otherRegion1 = config.Get("otherRegion1") ?? "ap-shanghai";
        var otherRegion2 = config.Get("otherRegion2") ?? "ap-nanjing";
        var main = new Tencentcloud.Ccn("main", new()
        {
            Description = "ci-temp-test-ccn-des",
            Qos = "AG",
            BandwidthLimitType = "INTER_REGION_LIMIT",
        });
    
        var limit1 = new Tencentcloud.CcnBandwidthLimit("limit1", new()
        {
            CcnId = main.CcnId,
            Region = otherRegion1,
            DstRegion = otherRegion2,
            BandwidthLimit = 100,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Ccn;
    import com.pulumi.tencentcloud.CcnArgs;
    import com.pulumi.tencentcloud.CcnBandwidthLimit;
    import com.pulumi.tencentcloud.CcnBandwidthLimitArgs;
    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 otherRegion1 = config.get("otherRegion1").orElse("ap-shanghai");
            final var otherRegion2 = config.get("otherRegion2").orElse("ap-nanjing");
            var main = new Ccn("main", CcnArgs.builder()
                .description("ci-temp-test-ccn-des")
                .qos("AG")
                .bandwidthLimitType("INTER_REGION_LIMIT")
                .build());
    
            var limit1 = new CcnBandwidthLimit("limit1", CcnBandwidthLimitArgs.builder()
                .ccnId(main.ccnId())
                .region(otherRegion1)
                .dstRegion(otherRegion2)
                .bandwidthLimit(100)
                .build());
    
        }
    }
    
    configuration:
      otherRegion1:
        type: string
        default: ap-shanghai
      otherRegion2:
        type: string
        default: ap-nanjing
    resources:
      main:
        type: tencentcloud:Ccn
        properties:
          description: ci-temp-test-ccn-des
          qos: AG
          bandwidthLimitType: INTER_REGION_LIMIT
      limit1:
        type: tencentcloud:CcnBandwidthLimit
        properties:
          ccnId: ${main.ccnId}
          region: ${otherRegion1}
          dstRegion: ${otherRegion2}
          bandwidthLimit: 100
    

    Create CcnBandwidthLimit Resource

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

    Constructor syntax

    new CcnBandwidthLimit(name: string, args: CcnBandwidthLimitArgs, opts?: CustomResourceOptions);
    @overload
    def CcnBandwidthLimit(resource_name: str,
                          args: CcnBandwidthLimitArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def CcnBandwidthLimit(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          ccn_id: Optional[str] = None,
                          region: Optional[str] = None,
                          bandwidth_limit: Optional[float] = None,
                          ccn_bandwidth_limit_id: Optional[str] = None,
                          dst_region: Optional[str] = None)
    func NewCcnBandwidthLimit(ctx *Context, name string, args CcnBandwidthLimitArgs, opts ...ResourceOption) (*CcnBandwidthLimit, error)
    public CcnBandwidthLimit(string name, CcnBandwidthLimitArgs args, CustomResourceOptions? opts = null)
    public CcnBandwidthLimit(String name, CcnBandwidthLimitArgs args)
    public CcnBandwidthLimit(String name, CcnBandwidthLimitArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CcnBandwidthLimit
    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 CcnBandwidthLimitArgs
    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 CcnBandwidthLimitArgs
    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 CcnBandwidthLimitArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CcnBandwidthLimitArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CcnBandwidthLimitArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CcnBandwidthLimit 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 CcnBandwidthLimit resource accepts the following input properties:

    CcnId string
    ID of the CCN.
    Region string
    Limitation of region.
    BandwidthLimit double
    Limitation of bandwidth. Default is 0.
    CcnBandwidthLimitId string
    ID of the resource.
    DstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    CcnId string
    ID of the CCN.
    Region string
    Limitation of region.
    BandwidthLimit float64
    Limitation of bandwidth. Default is 0.
    CcnBandwidthLimitId string
    ID of the resource.
    DstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    ccnId String
    ID of the CCN.
    region String
    Limitation of region.
    bandwidthLimit Double
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId String
    ID of the resource.
    dstRegion String
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    ccnId string
    ID of the CCN.
    region string
    Limitation of region.
    bandwidthLimit number
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId string
    ID of the resource.
    dstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    ccn_id str
    ID of the CCN.
    region str
    Limitation of region.
    bandwidth_limit float
    Limitation of bandwidth. Default is 0.
    ccn_bandwidth_limit_id str
    ID of the resource.
    dst_region str
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    ccnId String
    ID of the CCN.
    region String
    Limitation of region.
    bandwidthLimit Number
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId String
    ID of the resource.
    dstRegion String
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CcnBandwidthLimit Resource

    Get an existing CcnBandwidthLimit 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?: CcnBandwidthLimitState, opts?: CustomResourceOptions): CcnBandwidthLimit
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bandwidth_limit: Optional[float] = None,
            ccn_bandwidth_limit_id: Optional[str] = None,
            ccn_id: Optional[str] = None,
            dst_region: Optional[str] = None,
            region: Optional[str] = None) -> CcnBandwidthLimit
    func GetCcnBandwidthLimit(ctx *Context, name string, id IDInput, state *CcnBandwidthLimitState, opts ...ResourceOption) (*CcnBandwidthLimit, error)
    public static CcnBandwidthLimit Get(string name, Input<string> id, CcnBandwidthLimitState? state, CustomResourceOptions? opts = null)
    public static CcnBandwidthLimit get(String name, Output<String> id, CcnBandwidthLimitState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CcnBandwidthLimit    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.
    The following state arguments are supported:
    BandwidthLimit double
    Limitation of bandwidth. Default is 0.
    CcnBandwidthLimitId string
    ID of the resource.
    CcnId string
    ID of the CCN.
    DstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    Region string
    Limitation of region.
    BandwidthLimit float64
    Limitation of bandwidth. Default is 0.
    CcnBandwidthLimitId string
    ID of the resource.
    CcnId string
    ID of the CCN.
    DstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    Region string
    Limitation of region.
    bandwidthLimit Double
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId String
    ID of the resource.
    ccnId String
    ID of the CCN.
    dstRegion String
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    region String
    Limitation of region.
    bandwidthLimit number
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId string
    ID of the resource.
    ccnId string
    ID of the CCN.
    dstRegion string
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    region string
    Limitation of region.
    bandwidth_limit float
    Limitation of bandwidth. Default is 0.
    ccn_bandwidth_limit_id str
    ID of the resource.
    ccn_id str
    ID of the CCN.
    dst_region str
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    region str
    Limitation of region.
    bandwidthLimit Number
    Limitation of bandwidth. Default is 0.
    ccnBandwidthLimitId String
    ID of the resource.
    ccnId String
    ID of the CCN.
    dstRegion String
    Destination area restriction. If the CCN rate limit type is OUTER_REGION_LIMIT, this value does not need to be set.
    region String
    Limitation of region.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack