alicloud.kms.KeyVersion
Explore with Pulumi AI
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
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 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
})
}
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());
}
}
import pulumi
import pulumi_alicloud as alicloud
this = alicloud.kms.Key("this")
keyversion = alicloud.kms.KeyVersion("keyversion", key_id=this.id)
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});
resources:
this:
type: alicloud:kms:Key
keyversion:
type: alicloud:kms:KeyVersion
properties:
keyId: ${this.id}
Create KeyVersion Resource
new KeyVersion(name: string, args: KeyVersionArgs, opts?: CustomResourceOptions);
@overload
def KeyVersion(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_id: Optional[str] = None)
@overload
def KeyVersion(resource_name: str,
args: KeyVersionArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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:
- Key
Id string The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- Key
Id string The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- key
Id String The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- key
Id 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.
- key
Id 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.
- Key
Version stringId The id of the Alikms key version.
- Id string
The provider-assigned unique ID for this managed resource.
- Key
Version stringId The id of the Alikms key version.
- id String
The provider-assigned unique ID for this managed resource.
- key
Version StringId The id of the Alikms key version.
- id string
The provider-assigned unique ID for this managed resource.
- key
Version stringId The id of the Alikms key version.
- id str
The provider-assigned unique ID for this managed resource.
- key_
version_ strid The id of the Alikms key version.
- id String
The provider-assigned unique ID for this managed resource.
- key
Version StringId 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.
- Key
Id string The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- Key
Version stringId The id of the Alikms key version.
- Key
Id string The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- Key
Version stringId The id of the Alikms key version.
- key
Id String The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- key
Version StringId The id of the Alikms key version.
- key
Id string The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- key
Version stringId 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_ strid The id of the Alikms key version.
- key
Id String The id of the master key (CMK).
NOTE: The minimum interval for creating a Alikms key version is 7 days.
- key
Version StringId 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-*****
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.