1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getApiGatewayApiKeys
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.getApiGatewayApiKeys

Explore with Pulumi AI

Use this data source to query API gateway access keys.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const test = new tencentcloud.ApiGatewayApiKey("test", {
    secretName: "my_api_key",
    status: "on",
});
const name = tencentcloud.getApiGatewayApiKeysOutput({
    secretName: test.secretName,
});
const id = tencentcloud.getApiGatewayApiKeysOutput({
    apiKeyId: test.apiGatewayApiKeyId,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

test = tencentcloud.ApiGatewayApiKey("test",
    secret_name="my_api_key",
    status="on")
name = tencentcloud.get_api_gateway_api_keys_output(secret_name=test.secret_name)
id = tencentcloud.get_api_gateway_api_keys_output(api_key_id=test.api_gateway_api_key_id)
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 {
		test, err := tencentcloud.NewApiGatewayApiKey(ctx, "test", &tencentcloud.ApiGatewayApiKeyArgs{
			SecretName: pulumi.String("my_api_key"),
			Status:     pulumi.String("on"),
		})
		if err != nil {
			return err
		}
		_ = tencentcloud.GetApiGatewayApiKeysOutput(ctx, tencentcloud.GetApiGatewayApiKeysOutputArgs{
			SecretName: test.SecretName,
		}, nil)
		_ = tencentcloud.GetApiGatewayApiKeysOutput(ctx, tencentcloud.GetApiGatewayApiKeysOutputArgs{
			ApiKeyId: test.ApiGatewayApiKeyId,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var test = new Tencentcloud.ApiGatewayApiKey("test", new()
    {
        SecretName = "my_api_key",
        Status = "on",
    });

    var name = Tencentcloud.GetApiGatewayApiKeys.Invoke(new()
    {
        SecretName = test.SecretName,
    });

    var id = Tencentcloud.GetApiGatewayApiKeys.Invoke(new()
    {
        ApiKeyId = test.ApiGatewayApiKeyId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayApiKey;
import com.pulumi.tencentcloud.ApiGatewayApiKeyArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetApiGatewayApiKeysArgs;
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 test = new ApiGatewayApiKey("test", ApiGatewayApiKeyArgs.builder()
            .secretName("my_api_key")
            .status("on")
            .build());

        final var name = TencentcloudFunctions.getApiGatewayApiKeys(GetApiGatewayApiKeysArgs.builder()
            .secretName(test.secretName())
            .build());

        final var id = TencentcloudFunctions.getApiGatewayApiKeys(GetApiGatewayApiKeysArgs.builder()
            .apiKeyId(test.apiGatewayApiKeyId())
            .build());

    }
}
Copy
resources:
  test:
    type: tencentcloud:ApiGatewayApiKey
    properties:
      secretName: my_api_key
      status: on
variables:
  name:
    fn::invoke:
      function: tencentcloud:getApiGatewayApiKeys
      arguments:
        secretName: ${test.secretName}
  id:
    fn::invoke:
      function: tencentcloud:getApiGatewayApiKeys
      arguments:
        apiKeyId: ${test.apiGatewayApiKeyId}
Copy

Using getApiGatewayApiKeys

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 getApiGatewayApiKeys(args: GetApiGatewayApiKeysArgs, opts?: InvokeOptions): Promise<GetApiGatewayApiKeysResult>
function getApiGatewayApiKeysOutput(args: GetApiGatewayApiKeysOutputArgs, opts?: InvokeOptions): Output<GetApiGatewayApiKeysResult>
Copy
def get_api_gateway_api_keys(api_key_id: Optional[str] = None,
                             id: Optional[str] = None,
                             result_output_file: Optional[str] = None,
                             secret_name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetApiGatewayApiKeysResult
def get_api_gateway_api_keys_output(api_key_id: Optional[pulumi.Input[str]] = None,
                             id: Optional[pulumi.Input[str]] = None,
                             result_output_file: Optional[pulumi.Input[str]] = None,
                             secret_name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetApiGatewayApiKeysResult]
Copy
func GetApiGatewayApiKeys(ctx *Context, args *GetApiGatewayApiKeysArgs, opts ...InvokeOption) (*GetApiGatewayApiKeysResult, error)
func GetApiGatewayApiKeysOutput(ctx *Context, args *GetApiGatewayApiKeysOutputArgs, opts ...InvokeOption) GetApiGatewayApiKeysResultOutput
Copy

> Note: This function is named GetApiGatewayApiKeys in the Go SDK.

public static class GetApiGatewayApiKeys 
{
    public static Task<GetApiGatewayApiKeysResult> InvokeAsync(GetApiGatewayApiKeysArgs args, InvokeOptions? opts = null)
    public static Output<GetApiGatewayApiKeysResult> Invoke(GetApiGatewayApiKeysInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetApiGatewayApiKeysResult> getApiGatewayApiKeys(GetApiGatewayApiKeysArgs args, InvokeOptions options)
public static Output<GetApiGatewayApiKeysResult> getApiGatewayApiKeys(GetApiGatewayApiKeysArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getApiGatewayApiKeys:getApiGatewayApiKeys
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ApiKeyId string
Created API key ID, this field is exactly the same as ID.
Id string
ResultOutputFile string
Used to save results.
SecretName string
Custom key name.
ApiKeyId string
Created API key ID, this field is exactly the same as ID.
Id string
ResultOutputFile string
Used to save results.
SecretName string
Custom key name.
apiKeyId String
Created API key ID, this field is exactly the same as ID.
id String
resultOutputFile String
Used to save results.
secretName String
Custom key name.
apiKeyId string
Created API key ID, this field is exactly the same as ID.
id string
resultOutputFile string
Used to save results.
secretName string
Custom key name.
api_key_id str
Created API key ID, this field is exactly the same as ID.
id str
result_output_file str
Used to save results.
secret_name str
Custom key name.
apiKeyId String
Created API key ID, this field is exactly the same as ID.
id String
resultOutputFile String
Used to save results.
secretName String
Custom key name.

getApiGatewayApiKeys Result

The following output properties are available:

Id string
Lists List<GetApiGatewayApiKeysList>
A list of API keys.
ApiKeyId string
API key ID.
ResultOutputFile string
SecretName string
Id string
Lists []GetApiGatewayApiKeysList
A list of API keys.
ApiKeyId string
API key ID.
ResultOutputFile string
SecretName string
id String
lists List<GetApiGatewayApiKeysList>
A list of API keys.
apiKeyId String
API key ID.
resultOutputFile String
secretName String
id string
lists GetApiGatewayApiKeysList[]
A list of API keys.
apiKeyId string
API key ID.
resultOutputFile string
secretName string
id String
lists List<Property Map>
A list of API keys.
apiKeyId String
API key ID.
resultOutputFile String
secretName String

Supporting Types

GetApiGatewayApiKeysList

AccessKeySecret This property is required. string
Created API key.
ApiKeyId This property is required. string
Created API key ID, this field is exactly the same as ID.
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.
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.
Status This property is required. string
Key status. Values: on, off.
AccessKeySecret This property is required. string
Created API key.
ApiKeyId This property is required. string
Created API key ID, this field is exactly the same as ID.
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.
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.
Status This property is required. string
Key status. Values: on, off.
accessKeySecret This property is required. String
Created API key.
apiKeyId This property is required. String
Created API key ID, this field is exactly the same as ID.
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.
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.
status This property is required. String
Key status. Values: on, off.
accessKeySecret This property is required. string
Created API key.
apiKeyId This property is required. string
Created API key ID, this field is exactly the same as ID.
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.
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.
status This property is required. string
Key status. Values: on, off.
access_key_secret This property is required. str
Created API key.
api_key_id This property is required. str
Created API key ID, this field is exactly the same as ID.
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.
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.
status This property is required. str
Key status. Values: on, off.
accessKeySecret This property is required. String
Created API key.
apiKeyId This property is required. String
Created API key ID, this field is exactly the same as ID.
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.
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.
status This property is required. String
Key status. Values: on, off.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.