1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. kms
  5. KeyVersion
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

alicloud.kms.KeyVersion

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

    Provides a Alikms Key Version resource. For information about Alikms Key Version and how to use it, see What is Resource Alikms Key Version.

    NOTE: Available in v1.85.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _this = new alicloud.kms.Key("this", {});
    const keyversion = new alicloud.kms.KeyVersion("keyversion", {keyId: _this.id});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    this = alicloud.kms.Key("this")
    keyversion = alicloud.kms.KeyVersion("keyversion", key_id=this.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		this, err := kms.NewKey(ctx, "this", nil)
    		if err != nil {
    			return err
    		}
    		_, err = kms.NewKeyVersion(ctx, "keyversion", &kms.KeyVersionArgs{
    			KeyId: this.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new AliCloud.Kms.Key("this");
    
        var keyversion = new AliCloud.Kms.KeyVersion("keyversion", new()
        {
            KeyId = @this.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.kms.Key;
    import com.pulumi.alicloud.kms.KeyVersion;
    import com.pulumi.alicloud.kms.KeyVersionArgs;
    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 this_ = new Key("this");
    
            var keyversion = new KeyVersion("keyversion", KeyVersionArgs.builder()
                .keyId(this_.id())
                .build());
    
        }
    }
    
    resources:
      this:
        type: alicloud:kms:Key
      keyversion:
        type: alicloud:kms:KeyVersion
        properties:
          keyId: ${this.id}
    

    Create KeyVersion Resource

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

    Constructor syntax

    new KeyVersion(name: string, args: KeyVersionArgs, opts?: CustomResourceOptions);
    @overload
    def KeyVersion(resource_name: str,
                   args: KeyVersionArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def KeyVersion(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   key_id: Optional[str] = None)
    func NewKeyVersion(ctx *Context, name string, args KeyVersionArgs, opts ...ResourceOption) (*KeyVersion, error)
    public KeyVersion(string name, KeyVersionArgs args, CustomResourceOptions? opts = null)
    public KeyVersion(String name, KeyVersionArgs args)
    public KeyVersion(String name, KeyVersionArgs args, CustomResourceOptions options)
    
    type: alicloud:kms:KeyVersion
    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 KeyVersionArgs
    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 KeyVersionArgs
    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 KeyVersionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeyVersionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeyVersionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var keyVersionResource = new AliCloud.Kms.KeyVersion("keyVersionResource", new()
    {
        KeyId = "string",
    });
    
    example, err := kms.NewKeyVersion(ctx, "keyVersionResource", &kms.KeyVersionArgs{
    	KeyId: pulumi.String("string"),
    })
    
    var keyVersionResource = new KeyVersion("keyVersionResource", KeyVersionArgs.builder()
        .keyId("string")
        .build());
    
    key_version_resource = alicloud.kms.KeyVersion("keyVersionResource", key_id="string")
    
    const keyVersionResource = new alicloud.kms.KeyVersion("keyVersionResource", {keyId: "string"});
    
    type: alicloud:kms:KeyVersion
    properties:
        keyId: string
    

    KeyVersion Resource Properties

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

    Inputs

    The KeyVersion resource accepts the following input properties:

    KeyId string

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    KeyId string

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyId String

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyId string

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    key_id str

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyId String

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    KeyVersionId string
    The id of the Alikms key version.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyVersionId string
    The id of the Alikms key version.
    id String
    The provider-assigned unique ID for this managed resource.
    keyVersionId String
    The id of the Alikms key version.
    id string
    The provider-assigned unique ID for this managed resource.
    keyVersionId string
    The id of the Alikms key version.
    id str
    The provider-assigned unique ID for this managed resource.
    key_version_id str
    The id of the Alikms key version.
    id String
    The provider-assigned unique ID for this managed resource.
    keyVersionId String
    The id of the Alikms key version.

    Look up Existing KeyVersion Resource

    Get an existing KeyVersion 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?: KeyVersionState, opts?: CustomResourceOptions): KeyVersion
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key_id: Optional[str] = None,
            key_version_id: Optional[str] = None) -> KeyVersion
    func GetKeyVersion(ctx *Context, name string, id IDInput, state *KeyVersionState, opts ...ResourceOption) (*KeyVersion, error)
    public static KeyVersion Get(string name, Input<string> id, KeyVersionState? state, CustomResourceOptions? opts = null)
    public static KeyVersion get(String name, Output<String> id, KeyVersionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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 master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    KeyVersionId string
    The id of the Alikms key version.
    KeyId string

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    KeyVersionId string
    The id of the Alikms key version.
    keyId String

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyVersionId String
    The id of the Alikms key version.
    keyId string

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyVersionId string
    The id of the Alikms key version.
    key_id str

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    key_version_id str
    The id of the Alikms key version.
    keyId String

    The id of the master key (CMK).

    NOTE: The minimum interval for creating a Alikms key version is 7 days.

    keyVersionId String
    The id of the Alikms key version.

    Import

    Alikms key version can be imported using the id, e.g.

    $ pulumi import alicloud:kms/keyVersion:KeyVersion example 72da539a-2fa8-4f2d-b854-*****	
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi