1. Packages
  2. Volcengine
  3. API Docs
  4. kms
  5. KeyArchive
Volcengine v0.0.34 published on Wednesday, Jul 2, 2025 by Volcengine

volcengine.kms.KeyArchive

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.34 published on Wednesday, Jul 2, 2025 by Volcengine

    Provides a resource to manage kms key archive

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooKeyring = new volcengine.kms.Keyring("fooKeyring", {
        keyringName: "tf-test",
        description: "tf-test",
        projectName: "default",
    });
    const fooKey = new volcengine.kms.Key("fooKey", {
        keyringName: fooKeyring.keyringName,
        keyName: "mrk-tf-key-mod",
        description: "tf test key-mod",
        tags: [{
            key: "tfkey3",
            value: "tfvalue3",
        }],
    });
    const fooKeyArchive = new volcengine.kms.KeyArchive("fooKeyArchive", {keyId: fooKey.id});
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_keyring = volcengine.kms.Keyring("fooKeyring",
        keyring_name="tf-test",
        description="tf-test",
        project_name="default")
    foo_key = volcengine.kms.Key("fooKey",
        keyring_name=foo_keyring.keyring_name,
        key_name="mrk-tf-key-mod",
        description="tf test key-mod",
        tags=[volcengine.kms.KeyTagArgs(
            key="tfkey3",
            value="tfvalue3",
        )])
    foo_key_archive = volcengine.kms.KeyArchive("fooKeyArchive", key_id=foo_key.id)
    
    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 {
    		fooKeyring, err := kms.NewKeyring(ctx, "fooKeyring", &kms.KeyringArgs{
    			KeyringName: pulumi.String("tf-test"),
    			Description: pulumi.String("tf-test"),
    			ProjectName: pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		fooKey, err := kms.NewKey(ctx, "fooKey", &kms.KeyArgs{
    			KeyringName: fooKeyring.KeyringName,
    			KeyName:     pulumi.String("mrk-tf-key-mod"),
    			Description: pulumi.String("tf test key-mod"),
    			Tags: kms.KeyTagArray{
    				&kms.KeyTagArgs{
    					Key:   pulumi.String("tfkey3"),
    					Value: pulumi.String("tfvalue3"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = kms.NewKeyArchive(ctx, "fooKeyArchive", &kms.KeyArchiveArgs{
    			KeyId: fooKey.ID(),
    		})
    		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 fooKeyring = new Volcengine.Kms.Keyring("fooKeyring", new()
        {
            KeyringName = "tf-test",
            Description = "tf-test",
            ProjectName = "default",
        });
    
        var fooKey = new Volcengine.Kms.Key("fooKey", new()
        {
            KeyringName = fooKeyring.KeyringName,
            KeyName = "mrk-tf-key-mod",
            Description = "tf test key-mod",
            Tags = new[]
            {
                new Volcengine.Kms.Inputs.KeyTagArgs
                {
                    Key = "tfkey3",
                    Value = "tfvalue3",
                },
            },
        });
    
        var fooKeyArchive = new Volcengine.Kms.KeyArchive("fooKeyArchive", new()
        {
            KeyId = fooKey.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.kms.Keyring;
    import com.pulumi.volcengine.kms.KeyringArgs;
    import com.pulumi.volcengine.kms.Key;
    import com.pulumi.volcengine.kms.KeyArgs;
    import com.pulumi.volcengine.kms.inputs.KeyTagArgs;
    import com.pulumi.volcengine.kms.KeyArchive;
    import com.pulumi.volcengine.kms.KeyArchiveArgs;
    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 fooKeyring = new Keyring("fooKeyring", KeyringArgs.builder()        
                .keyringName("tf-test")
                .description("tf-test")
                .projectName("default")
                .build());
    
            var fooKey = new Key("fooKey", KeyArgs.builder()        
                .keyringName(fooKeyring.keyringName())
                .keyName("mrk-tf-key-mod")
                .description("tf test key-mod")
                .tags(KeyTagArgs.builder()
                    .key("tfkey3")
                    .value("tfvalue3")
                    .build())
                .build());
    
            var fooKeyArchive = new KeyArchive("fooKeyArchive", KeyArchiveArgs.builder()        
                .keyId(fooKey.id())
                .build());
    
        }
    }
    
    resources:
      fooKeyring:
        type: volcengine:kms:Keyring
        properties:
          keyringName: tf-test
          description: tf-test
          projectName: default
      fooKey:
        type: volcengine:kms:Key
        properties:
          keyringName: ${fooKeyring.keyringName}
          keyName: mrk-tf-key-mod
          description: tf test key-mod
          tags:
            - key: tfkey3
              value: tfvalue3
      fooKeyArchive:
        type: volcengine:kms:KeyArchive
        properties:
          keyId: ${fooKey.id}
    

    Create KeyArchive Resource

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

    Constructor syntax

    new KeyArchive(name: string, args?: KeyArchiveArgs, opts?: CustomResourceOptions);
    @overload
    def KeyArchive(resource_name: str,
                   args: Optional[KeyArchiveArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def KeyArchive(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   key_id: Optional[str] = None,
                   key_name: Optional[str] = None,
                   keyring_name: Optional[str] = None)
    func NewKeyArchive(ctx *Context, name string, args *KeyArchiveArgs, opts ...ResourceOption) (*KeyArchive, error)
    public KeyArchive(string name, KeyArchiveArgs? args = null, CustomResourceOptions? opts = null)
    public KeyArchive(String name, KeyArchiveArgs args)
    public KeyArchive(String name, KeyArchiveArgs args, CustomResourceOptions options)
    
    type: volcengine:kms:KeyArchive
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args KeyArchiveArgs
    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 KeyArchiveArgs
    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 KeyArchiveArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeyArchiveArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeyArchiveArgs
    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 keyArchiveResource = new Volcengine.Kms.KeyArchive("keyArchiveResource", new()
    {
        KeyId = "string",
        KeyName = "string",
        KeyringName = "string",
    });
    
    example, err := kms.NewKeyArchive(ctx, "keyArchiveResource", &kms.KeyArchiveArgs{
    	KeyId:       pulumi.String("string"),
    	KeyName:     pulumi.String("string"),
    	KeyringName: pulumi.String("string"),
    })
    
    var keyArchiveResource = new KeyArchive("keyArchiveResource", KeyArchiveArgs.builder()
        .keyId("string")
        .keyName("string")
        .keyringName("string")
        .build());
    
    key_archive_resource = volcengine.kms.KeyArchive("keyArchiveResource",
        key_id="string",
        key_name="string",
        keyring_name="string")
    
    const keyArchiveResource = new volcengine.kms.KeyArchive("keyArchiveResource", {
        keyId: "string",
        keyName: "string",
        keyringName: "string",
    });
    
    type: volcengine:kms:KeyArchive
    properties:
        keyId: string
        keyName: string
        keyringName: string
    

    KeyArchive 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 KeyArchive resource accepts the following input properties:

    KeyId string
    The id of the CMK.
    KeyName string
    The name of the CMK.
    KeyringName string
    The name of the keyring.
    KeyId string
    The id of the CMK.
    KeyName string
    The name of the CMK.
    KeyringName string
    The name of the keyring.
    keyId String
    The id of the CMK.
    keyName String
    The name of the CMK.
    keyringName String
    The name of the keyring.
    keyId string
    The id of the CMK.
    keyName string
    The name of the CMK.
    keyringName string
    The name of the keyring.
    key_id str
    The id of the CMK.
    key_name str
    The name of the CMK.
    keyring_name str
    The name of the keyring.
    keyId String
    The id of the CMK.
    keyName String
    The name of the CMK.
    keyringName String
    The name of the keyring.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    KeyState string
    The state of the key.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyState string
    The state of the key.
    id String
    The provider-assigned unique ID for this managed resource.
    keyState String
    The state of the key.
    id string
    The provider-assigned unique ID for this managed resource.
    keyState string
    The state of the key.
    id str
    The provider-assigned unique ID for this managed resource.
    key_state str
    The state of the key.
    id String
    The provider-assigned unique ID for this managed resource.
    keyState String
    The state of the key.

    Look up Existing KeyArchive Resource

    Get an existing KeyArchive 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?: KeyArchiveState, opts?: CustomResourceOptions): KeyArchive
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key_id: Optional[str] = None,
            key_name: Optional[str] = None,
            key_state: Optional[str] = None,
            keyring_name: Optional[str] = None) -> KeyArchive
    func GetKeyArchive(ctx *Context, name string, id IDInput, state *KeyArchiveState, opts ...ResourceOption) (*KeyArchive, error)
    public static KeyArchive Get(string name, Input<string> id, KeyArchiveState? state, CustomResourceOptions? opts = null)
    public static KeyArchive get(String name, Output<String> id, KeyArchiveState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:kms:KeyArchive    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    KeyId string
    The id of the CMK.
    KeyName string
    The name of the CMK.
    KeyState string
    The state of the key.
    KeyringName string
    The name of the keyring.
    KeyId string
    The id of the CMK.
    KeyName string
    The name of the CMK.
    KeyState string
    The state of the key.
    KeyringName string
    The name of the keyring.
    keyId String
    The id of the CMK.
    keyName String
    The name of the CMK.
    keyState String
    The state of the key.
    keyringName String
    The name of the keyring.
    keyId string
    The id of the CMK.
    keyName string
    The name of the CMK.
    keyState string
    The state of the key.
    keyringName string
    The name of the keyring.
    key_id str
    The id of the CMK.
    key_name str
    The name of the CMK.
    key_state str
    The state of the key.
    keyring_name str
    The name of the keyring.
    keyId String
    The id of the CMK.
    keyName String
    The name of the CMK.
    keyState String
    The state of the key.
    keyringName String
    The name of the keyring.

    Import

    KmsKeyArchive can be imported using the id, e.g.

    $ pulumi import volcengine:kms/keyArchive:KeyArchive default resource_id
    

    or

    $ pulumi import volcengine:kms/keyArchive:KeyArchive default key_name:keyring_name
    

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

    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.34 published on Wednesday, Jul 2, 2025 by Volcengine