tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getApiGatewayUsagePlanEnvironments
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
Used to query the environment list bound by the plan.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const plan = new tencentcloud.ApiGatewayUsagePlan("plan", {
usagePlanName: "my_plan",
usagePlanDesc: "nice plan",
maxRequestNum: 100,
maxRequestNumPreSec: 10,
});
const service = new tencentcloud.ApiGatewayService("service", {
serviceName: "niceservice",
protocol: "http&https",
serviceDesc: "your nice service",
netTypes: [
"INNER",
"OUTER",
],
ipVersion: "IPv4",
});
const attachService = new tencentcloud.ApiGatewayUsagePlanAttachment("attachService", {
usagePlanId: plan.apiGatewayUsagePlanId,
serviceId: service.apiGatewayServiceId,
environment: "test",
bindType: "SERVICE",
});
const environmentTest = tencentcloud.getApiGatewayUsagePlanEnvironmentsOutput({
usagePlanId: attachService.usagePlanId,
bindType: "SERVICE",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
plan = tencentcloud.ApiGatewayUsagePlan("plan",
usage_plan_name="my_plan",
usage_plan_desc="nice plan",
max_request_num=100,
max_request_num_pre_sec=10)
service = tencentcloud.ApiGatewayService("service",
service_name="niceservice",
protocol="http&https",
service_desc="your nice service",
net_types=[
"INNER",
"OUTER",
],
ip_version="IPv4")
attach_service = tencentcloud.ApiGatewayUsagePlanAttachment("attachService",
usage_plan_id=plan.api_gateway_usage_plan_id,
service_id=service.api_gateway_service_id,
environment="test",
bind_type="SERVICE")
environment_test = tencentcloud.get_api_gateway_usage_plan_environments_output(usage_plan_id=attach_service.usage_plan_id,
bind_type="SERVICE")
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 {
plan, err := tencentcloud.NewApiGatewayUsagePlan(ctx, "plan", &tencentcloud.ApiGatewayUsagePlanArgs{
UsagePlanName: pulumi.String("my_plan"),
UsagePlanDesc: pulumi.String("nice plan"),
MaxRequestNum: pulumi.Float64(100),
MaxRequestNumPreSec: pulumi.Float64(10),
})
if err != nil {
return err
}
service, err := tencentcloud.NewApiGatewayService(ctx, "service", &tencentcloud.ApiGatewayServiceArgs{
ServiceName: pulumi.String("niceservice"),
Protocol: pulumi.String("http&https"),
ServiceDesc: pulumi.String("your nice service"),
NetTypes: pulumi.StringArray{
pulumi.String("INNER"),
pulumi.String("OUTER"),
},
IpVersion: pulumi.String("IPv4"),
})
if err != nil {
return err
}
attachService, err := tencentcloud.NewApiGatewayUsagePlanAttachment(ctx, "attachService", &tencentcloud.ApiGatewayUsagePlanAttachmentArgs{
UsagePlanId: plan.ApiGatewayUsagePlanId,
ServiceId: service.ApiGatewayServiceId,
Environment: pulumi.String("test"),
BindType: pulumi.String("SERVICE"),
})
if err != nil {
return err
}
_ = tencentcloud.GetApiGatewayUsagePlanEnvironmentsOutput(ctx, tencentcloud.GetApiGatewayUsagePlanEnvironmentsOutputArgs{
UsagePlanId: attachService.UsagePlanId,
BindType: pulumi.String("SERVICE"),
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var plan = new Tencentcloud.ApiGatewayUsagePlan("plan", new()
{
UsagePlanName = "my_plan",
UsagePlanDesc = "nice plan",
MaxRequestNum = 100,
MaxRequestNumPreSec = 10,
});
var service = new Tencentcloud.ApiGatewayService("service", new()
{
ServiceName = "niceservice",
Protocol = "http&https",
ServiceDesc = "your nice service",
NetTypes = new[]
{
"INNER",
"OUTER",
},
IpVersion = "IPv4",
});
var attachService = new Tencentcloud.ApiGatewayUsagePlanAttachment("attachService", new()
{
UsagePlanId = plan.ApiGatewayUsagePlanId,
ServiceId = service.ApiGatewayServiceId,
Environment = "test",
BindType = "SERVICE",
});
var environmentTest = Tencentcloud.GetApiGatewayUsagePlanEnvironments.Invoke(new()
{
UsagePlanId = attachService.UsagePlanId,
BindType = "SERVICE",
});
});
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 com.pulumi.tencentcloud.ApiGatewayService;
import com.pulumi.tencentcloud.ApiGatewayServiceArgs;
import com.pulumi.tencentcloud.ApiGatewayUsagePlanAttachment;
import com.pulumi.tencentcloud.ApiGatewayUsagePlanAttachmentArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetApiGatewayUsagePlanEnvironmentsArgs;
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 plan = new ApiGatewayUsagePlan("plan", ApiGatewayUsagePlanArgs.builder()
.usagePlanName("my_plan")
.usagePlanDesc("nice plan")
.maxRequestNum(100)
.maxRequestNumPreSec(10)
.build());
var service = new ApiGatewayService("service", ApiGatewayServiceArgs.builder()
.serviceName("niceservice")
.protocol("http&https")
.serviceDesc("your nice service")
.netTypes(
"INNER",
"OUTER")
.ipVersion("IPv4")
.build());
var attachService = new ApiGatewayUsagePlanAttachment("attachService", ApiGatewayUsagePlanAttachmentArgs.builder()
.usagePlanId(plan.apiGatewayUsagePlanId())
.serviceId(service.apiGatewayServiceId())
.environment("test")
.bindType("SERVICE")
.build());
final var environmentTest = TencentcloudFunctions.getApiGatewayUsagePlanEnvironments(GetApiGatewayUsagePlanEnvironmentsArgs.builder()
.usagePlanId(attachService.usagePlanId())
.bindType("SERVICE")
.build());
}
}
resources:
plan:
type: tencentcloud:ApiGatewayUsagePlan
properties:
usagePlanName: my_plan
usagePlanDesc: nice plan
maxRequestNum: 100
maxRequestNumPreSec: 10
service:
type: tencentcloud:ApiGatewayService
properties:
serviceName: niceservice
protocol: http&https
serviceDesc: your nice service
netTypes:
- INNER
- OUTER
ipVersion: IPv4
attachService:
type: tencentcloud:ApiGatewayUsagePlanAttachment
properties:
usagePlanId: ${plan.apiGatewayUsagePlanId}
serviceId: ${service.apiGatewayServiceId}
environment: test
bindType: SERVICE
variables:
environmentTest:
fn::invoke:
function: tencentcloud:getApiGatewayUsagePlanEnvironments
arguments:
usagePlanId: ${attachService.usagePlanId}
bindType: SERVICE
Using getApiGatewayUsagePlanEnvironments
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getApiGatewayUsagePlanEnvironments(args: GetApiGatewayUsagePlanEnvironmentsArgs, opts?: InvokeOptions): Promise<GetApiGatewayUsagePlanEnvironmentsResult>
function getApiGatewayUsagePlanEnvironmentsOutput(args: GetApiGatewayUsagePlanEnvironmentsOutputArgs, opts?: InvokeOptions): Output<GetApiGatewayUsagePlanEnvironmentsResult>
def get_api_gateway_usage_plan_environments(bind_type: Optional[str] = None,
id: Optional[str] = None,
result_output_file: Optional[str] = None,
usage_plan_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApiGatewayUsagePlanEnvironmentsResult
def get_api_gateway_usage_plan_environments_output(bind_type: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
usage_plan_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetApiGatewayUsagePlanEnvironmentsResult]
func GetApiGatewayUsagePlanEnvironments(ctx *Context, args *GetApiGatewayUsagePlanEnvironmentsArgs, opts ...InvokeOption) (*GetApiGatewayUsagePlanEnvironmentsResult, error)
func GetApiGatewayUsagePlanEnvironmentsOutput(ctx *Context, args *GetApiGatewayUsagePlanEnvironmentsOutputArgs, opts ...InvokeOption) GetApiGatewayUsagePlanEnvironmentsResultOutput
> Note: This function is named GetApiGatewayUsagePlanEnvironments
in the Go SDK.
public static class GetApiGatewayUsagePlanEnvironments
{
public static Task<GetApiGatewayUsagePlanEnvironmentsResult> InvokeAsync(GetApiGatewayUsagePlanEnvironmentsArgs args, InvokeOptions? opts = null)
public static Output<GetApiGatewayUsagePlanEnvironmentsResult> Invoke(GetApiGatewayUsagePlanEnvironmentsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetApiGatewayUsagePlanEnvironmentsResult> getApiGatewayUsagePlanEnvironments(GetApiGatewayUsagePlanEnvironmentsArgs args, InvokeOptions options)
public static Output<GetApiGatewayUsagePlanEnvironmentsResult> getApiGatewayUsagePlanEnvironments(GetApiGatewayUsagePlanEnvironmentsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getApiGatewayUsagePlanEnvironments:getApiGatewayUsagePlanEnvironments
arguments:
# arguments dictionary
The following arguments are supported:
- Usage
Plan stringId - ID of the usage plan to be queried.
- Bind
Type string - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - Id string
- Result
Output stringFile - Used to save results.
- Usage
Plan stringId - ID of the usage plan to be queried.
- Bind
Type string - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - Id string
- Result
Output stringFile - Used to save results.
- usage
Plan StringId - ID of the usage plan to be queried.
- bind
Type String - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - id String
- result
Output StringFile - Used to save results.
- usage
Plan stringId - ID of the usage plan to be queried.
- bind
Type string - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - id string
- result
Output stringFile - Used to save results.
- usage_
plan_ strid - ID of the usage plan to be queried.
- bind_
type str - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - id str
- result_
output_ strfile - Used to save results.
- usage
Plan StringId - ID of the usage plan to be queried.
- bind
Type String - Binding type. Valid values:
API
,SERVICE
. Default value:SERVICE
. - id String
- result
Output StringFile - Used to save results.
getApiGatewayUsagePlanEnvironments Result
The following output properties are available:
- Id string
- Lists
List<Get
Api Gateway Usage Plan Environments List> - A list of usage plan binding details.
- Usage
Plan stringId - Bind
Type string - Result
Output stringFile
- Id string
- Lists
[]Get
Api Gateway Usage Plan Environments List - A list of usage plan binding details.
- Usage
Plan stringId - Bind
Type string - Result
Output stringFile
- id String
- lists
List<Get
Api Gateway Usage Plan Environments List> - A list of usage plan binding details.
- usage
Plan StringId - bind
Type String - result
Output StringFile
- id string
- lists
Get
Api Gateway Usage Plan Environments List[] - A list of usage plan binding details.
- usage
Plan stringId - bind
Type string - result
Output stringFile
- id str
- lists
Sequence[Get
Api Gateway Usage Plan Environments List] - A list of usage plan binding details.
- usage_
plan_ strid - bind_
type str - result_
output_ strfile
- id String
- lists List<Property Map>
- A list of usage plan binding details.
- usage
Plan StringId - bind
Type String - result
Output StringFile
Supporting Types
GetApiGatewayUsagePlanEnvironmentsList
- Api
Id string - The API ID, this value is empty if attach service.
- Api
Name string - The API name, this value is empty if attach service.
- Create
Time 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.
- Modify
Time 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.
- Service
Id string - The service ID.
- Service
Name string - The service name.
- Api
Id string - The API ID, this value is empty if attach service.
- Api
Name string - The API name, this value is empty if attach service.
- Create
Time 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.
- Modify
Time 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.
- Service
Id string - The service ID.
- Service
Name string - The service name.
- api
Id String - The API ID, this value is empty if attach service.
- api
Name String - The API name, this value is empty if attach service.
- create
Time 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.
- modify
Time 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.
- service
Id String - The service ID.
- service
Name String - The service name.
- api
Id string - The API ID, this value is empty if attach service.
- api
Name string - The API name, this value is empty if attach service.
- create
Time 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.
- modify
Time 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.
- service
Id string - The service ID.
- service
Name 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.
- api
Id String - The API ID, this value is empty if attach service.
- api
Name String - The API name, this value is empty if attach service.
- create
Time 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.
- modify
Time 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.
- service
Id String - The service ID.
- service
Name String - The service name.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack