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

tencentcloud.ApiGatewayUsagePlan

Explore with Pulumi AI

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

    Use this resource to create API gateway usage plan.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.ApiGatewayUsagePlan("example", {
        maxRequestNum: 100,
        maxRequestNumPreSec: 10,
        usagePlanDesc: "desc.",
        usagePlanName: "tf_example",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.ApiGatewayUsagePlan("example",
        max_request_num=100,
        max_request_num_pre_sec=10,
        usage_plan_desc="desc.",
        usage_plan_name="tf_example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewApiGatewayUsagePlan(ctx, "example", &tencentcloud.ApiGatewayUsagePlanArgs{
    			MaxRequestNum:       pulumi.Float64(100),
    			MaxRequestNumPreSec: pulumi.Float64(10),
    			UsagePlanDesc:       pulumi.String("desc."),
    			UsagePlanName:       pulumi.String("tf_example"),
    		})
    		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 example = new Tencentcloud.ApiGatewayUsagePlan("example", new()
        {
            MaxRequestNum = 100,
            MaxRequestNumPreSec = 10,
            UsagePlanDesc = "desc.",
            UsagePlanName = "tf_example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ApiGatewayUsagePlan;
    import com.pulumi.tencentcloud.ApiGatewayUsagePlanArgs;
    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 ApiGatewayUsagePlan("example", ApiGatewayUsagePlanArgs.builder()
                .maxRequestNum(100)
                .maxRequestNumPreSec(10)
                .usagePlanDesc("desc.")
                .usagePlanName("tf_example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:ApiGatewayUsagePlan
        properties:
          maxRequestNum: 100
          maxRequestNumPreSec: 10
          usagePlanDesc: desc.
          usagePlanName: tf_example
    

    Create ApiGatewayUsagePlan Resource

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

    Constructor syntax

    new ApiGatewayUsagePlan(name: string, args: ApiGatewayUsagePlanArgs, opts?: CustomResourceOptions);
    @overload
    def ApiGatewayUsagePlan(resource_name: str,
                            args: ApiGatewayUsagePlanArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiGatewayUsagePlan(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            usage_plan_name: Optional[str] = None,
                            api_gateway_usage_plan_id: Optional[str] = None,
                            max_request_num: Optional[float] = None,
                            max_request_num_pre_sec: Optional[float] = None,
                            usage_plan_desc: Optional[str] = None)
    func NewApiGatewayUsagePlan(ctx *Context, name string, args ApiGatewayUsagePlanArgs, opts ...ResourceOption) (*ApiGatewayUsagePlan, error)
    public ApiGatewayUsagePlan(string name, ApiGatewayUsagePlanArgs args, CustomResourceOptions? opts = null)
    public ApiGatewayUsagePlan(String name, ApiGatewayUsagePlanArgs args)
    public ApiGatewayUsagePlan(String name, ApiGatewayUsagePlanArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ApiGatewayUsagePlan
    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 ApiGatewayUsagePlanArgs
    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 ApiGatewayUsagePlanArgs
    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 ApiGatewayUsagePlanArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiGatewayUsagePlanArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiGatewayUsagePlanArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    UsagePlanName string
    Custom usage plan name.
    ApiGatewayUsagePlanId string
    ID of the resource.
    MaxRequestNum double
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec double
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    UsagePlanDesc string
    Custom usage plan description.
    UsagePlanName string
    Custom usage plan name.
    ApiGatewayUsagePlanId string
    ID of the resource.
    MaxRequestNum float64
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec float64
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    UsagePlanDesc string
    Custom usage plan description.
    usagePlanName String
    Custom usage plan name.
    apiGatewayUsagePlanId String
    ID of the resource.
    maxRequestNum Double
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Double
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    usagePlanDesc String
    Custom usage plan description.
    usagePlanName string
    Custom usage plan name.
    apiGatewayUsagePlanId string
    ID of the resource.
    maxRequestNum number
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec number
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    usagePlanDesc string
    Custom usage plan description.
    usage_plan_name str
    Custom usage plan name.
    api_gateway_usage_plan_id str
    ID of the resource.
    max_request_num float
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    max_request_num_pre_sec float
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    usage_plan_desc str
    Custom usage plan description.
    usagePlanName String
    Custom usage plan name.
    apiGatewayUsagePlanId String
    ID of the resource.
    maxRequestNum Number
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Number
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    usagePlanDesc String
    Custom usage plan description.

    Outputs

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

    AttachApiKeys List<string>
    Attach API keys list.
    AttachLists List<ApiGatewayUsagePlanAttachList>
    Attach service and API list.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    AttachApiKeys []string
    Attach API keys list.
    AttachLists []ApiGatewayUsagePlanAttachList
    Attach service and API list.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    attachApiKeys List<String>
    Attach API keys list.
    attachLists List<ApiGatewayUsagePlanAttachList>
    Attach service and API list.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    id String
    The provider-assigned unique ID for this managed resource.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    attachApiKeys string[]
    Attach API keys list.
    attachLists ApiGatewayUsagePlanAttachList[]
    Attach service and API list.
    createTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    id string
    The provider-assigned unique ID for this managed resource.
    modifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    attach_api_keys Sequence[str]
    Attach API keys list.
    attach_lists Sequence[ApiGatewayUsagePlanAttachList]
    Attach service and API list.
    create_time str
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    id str
    The provider-assigned unique ID for this managed resource.
    modify_time str
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    attachApiKeys List<String>
    Attach API keys list.
    attachLists List<Property Map>
    Attach service and API list.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    id String
    The provider-assigned unique ID for this managed resource.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.

    Look up Existing ApiGatewayUsagePlan Resource

    Get an existing ApiGatewayUsagePlan 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?: ApiGatewayUsagePlanState, opts?: CustomResourceOptions): ApiGatewayUsagePlan
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_gateway_usage_plan_id: Optional[str] = None,
            attach_api_keys: Optional[Sequence[str]] = None,
            attach_lists: Optional[Sequence[ApiGatewayUsagePlanAttachListArgs]] = None,
            create_time: Optional[str] = None,
            max_request_num: Optional[float] = None,
            max_request_num_pre_sec: Optional[float] = None,
            modify_time: Optional[str] = None,
            usage_plan_desc: Optional[str] = None,
            usage_plan_name: Optional[str] = None) -> ApiGatewayUsagePlan
    func GetApiGatewayUsagePlan(ctx *Context, name string, id IDInput, state *ApiGatewayUsagePlanState, opts ...ResourceOption) (*ApiGatewayUsagePlan, error)
    public static ApiGatewayUsagePlan Get(string name, Input<string> id, ApiGatewayUsagePlanState? state, CustomResourceOptions? opts = null)
    public static ApiGatewayUsagePlan get(String name, Output<String> id, ApiGatewayUsagePlanState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ApiGatewayUsagePlan    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:
    ApiGatewayUsagePlanId string
    ID of the resource.
    AttachApiKeys List<string>
    Attach API keys list.
    AttachLists List<ApiGatewayUsagePlanAttachList>
    Attach service and API list.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    MaxRequestNum double
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec double
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    UsagePlanDesc string
    Custom usage plan description.
    UsagePlanName string
    Custom usage plan name.
    ApiGatewayUsagePlanId string
    ID of the resource.
    AttachApiKeys []string
    Attach API keys list.
    AttachLists []ApiGatewayUsagePlanAttachListArgs
    Attach service and API list.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    MaxRequestNum float64
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    MaxRequestNumPreSec float64
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    UsagePlanDesc string
    Custom usage plan description.
    UsagePlanName string
    Custom usage plan name.
    apiGatewayUsagePlanId String
    ID of the resource.
    attachApiKeys List<String>
    Attach API keys list.
    attachLists List<ApiGatewayUsagePlanAttachList>
    Attach service and API list.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum Double
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Double
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc String
    Custom usage plan description.
    usagePlanName String
    Custom usage plan name.
    apiGatewayUsagePlanId string
    ID of the resource.
    attachApiKeys string[]
    Attach API keys list.
    attachLists ApiGatewayUsagePlanAttachList[]
    Attach service and API list.
    createTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum number
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec number
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc string
    Custom usage plan description.
    usagePlanName string
    Custom usage plan name.
    api_gateway_usage_plan_id str
    ID of the resource.
    attach_api_keys Sequence[str]
    Attach API keys list.
    attach_lists Sequence[ApiGatewayUsagePlanAttachListArgs]
    Attach service and API list.
    create_time str
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    max_request_num float
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    max_request_num_pre_sec float
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    modify_time str
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usage_plan_desc str
    Custom usage plan description.
    usage_plan_name str
    Custom usage plan name.
    apiGatewayUsagePlanId String
    ID of the resource.
    attachApiKeys List<String>
    Attach API keys list.
    attachLists List<Property Map>
    Attach service and API list.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    maxRequestNum Number
    Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
    maxRequestNumPreSec Number
    Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    usagePlanDesc String
    Custom usage plan description.
    usagePlanName String
    Custom usage plan name.

    Supporting Types

    ApiGatewayUsagePlanAttachList, ApiGatewayUsagePlanAttachListArgs

    ApiId string
    The API ID, this value is empty if attach service.
    ApiName string
    The API name, this value is empty if attach service.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Environment string
    The environment name.
    Method string
    The API method, this value is empty if attach service.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Path string
    The API path, this value is empty if attach service.
    ServiceId string
    The service ID.
    ServiceName string
    The service name.
    ApiId string
    The API ID, this value is empty if attach service.
    ApiName string
    The API name, this value is empty if attach service.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Environment string
    The environment name.
    Method string
    The API method, this value is empty if attach service.
    ModifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    Path string
    The API path, this value is empty if attach service.
    ServiceId string
    The service ID.
    ServiceName string
    The service name.
    apiId String
    The API ID, this value is empty if attach service.
    apiName String
    The API name, this value is empty if attach service.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    environment String
    The environment name.
    method String
    The API method, this value is empty if attach service.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    path String
    The API path, this value is empty if attach service.
    serviceId String
    The service ID.
    serviceName String
    The service name.
    apiId string
    The API ID, this value is empty if attach service.
    apiName string
    The API name, this value is empty if attach service.
    createTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    environment string
    The environment name.
    method string
    The API method, this value is empty if attach service.
    modifyTime string
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    path string
    The API path, this value is empty if attach service.
    serviceId string
    The service ID.
    serviceName string
    The service name.
    api_id str
    The API ID, this value is empty if attach service.
    api_name str
    The API name, this value is empty if attach service.
    create_time str
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    environment str
    The environment name.
    method str
    The API method, this value is empty if attach service.
    modify_time str
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    path str
    The API path, this value is empty if attach service.
    service_id str
    The service ID.
    service_name str
    The service name.
    apiId String
    The API ID, this value is empty if attach service.
    apiName String
    The API name, this value is empty if attach service.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    environment String
    The environment name.
    method String
    The API method, this value is empty if attach service.
    modifyTime String
    Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    path String
    The API path, this value is empty if attach service.
    serviceId String
    The service ID.
    serviceName String
    The service name.

    Import

    API gateway usage plan can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/apiGatewayUsagePlan:ApiGatewayUsagePlan plan usagePlan-gyeafpab
    

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

    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