1. Packages
  2. Volcengine
  3. API Docs
  4. kms
  5. getPublicKeys
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
volcengine logo
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine

    Use this data source to query detailed information of kms public keys

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    
    const default = volcengine.kms.getPublicKeys({
        keyName: "Test-key2",
        keyringName: "Tf-test",
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    default = volcengine.kms.get_public_keys(key_name="Test-key2",
        keyring_name="Tf-test")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/kms"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.GetPublicKeys(ctx, &kms.GetPublicKeysArgs{
    			KeyName:     pulumi.StringRef("Test-key2"),
    			KeyringName: pulumi.StringRef("Tf-test"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = Volcengine.Kms.GetPublicKeys.Invoke(new()
        {
            KeyName = "Test-key2",
            KeyringName = "Tf-test",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.kms.KmsFunctions;
    import com.pulumi.volcengine.kms.inputs.GetPublicKeysArgs;
    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) {
            final var default = KmsFunctions.getPublicKeys(GetPublicKeysArgs.builder()
                .keyName("Test-key2")
                .keyringName("Tf-test")
                .build());
    
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: volcengine:kms:getPublicKeys
          Arguments:
            keyName: Test-key2
            keyringName: Tf-test
    

    Using getPublicKeys

    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 getPublicKeys(args: GetPublicKeysArgs, opts?: InvokeOptions): Promise<GetPublicKeysResult>
    function getPublicKeysOutput(args: GetPublicKeysOutputArgs, opts?: InvokeOptions): Output<GetPublicKeysResult>
    def get_public_keys(key_id: Optional[str] = None,
                        key_name: Optional[str] = None,
                        keyring_name: Optional[str] = None,
                        output_file: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetPublicKeysResult
    def get_public_keys_output(key_id: Optional[pulumi.Input[str]] = None,
                        key_name: Optional[pulumi.Input[str]] = None,
                        keyring_name: Optional[pulumi.Input[str]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetPublicKeysResult]
    func GetPublicKeys(ctx *Context, args *GetPublicKeysArgs, opts ...InvokeOption) (*GetPublicKeysResult, error)
    func GetPublicKeysOutput(ctx *Context, args *GetPublicKeysOutputArgs, opts ...InvokeOption) GetPublicKeysResultOutput

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

    public static class GetPublicKeys 
    {
        public static Task<GetPublicKeysResult> InvokeAsync(GetPublicKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetPublicKeysResult> Invoke(GetPublicKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPublicKeysResult> getPublicKeys(GetPublicKeysArgs args, InvokeOptions options)
    public static Output<GetPublicKeysResult> getPublicKeys(GetPublicKeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:kms/getPublicKeys:getPublicKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    KeyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of key.
    KeyringName string
    The name of keyring.
    OutputFile string
    File name where to save data source results.
    KeyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of key.
    KeyringName string
    The name of keyring.
    OutputFile string
    File name where to save data source results.
    keyId String
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of key.
    keyringName String
    The name of keyring.
    outputFile String
    File name where to save data source results.
    keyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName string
    The name of key.
    keyringName string
    The name of keyring.
    outputFile string
    File name where to save data source results.
    key_id str
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    key_name str
    The name of key.
    keyring_name str
    The name of keyring.
    output_file str
    File name where to save data source results.
    keyId String
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of key.
    keyringName String
    The name of keyring.
    outputFile String
    File name where to save data source results.

    getPublicKeys Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    PublicKeys List<GetPublicKeysPublicKey>
    The public key in PEM format.
    TotalCount int
    The total count of query.
    KeyId string
    The id of key.
    KeyName string
    KeyringName string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    PublicKeys []GetPublicKeysPublicKey
    The public key in PEM format.
    TotalCount int
    The total count of query.
    KeyId string
    The id of key.
    KeyName string
    KeyringName string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    publicKeys List<GetPublicKeysPublicKey>
    The public key in PEM format.
    totalCount Integer
    The total count of query.
    keyId String
    The id of key.
    keyName String
    keyringName String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    publicKeys GetPublicKeysPublicKey[]
    The public key in PEM format.
    totalCount number
    The total count of query.
    keyId string
    The id of key.
    keyName string
    keyringName string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    public_keys Sequence[GetPublicKeysPublicKey]
    The public key in PEM format.
    total_count int
    The total count of query.
    key_id str
    The id of key.
    key_name str
    keyring_name str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    publicKeys List<Property Map>
    The public key in PEM format.
    totalCount Number
    The total count of query.
    keyId String
    The id of key.
    keyName String
    keyringName String
    outputFile String

    Supporting Types

    GetPublicKeysPublicKey

    KeyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    PublicKey string
    The public key in PEM format.
    KeyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    PublicKey string
    The public key in PEM format.
    keyId String
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    publicKey String
    The public key in PEM format.
    keyId string
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    publicKey string
    The public key in PEM format.
    key_id str
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    public_key str
    The public key in PEM format.
    keyId String
    The id of key. When key_id is not specified, both keyring_name and key_name must be specified.
    publicKey String
    The public key in PEM format.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate