1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. getKmsDataKeyV1
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.getKmsDataKeyV1

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    Use this data source to get the plaintext and the ciphertext of an available FlexibleEngine KMS DEK (data encryption key).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const key1 = new flexibleengine.KmsKeyV1("key1", {
        keyAlias: "key_1",
        pendingDays: "7",
        keyDescription: "first test key",
    });
    const kmsDatakey1 = flexibleengine.getKmsDataKeyV1Output({
        keyId: key1.kmsKeyV1Id,
        datakeyLength: "512",
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    key1 = flexibleengine.KmsKeyV1("key1",
        key_alias="key_1",
        pending_days="7",
        key_description="first test key")
    kms_datakey1 = flexibleengine.get_kms_data_key_v1_output(key_id=key1.kms_key_v1_id,
        datakey_length="512")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		key1, err := flexibleengine.NewKmsKeyV1(ctx, "key1", &flexibleengine.KmsKeyV1Args{
    			KeyAlias:       pulumi.String("key_1"),
    			PendingDays:    pulumi.String("7"),
    			KeyDescription: pulumi.String("first test key"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = flexibleengine.GetKmsDataKeyV1Output(ctx, flexibleengine.GetKmsDataKeyV1OutputArgs{
    			KeyId:         key1.KmsKeyV1Id,
    			DatakeyLength: pulumi.String("512"),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var key1 = new Flexibleengine.KmsKeyV1("key1", new()
        {
            KeyAlias = "key_1",
            PendingDays = "7",
            KeyDescription = "first test key",
        });
    
        var kmsDatakey1 = Flexibleengine.GetKmsDataKeyV1.Invoke(new()
        {
            KeyId = key1.KmsKeyV1Id,
            DatakeyLength = "512",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.KmsKeyV1;
    import com.pulumi.flexibleengine.KmsKeyV1Args;
    import com.pulumi.flexibleengine.FlexibleengineFunctions;
    import com.pulumi.flexibleengine.inputs.GetKmsDataKeyV1Args;
    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 key1 = new KmsKeyV1("key1", KmsKeyV1Args.builder()
                .keyAlias("key_1")
                .pendingDays("7")
                .keyDescription("first test key")
                .build());
    
            final var kmsDatakey1 = FlexibleengineFunctions.getKmsDataKeyV1(GetKmsDataKeyV1Args.builder()
                .keyId(key1.kmsKeyV1Id())
                .datakeyLength("512")
                .build());
    
        }
    }
    
    resources:
      key1:
        type: flexibleengine:KmsKeyV1
        properties:
          keyAlias: key_1
          pendingDays: '7'
          keyDescription: first test key
    variables:
      kmsDatakey1:
        fn::invoke:
          function: flexibleengine:getKmsDataKeyV1
          arguments:
            keyId: ${key1.kmsKeyV1Id}
            datakeyLength: '512'
    

    Using getKmsDataKeyV1

    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 getKmsDataKeyV1(args: GetKmsDataKeyV1Args, opts?: InvokeOptions): Promise<GetKmsDataKeyV1Result>
    function getKmsDataKeyV1Output(args: GetKmsDataKeyV1OutputArgs, opts?: InvokeOptions): Output<GetKmsDataKeyV1Result>
    def get_kms_data_key_v1(datakey_length: Optional[str] = None,
                            encryption_context: Optional[str] = None,
                            id: Optional[str] = None,
                            key_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetKmsDataKeyV1Result
    def get_kms_data_key_v1_output(datakey_length: Optional[pulumi.Input[str]] = None,
                            encryption_context: Optional[pulumi.Input[str]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            key_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetKmsDataKeyV1Result]
    func GetKmsDataKeyV1(ctx *Context, args *GetKmsDataKeyV1Args, opts ...InvokeOption) (*GetKmsDataKeyV1Result, error)
    func GetKmsDataKeyV1Output(ctx *Context, args *GetKmsDataKeyV1OutputArgs, opts ...InvokeOption) GetKmsDataKeyV1ResultOutput

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

    public static class GetKmsDataKeyV1 
    {
        public static Task<GetKmsDataKeyV1Result> InvokeAsync(GetKmsDataKeyV1Args args, InvokeOptions? opts = null)
        public static Output<GetKmsDataKeyV1Result> Invoke(GetKmsDataKeyV1InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKmsDataKeyV1Result> getKmsDataKeyV1(GetKmsDataKeyV1Args args, InvokeOptions options)
    public static Output<GetKmsDataKeyV1Result> getKmsDataKeyV1(GetKmsDataKeyV1Args args, InvokeOptions options)
    
    fn::invoke:
      function: flexibleengine:index/getKmsDataKeyV1:getKmsDataKeyV1
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatakeyLength string
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    KeyId string
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    EncryptionContext string
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    Id string
    DatakeyLength string
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    KeyId string
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    EncryptionContext string
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    Id string
    datakeyLength String
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    keyId String
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    encryptionContext String
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    id String
    datakeyLength string
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    keyId string
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    encryptionContext string
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    id string
    datakey_length str
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    key_id str
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    encryption_context str
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    id str
    datakeyLength String
    Number of bits in the length of a DEK (data encryption keys). The maximum number is 512. Changing this gets the new data encryption key.
    keyId String
    The globally unique identifier for the key. Changing this gets the new data encryption key.
    encryptionContext String
    The value of this parameter must be a series of "key:value" pairs used to record resource context information. The value of this parameter must not contain sensitive information and must be within 8192 characters in length. Example: {"Key1":"Value1","Key2":"Value2"}
    id String

    getKmsDataKeyV1 Result

    The following output properties are available:

    CipherText string
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    DatakeyLength string
    Id string
    KeyId string
    PlainText string
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    EncryptionContext string
    CipherText string
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    DatakeyLength string
    Id string
    KeyId string
    PlainText string
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    EncryptionContext string
    cipherText String
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    datakeyLength String
    id String
    keyId String
    plainText String
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    encryptionContext String
    cipherText string
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    datakeyLength string
    id string
    keyId string
    plainText string
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    encryptionContext string
    cipher_text str
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    datakey_length str
    id str
    key_id str
    plain_text str
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    encryption_context str
    cipherText String
    The ciphertext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    datakeyLength String
    id String
    keyId String
    plainText String
    The plaintext of a DEK is expressed in hexadecimal format, and two characters indicate one byte.
    encryptionContext String

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud