1. Registry
  2. Packages
  3. Vkcs Provider
  4. API Docs
  5. KmsKey
Viewing docs for vkcs 0.19.0
published on Tuesday, Oct 27, 2026 by vk-cs
vkcs
Viewing docs for vkcs 0.19.0
published on Tuesday, Oct 27, 2026 by vk-cs

    Resource representing KMS key

    Keys are protected from deletion by default. Before destroying a key, set deletion_allowed = true and apply the change.

    type and deletion_allowed are configurable. If omitted, they default to aes256-gcm96 and false, respectively.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const key = new vkcs.KmsKey("key", {
        name: "some-key",
        type: "aes256-gcm96",
        deletionAllowed: true,
    });
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    key = vkcs.KmsKey("key",
        name="some-key",
        type="aes256-gcm96",
        deletion_allowed=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.NewKmsKey(ctx, "key", &vkcs.KmsKeyArgs{
    			Name:            pulumi.String("some-key"),
    			Type:            pulumi.String("aes256-gcm96"),
    			DeletionAllowed: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var key = new Vkcs.KmsKey("key", new()
        {
            Name = "some-key",
            Type = "aes256-gcm96",
            DeletionAllowed = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.KmsKey;
    import com.pulumi.vkcs.KmsKeyArgs;
    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 key = new KmsKey("key", KmsKeyArgs.builder()
                .name("some-key")
                .type("aes256-gcm96")
                .deletionAllowed(true)
                .build());
    
        }
    }
    
    resources:
      key:
        type: vkcs:KmsKey
        properties:
          name: some-key
          type: aes256-gcm96
          deletionAllowed: true
    
    Example coming soon!
    

    Create KmsKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new KmsKey(name: string, args?: KmsKeyArgs, opts?: CustomResourceOptions);
    @overload
    def KmsKey(resource_name: str,
               args: Optional[KmsKeyArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def KmsKey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               deletion_allowed: Optional[bool] = None,
               name: Optional[str] = None,
               type: Optional[str] = None)
    func NewKmsKey(ctx *Context, name string, args *KmsKeyArgs, opts ...ResourceOption) (*KmsKey, error)
    public KmsKey(string name, KmsKeyArgs? args = null, CustomResourceOptions? opts = null)
    public KmsKey(String name, KmsKeyArgs args)
    public KmsKey(String name, KmsKeyArgs args, CustomResourceOptions options)
    
    type: vkcs:KmsKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "vkcs_kms_key" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args KmsKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args KmsKeyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args KmsKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KmsKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KmsKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var kmsKeyResource = new Vkcs.KmsKey("kmsKeyResource", new()
    {
        DeletionAllowed = false,
        Name = "string",
        Type = "string",
    });
    
    example, err := vkcs.NewKmsKey(ctx, "kmsKeyResource", &vkcs.KmsKeyArgs{
    	DeletionAllowed: pulumi.Bool(false),
    	Name:            pulumi.String("string"),
    	Type:            pulumi.String("string"),
    })
    
    resource "vkcs_kms_key" "kmsKeyResource" {
      lifecycle {
        create_before_destroy = true
      }
      deletion_allowed = false
      name             = "string"
      type             = "string"
    }
    
    var kmsKeyResource = new KmsKey("kmsKeyResource", KmsKeyArgs.builder()
        .deletionAllowed(false)
        .name("string")
        .type("string")
        .build());
    
    kms_key_resource = vkcs.KmsKey("kmsKeyResource",
        deletion_allowed=False,
        name="string",
        type="string")
    
    const kmsKeyResource = new vkcs.KmsKey("kmsKeyResource", {
        deletionAllowed: false,
        name: "string",
        type: "string",
    });
    
    type: vkcs:KmsKey
    properties:
        deletionAllowed: false
        name: string
        type: string
    

    KmsKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The KmsKey resource accepts the following input properties:

    DeletionAllowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    Name string
    required string → Name of the KMS key. Changing this forces a new resource.
    Type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    DeletionAllowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    Name string
    required string → Name of the KMS key. Changing this forces a new resource.
    Type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletion_allowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name string
    required string → Name of the KMS key. Changing this forces a new resource.
    type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed Boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name String
    required string → Name of the KMS key. Changing this forces a new resource.
    type String
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name string
    required string → Name of the KMS key. Changing this forces a new resource.
    type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletion_allowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name str
    required string → Name of the KMS key. Changing this forces a new resource.
    type str
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed Boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name String
    required string → Name of the KMS key. Changing this forces a new resource.
    type String
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KmsKey resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing KmsKey Resource

    Get an existing KmsKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: KmsKeyState, opts?: CustomResourceOptions): KmsKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            deletion_allowed: Optional[bool] = None,
            name: Optional[str] = None,
            type: Optional[str] = None) -> KmsKey
    func GetKmsKey(ctx *Context, name string, id IDInput, state *KmsKeyState, opts ...ResourceOption) (*KmsKey, error)
    public static KmsKey Get(string name, Input<string> id, KmsKeyState? state, CustomResourceOptions? opts = null)
    public static KmsKey get(String name, Output<String> id, KmsKeyState state, CustomResourceOptions options)
    resources:  existingKmsKey:    type: vkcs:KmsKey    get:      id: ${id}
    import {
      to = vkcs_kms_key.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state KmsKeyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state KmsKeyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state KmsKeyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state KmsKeyState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    DeletionAllowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    Name string
    required string → Name of the KMS key. Changing this forces a new resource.
    Type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    DeletionAllowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    Name string
    required string → Name of the KMS key. Changing this forces a new resource.
    Type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletion_allowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name string
    required string → Name of the KMS key. Changing this forces a new resource.
    type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed Boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name String
    required string → Name of the KMS key. Changing this forces a new resource.
    type String
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name string
    required string → Name of the KMS key. Changing this forces a new resource.
    type string
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletion_allowed bool
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name str
    required string → Name of the KMS key. Changing this forces a new resource.
    type str
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.
    deletionAllowed Boolean
    optional computed boolean → Whether KMS allows the key to be deleted. Defaults to false. Set to true and apply before destroying the key.
    name String
    required string → Name of the KMS key. Changing this forces a new resource.
    type String
    optional computed string → Type of the KMS key: aes128-gcm96, aes256-gcm96, chacha20-poly1305, or xchacha20-poly1305. Defaults to aes256-gcm96. Changing this forces a new resource.

    Import

    Import is not currently supported.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs
    Viewing docs for vkcs 0.19.0
    published on Tuesday, Oct 27, 2026 by vk-cs

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial