1. Packages
  2. Volcengine
  3. API Docs
  4. kms
  5. getDataKeys
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 data keys

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    
    const dataKey = volcengine.kms.getDataKeys({
        keyId: "c44870c3-f33b-421a-****-a2bba37c993e",
        numberOfBytes: 1024,
    });
    const default = dataKey.then(dataKey => volcengine.kms.getPlaintexts({
        ciphertextBlob: dataKey.dataKeyInfos?.[0]?.ciphertextBlob,
    }));
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    data_key = volcengine.kms.get_data_keys(key_id="c44870c3-f33b-421a-****-a2bba37c993e",
        number_of_bytes=1024)
    default = volcengine.kms.get_plaintexts(ciphertext_blob=data_key.data_key_infos[0].ciphertext_blob)
    
    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 {
    		dataKey, err := kms.GetDataKeys(ctx, &kms.GetDataKeysArgs{
    			KeyId:         pulumi.StringRef("c44870c3-f33b-421a-****-a2bba37c993e"),
    			NumberOfBytes: pulumi.IntRef(1024),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = kms.GetPlaintexts(ctx, &kms.GetPlaintextsArgs{
    			CiphertextBlob: dataKey.DataKeyInfos[0].CiphertextBlob,
    		}, 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 dataKey = Volcengine.Kms.GetDataKeys.Invoke(new()
        {
            KeyId = "c44870c3-f33b-421a-****-a2bba37c993e",
            NumberOfBytes = 1024,
        });
    
        var @default = Volcengine.Kms.GetPlaintexts.Invoke(new()
        {
            CiphertextBlob = dataKey.Apply(getDataKeysResult => getDataKeysResult.DataKeyInfos[0]?.CiphertextBlob),
        });
    
    });
    
    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.GetDataKeysArgs;
    import com.pulumi.volcengine.kms.inputs.GetPlaintextsArgs;
    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 dataKey = KmsFunctions.getDataKeys(GetDataKeysArgs.builder()
                .keyId("c44870c3-f33b-421a-****-a2bba37c993e")
                .numberOfBytes(1024)
                .build());
    
            final var default = KmsFunctions.getPlaintexts(GetPlaintextsArgs.builder()
                .ciphertextBlob(dataKey.applyValue(getDataKeysResult -> getDataKeysResult.dataKeyInfos()[0].ciphertextBlob()))
                .build());
    
        }
    }
    
    variables:
      dataKey:
        fn::invoke:
          Function: volcengine:kms:getDataKeys
          Arguments:
            keyId: c44870c3-f33b-421a-****-a2bba37c993e
            numberOfBytes: 1024
      default:
        fn::invoke:
          Function: volcengine:kms:getPlaintexts
          Arguments:
            ciphertextBlob: ${dataKey.dataKeyInfos[0].ciphertextBlob}
    

    Using getDataKeys

    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 getDataKeys(args: GetDataKeysArgs, opts?: InvokeOptions): Promise<GetDataKeysResult>
    function getDataKeysOutput(args: GetDataKeysOutputArgs, opts?: InvokeOptions): Output<GetDataKeysResult>
    def get_data_keys(encryption_context: Optional[str] = None,
                      key_id: Optional[str] = None,
                      key_name: Optional[str] = None,
                      keyring_name: Optional[str] = None,
                      number_of_bytes: Optional[int] = None,
                      output_file: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDataKeysResult
    def get_data_keys_output(encryption_context: Optional[pulumi.Input[str]] = None,
                      key_id: Optional[pulumi.Input[str]] = None,
                      key_name: Optional[pulumi.Input[str]] = None,
                      keyring_name: Optional[pulumi.Input[str]] = None,
                      number_of_bytes: Optional[pulumi.Input[int]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDataKeysResult]
    func GetDataKeys(ctx *Context, args *GetDataKeysArgs, opts ...InvokeOption) (*GetDataKeysResult, error)
    func GetDataKeysOutput(ctx *Context, args *GetDataKeysOutputArgs, opts ...InvokeOption) GetDataKeysResultOutput

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

    public static class GetDataKeys 
    {
        public static Task<GetDataKeysResult> InvokeAsync(GetDataKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetDataKeysResult> Invoke(GetDataKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDataKeysResult> getDataKeys(GetDataKeysArgs args, InvokeOptions options)
    public static Output<GetDataKeysResult> getDataKeys(GetDataKeysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:kms/getDataKeys:getDataKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EncryptionContext string
    The JSON string of key/value pairs.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Only symmetric key is supported.
    KeyringName string
    The name of the keyring.
    NumberOfBytes int
    The length of data key to generate.
    OutputFile string
    File name where to save data source results.
    EncryptionContext string
    The JSON string of key/value pairs.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Only symmetric key is supported.
    KeyringName string
    The name of the keyring.
    NumberOfBytes int
    The length of data key to generate.
    OutputFile string
    File name where to save data source results.
    encryptionContext String
    The JSON string of key/value pairs.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Only symmetric key is supported.
    keyringName String
    The name of the keyring.
    numberOfBytes Integer
    The length of data key to generate.
    outputFile String
    File name where to save data source results.
    encryptionContext string
    The JSON string of key/value pairs.
    keyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName string
    The name of the key. Only symmetric key is supported.
    keyringName string
    The name of the keyring.
    numberOfBytes number
    The length of data key to generate.
    outputFile string
    File name where to save data source results.
    encryption_context str
    The JSON string of key/value pairs.
    key_id str
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    key_name str
    The name of the key. Only symmetric key is supported.
    keyring_name str
    The name of the keyring.
    number_of_bytes int
    The length of data key to generate.
    output_file str
    File name where to save data source results.
    encryptionContext String
    The JSON string of key/value pairs.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Only symmetric key is supported.
    keyringName String
    The name of the keyring.
    numberOfBytes Number
    The length of data key to generate.
    outputFile String
    File name where to save data source results.

    getDataKeys Result

    The following output properties are available:

    DataKeyInfos List<GetDataKeysDataKeyInfo>
    The data key info.
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of query.
    EncryptionContext string
    KeyId string
    KeyName string
    KeyringName string
    NumberOfBytes int
    OutputFile string
    DataKeyInfos []GetDataKeysDataKeyInfo
    The data key info.
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of query.
    EncryptionContext string
    KeyId string
    KeyName string
    KeyringName string
    NumberOfBytes int
    OutputFile string
    dataKeyInfos List<GetDataKeysDataKeyInfo>
    The data key info.
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Integer
    The total count of query.
    encryptionContext String
    keyId String
    keyName String
    keyringName String
    numberOfBytes Integer
    outputFile String
    dataKeyInfos GetDataKeysDataKeyInfo[]
    The data key info.
    id string
    The provider-assigned unique ID for this managed resource.
    totalCount number
    The total count of query.
    encryptionContext string
    keyId string
    keyName string
    keyringName string
    numberOfBytes number
    outputFile string
    data_key_infos Sequence[GetDataKeysDataKeyInfo]
    The data key info.
    id str
    The provider-assigned unique ID for this managed resource.
    total_count int
    The total count of query.
    encryption_context str
    key_id str
    key_name str
    keyring_name str
    number_of_bytes int
    output_file str
    dataKeyInfos List<Property Map>
    The data key info.
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Number
    The total count of query.
    encryptionContext String
    keyId String
    keyName String
    keyringName String
    numberOfBytes Number
    outputFile String

    Supporting Types

    GetDataKeysDataKeyInfo

    CiphertextBlob string
    The generated ciphertext, Base64 encoded.
    Plaintext string
    The generated plaintext, Base64 encoded.
    CiphertextBlob string
    The generated ciphertext, Base64 encoded.
    Plaintext string
    The generated plaintext, Base64 encoded.
    ciphertextBlob String
    The generated ciphertext, Base64 encoded.
    plaintext String
    The generated plaintext, Base64 encoded.
    ciphertextBlob string
    The generated ciphertext, Base64 encoded.
    plaintext string
    The generated plaintext, Base64 encoded.
    ciphertext_blob str
    The generated ciphertext, Base64 encoded.
    plaintext str
    The generated plaintext, Base64 encoded.
    ciphertextBlob String
    The generated ciphertext, Base64 encoded.
    plaintext String
    The generated plaintext, Base64 encoded.

    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