tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
tencentcloud.getKmsPublicKey
Start a Neo task
Explain and create a tencentcloud.getKmsPublicKey resource
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
Use this data source to query detailed information of kms public_key
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleKmsKey = new tencentcloud.KmsKey("example", {
alias: "tf-example-kms-key",
description: "example of kms key",
keyUsage: "ASYMMETRIC_DECRYPT_RSA_2048",
isEnabled: true,
pendingDeleteWindowInDays: 7,
});
const example = tencentcloud.getKmsPublicKeyOutput({
keyId: exampleKmsKey.kmsKeyId,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_kms_key = tencentcloud.KmsKey("example",
alias="tf-example-kms-key",
description="example of kms key",
key_usage="ASYMMETRIC_DECRYPT_RSA_2048",
is_enabled=True,
pending_delete_window_in_days=7)
example = tencentcloud.get_kms_public_key_output(key_id=example_kms_key.kms_key_id)
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 {
exampleKmsKey, err := tencentcloud.NewKmsKey(ctx, "example", &tencentcloud.KmsKeyArgs{
Alias: pulumi.String("tf-example-kms-key"),
Description: pulumi.String("example of kms key"),
KeyUsage: pulumi.String("ASYMMETRIC_DECRYPT_RSA_2048"),
IsEnabled: pulumi.Bool(true),
PendingDeleteWindowInDays: pulumi.Float64(7),
})
if err != nil {
return err
}
_ = tencentcloud.GetKmsPublicKeyOutput(ctx, tencentcloud.GetKmsPublicKeyOutputArgs{
KeyId: exampleKmsKey.KmsKeyId,
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var exampleKmsKey = new Tencentcloud.KmsKey("example", new()
{
Alias = "tf-example-kms-key",
Description = "example of kms key",
KeyUsage = "ASYMMETRIC_DECRYPT_RSA_2048",
IsEnabled = true,
PendingDeleteWindowInDays = 7,
});
var example = Tencentcloud.GetKmsPublicKey.Invoke(new()
{
KeyId = exampleKmsKey.KmsKeyId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.KmsKey;
import com.pulumi.tencentcloud.KmsKeyArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetKmsPublicKeyArgs;
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 exampleKmsKey = new KmsKey("exampleKmsKey", KmsKeyArgs.builder()
.alias("tf-example-kms-key")
.description("example of kms key")
.keyUsage("ASYMMETRIC_DECRYPT_RSA_2048")
.isEnabled(true)
.pendingDeleteWindowInDays(7.0)
.build());
final var example = TencentcloudFunctions.getKmsPublicKey(GetKmsPublicKeyArgs.builder()
.keyId(exampleKmsKey.kmsKeyId())
.build());
}
}
resources:
exampleKmsKey:
type: tencentcloud:KmsKey
name: example
properties:
alias: tf-example-kms-key
description: example of kms key
keyUsage: ASYMMETRIC_DECRYPT_RSA_2048
isEnabled: true
pendingDeleteWindowInDays: 7
variables:
example:
fn::invoke:
function: tencentcloud:getKmsPublicKey
arguments:
keyId: ${exampleKmsKey.kmsKeyId}
Using getKmsPublicKey
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 getKmsPublicKey(args: GetKmsPublicKeyArgs, opts?: InvokeOptions): Promise<GetKmsPublicKeyResult>
function getKmsPublicKeyOutput(args: GetKmsPublicKeyOutputArgs, opts?: InvokeOptions): Output<GetKmsPublicKeyResult>def get_kms_public_key(id: Optional[str] = None,
key_id: Optional[str] = None,
result_output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKmsPublicKeyResult
def get_kms_public_key_output(id: Optional[pulumi.Input[str]] = None,
key_id: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKmsPublicKeyResult]func GetKmsPublicKey(ctx *Context, args *GetKmsPublicKeyArgs, opts ...InvokeOption) (*GetKmsPublicKeyResult, error)
func GetKmsPublicKeyOutput(ctx *Context, args *GetKmsPublicKeyOutputArgs, opts ...InvokeOption) GetKmsPublicKeyResultOutput> Note: This function is named GetKmsPublicKey in the Go SDK.
public static class GetKmsPublicKey
{
public static Task<GetKmsPublicKeyResult> InvokeAsync(GetKmsPublicKeyArgs args, InvokeOptions? opts = null)
public static Output<GetKmsPublicKeyResult> Invoke(GetKmsPublicKeyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKmsPublicKeyResult> getKmsPublicKey(GetKmsPublicKeyArgs args, InvokeOptions options)
public static Output<GetKmsPublicKeyResult> getKmsPublicKey(GetKmsPublicKeyArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getKmsPublicKey:getKmsPublicKey
arguments:
# arguments dictionaryThe following arguments are supported:
- Key
Id string - CMK unique identifier.
- Id string
- Result
Output stringFile - Used to save results.
- Key
Id string - CMK unique identifier.
- Id string
- Result
Output stringFile - Used to save results.
- key
Id String - CMK unique identifier.
- id String
- result
Output StringFile - Used to save results.
- key
Id string - CMK unique identifier.
- id string
- result
Output stringFile - Used to save results.
- key_
id str - CMK unique identifier.
- id str
- result_
output_ strfile - Used to save results.
- key
Id String - CMK unique identifier.
- id String
- result
Output StringFile - Used to save results.
getKmsPublicKey Result
The following output properties are available:
- Id string
- Key
Id string - Public
Key string - Base64-encoded public key content.
- Public
Key stringPem - Public key content in PEM format.
- Result
Output stringFile
- Id string
- Key
Id string - Public
Key string - Base64-encoded public key content.
- Public
Key stringPem - Public key content in PEM format.
- Result
Output stringFile
- id String
- key
Id String - public
Key String - Base64-encoded public key content.
- public
Key StringPem - Public key content in PEM format.
- result
Output StringFile
- id string
- key
Id string - public
Key string - Base64-encoded public key content.
- public
Key stringPem - Public key content in PEM format.
- result
Output stringFile
- id str
- key_
id str - public_
key str - Base64-encoded public key content.
- public_
key_ strpem - Public key content in PEM format.
- result_
output_ strfile
- id String
- key
Id String - public
Key String - Base64-encoded public key content.
- public
Key StringPem - Public key content in PEM format.
- result
Output StringFile
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
