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

tencentcloud.ApiGatewayUsagePlan

Explore with Pulumi AI

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",
});
Copy
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")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
resources:
  example:
    type: tencentcloud:ApiGatewayUsagePlan
    properties:
      maxRequestNum: 100
      maxRequestNumPreSec: 10
      usagePlanDesc: desc.
      usagePlanName: tf_example
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. ApiGatewayUsagePlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. ApiGatewayUsagePlanArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApiGatewayUsagePlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required. string
The API ID, this value is empty if attach service.
ApiName This property is required. string
The API name, this value is empty if attach service.
CreateTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
Environment This property is required. string
The environment name.
Method This property is required. string
The API method, this value is empty if attach service.
ModifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
Path This property is required. string
The API path, this value is empty if attach service.
ServiceId This property is required. string
The service ID.
ServiceName This property is required. string
The service name.
ApiId This property is required. string
The API ID, this value is empty if attach service.
ApiName This property is required. string
The API name, this value is empty if attach service.
CreateTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
Environment This property is required. string
The environment name.
Method This property is required. string
The API method, this value is empty if attach service.
ModifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
Path This property is required. string
The API path, this value is empty if attach service.
ServiceId This property is required. string
The service ID.
ServiceName This property is required. string
The service name.
apiId This property is required. String
The API ID, this value is empty if attach service.
apiName This property is required. String
The API name, this value is empty if attach service.
createTime This property is required. String
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
environment This property is required. String
The environment name.
method This property is required. String
The API method, this value is empty if attach service.
modifyTime This property is required. String
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
path This property is required. String
The API path, this value is empty if attach service.
serviceId This property is required. String
The service ID.
serviceName This property is required. String
The service name.
apiId This property is required. string
The API ID, this value is empty if attach service.
apiName This property is required. string
The API name, this value is empty if attach service.
createTime This property is required. string
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
environment This property is required. string
The environment name.
method This property is required. string
The API method, this value is empty if attach service.
modifyTime This property is required. string
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
path This property is required. string
The API path, this value is empty if attach service.
serviceId This property is required. string
The service ID.
serviceName This property is required. string
The service name.
api_id This property is required. str
The API ID, this value is empty if attach service.
api_name This property is required. str
The API name, this value is empty if attach service.
create_time This property is required. str
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
environment This property is required. str
The environment name.
method This property is required. str
The API method, this value is empty if attach service.
modify_time This property is required. str
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
path This property is required. str
The API path, this value is empty if attach service.
service_id This property is required. str
The service ID.
service_name This property is required. str
The service name.
apiId This property is required. String
The API ID, this value is empty if attach service.
apiName This property is required. String
The API name, this value is empty if attach service.
createTime This property is required. String
Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
environment This property is required. String
The environment name.
method This property is required. String
The API method, this value is empty if attach service.
modifyTime This property is required. String
Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
path This property is required. String
The API path, this value is empty if attach service.
serviceId This property is required. String
The service ID.
serviceName This property is required. 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
Copy

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.