Provides a resource to manage kms key
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 foo1 = new volcengine.kms.Key("foo1", {
keyringName: fooKeyring.keyringName,
keyName: "Tf-test-key-1",
rotateState: "Enable",
rotateInterval: 90,
keySpec: "SYMMETRIC_128",
description: "Tf test key with SYMMETRIC_128",
keyUsage: "ENCRYPT_DECRYPT",
protectionLevel: "SOFTWARE",
origin: "CloudKMS",
multiRegion: false,
pendingWindowInDays: 30,
tags: [
{
key: "tfk1",
value: "tfv1",
},
{
key: "tfk2",
value: "tfv2",
},
],
});
const foo2 = new volcengine.kms.Key("foo2", {
keyringName: fooKeyring.keyringName,
keyName: "mrk-Tf-test-key-2",
keyUsage: "ENCRYPT_DECRYPT",
origin: "External",
multiRegion: true,
});
const _default = new volcengine.kms.KeyMaterial("default", {
keyringName: fooKeyring.keyringName,
keyName: foo2.keyName,
encryptedKeyMaterial: "***",
importToken: "***",
expirationModel: "KEY_MATERIAL_EXPIRES",
validTo: 1770999621,
});
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",
)])
foo1 = volcengine.kms.Key("foo1",
keyring_name=foo_keyring.keyring_name,
key_name="Tf-test-key-1",
rotate_state="Enable",
rotate_interval=90,
key_spec="SYMMETRIC_128",
description="Tf test key with SYMMETRIC_128",
key_usage="ENCRYPT_DECRYPT",
protection_level="SOFTWARE",
origin="CloudKMS",
multi_region=False,
pending_window_in_days=30,
tags=[
volcengine.kms.KeyTagArgs(
key="tfk1",
value="tfv1",
),
volcengine.kms.KeyTagArgs(
key="tfk2",
value="tfv2",
),
])
foo2 = volcengine.kms.Key("foo2",
keyring_name=foo_keyring.keyring_name,
key_name="mrk-Tf-test-key-2",
key_usage="ENCRYPT_DECRYPT",
origin="External",
multi_region=True)
default = volcengine.kms.KeyMaterial("default",
keyring_name=foo_keyring.keyring_name,
key_name=foo2.key_name,
encrypted_key_material="***",
import_token="***",
expiration_model="KEY_MATERIAL_EXPIRES",
valid_to=1770999621)
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
}
_, 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.NewKey(ctx, "foo1", &kms.KeyArgs{
KeyringName: fooKeyring.KeyringName,
KeyName: pulumi.String("Tf-test-key-1"),
RotateState: pulumi.String("Enable"),
RotateInterval: pulumi.Int(90),
KeySpec: pulumi.String("SYMMETRIC_128"),
Description: pulumi.String("Tf test key with SYMMETRIC_128"),
KeyUsage: pulumi.String("ENCRYPT_DECRYPT"),
ProtectionLevel: pulumi.String("SOFTWARE"),
Origin: pulumi.String("CloudKMS"),
MultiRegion: pulumi.Bool(false),
PendingWindowInDays: pulumi.Int(30),
Tags: kms.KeyTagArray{
&kms.KeyTagArgs{
Key: pulumi.String("tfk1"),
Value: pulumi.String("tfv1"),
},
&kms.KeyTagArgs{
Key: pulumi.String("tfk2"),
Value: pulumi.String("tfv2"),
},
},
})
if err != nil {
return err
}
foo2, err := kms.NewKey(ctx, "foo2", &kms.KeyArgs{
KeyringName: fooKeyring.KeyringName,
KeyName: pulumi.String("mrk-Tf-test-key-2"),
KeyUsage: pulumi.String("ENCRYPT_DECRYPT"),
Origin: pulumi.String("External"),
MultiRegion: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = kms.NewKeyMaterial(ctx, "default", &kms.KeyMaterialArgs{
KeyringName: fooKeyring.KeyringName,
KeyName: foo2.KeyName,
EncryptedKeyMaterial: pulumi.String("***"),
ImportToken: pulumi.String("***"),
ExpirationModel: pulumi.String("KEY_MATERIAL_EXPIRES"),
ValidTo: pulumi.Int(1770999621),
})
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 foo1 = new Volcengine.Kms.Key("foo1", new()
{
KeyringName = fooKeyring.KeyringName,
KeyName = "Tf-test-key-1",
RotateState = "Enable",
RotateInterval = 90,
KeySpec = "SYMMETRIC_128",
Description = "Tf test key with SYMMETRIC_128",
KeyUsage = "ENCRYPT_DECRYPT",
ProtectionLevel = "SOFTWARE",
Origin = "CloudKMS",
MultiRegion = false,
PendingWindowInDays = 30,
Tags = new[]
{
new Volcengine.Kms.Inputs.KeyTagArgs
{
Key = "tfk1",
Value = "tfv1",
},
new Volcengine.Kms.Inputs.KeyTagArgs
{
Key = "tfk2",
Value = "tfv2",
},
},
});
var foo2 = new Volcengine.Kms.Key("foo2", new()
{
KeyringName = fooKeyring.KeyringName,
KeyName = "mrk-Tf-test-key-2",
KeyUsage = "ENCRYPT_DECRYPT",
Origin = "External",
MultiRegion = true,
});
var @default = new Volcengine.Kms.KeyMaterial("default", new()
{
KeyringName = fooKeyring.KeyringName,
KeyName = foo2.KeyName,
EncryptedKeyMaterial = "***",
ImportToken = "***",
ExpirationModel = "KEY_MATERIAL_EXPIRES",
ValidTo = 1770999621,
});
});
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.KeyMaterial;
import com.pulumi.volcengine.kms.KeyMaterialArgs;
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 foo1 = new Key("foo1", KeyArgs.builder()
.keyringName(fooKeyring.keyringName())
.keyName("Tf-test-key-1")
.rotateState("Enable")
.rotateInterval(90)
.keySpec("SYMMETRIC_128")
.description("Tf test key with SYMMETRIC_128")
.keyUsage("ENCRYPT_DECRYPT")
.protectionLevel("SOFTWARE")
.origin("CloudKMS")
.multiRegion(false)
.pendingWindowInDays(30)
.tags(
KeyTagArgs.builder()
.key("tfk1")
.value("tfv1")
.build(),
KeyTagArgs.builder()
.key("tfk2")
.value("tfv2")
.build())
.build());
var foo2 = new Key("foo2", KeyArgs.builder()
.keyringName(fooKeyring.keyringName())
.keyName("mrk-Tf-test-key-2")
.keyUsage("ENCRYPT_DECRYPT")
.origin("External")
.multiRegion(true)
.build());
var default_ = new KeyMaterial("default", KeyMaterialArgs.builder()
.keyringName(fooKeyring.keyringName())
.keyName(foo2.keyName())
.encryptedKeyMaterial("***")
.importToken("***")
.expirationModel("KEY_MATERIAL_EXPIRES")
.validTo(1770999621)
.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
foo1:
type: volcengine:kms:Key
properties:
keyringName: ${fooKeyring.keyringName}
keyName: Tf-test-key-1
rotateState: Enable
rotateInterval: 90
keySpec: SYMMETRIC_128
description: Tf test key with SYMMETRIC_128
keyUsage: ENCRYPT_DECRYPT
protectionLevel: SOFTWARE
origin: CloudKMS
multiRegion: false
#The scheduled deletion time when deleting the key
pendingWindowInDays: 30
tags:
- key: tfk1
value: tfv1
- key: tfk2
value: tfv2
foo2:
type: volcengine:kms:Key
properties:
keyringName: ${fooKeyring.keyringName}
keyName: mrk-Tf-test-key-2
keyUsage: ENCRYPT_DECRYPT
origin: External
multiRegion: true
default:
type: volcengine:kms:KeyMaterial
properties:
keyringName: ${fooKeyring.keyringName}
keyName: ${foo2.keyName}
encryptedKeyMaterial: '***'
importToken: '***'
expirationModel: KEY_MATERIAL_EXPIRES
validTo: 1.770999621e+09
Create Key Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Key(name: string, args: KeyArgs, opts?: CustomResourceOptions);@overload
def Key(resource_name: str,
args: KeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Key(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_name: Optional[str] = None,
keyring_name: Optional[str] = None,
multi_region: Optional[bool] = None,
key_spec: Optional[str] = None,
key_usage: Optional[str] = None,
description: Optional[str] = None,
custom_key_store_id: Optional[str] = None,
origin: Optional[str] = None,
pending_window_in_days: Optional[int] = None,
protection_level: Optional[str] = None,
rotate_interval: Optional[int] = None,
rotate_state: Optional[str] = None,
tags: Optional[Sequence[KeyTagArgs]] = None,
xks_key_id: Optional[str] = None)func NewKey(ctx *Context, name string, args KeyArgs, opts ...ResourceOption) (*Key, error)public Key(string name, KeyArgs args, CustomResourceOptions? opts = null)type: volcengine:kms:Key
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 KeyArgs
- 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 KeyArgs
- 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 KeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KeyArgs
- 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 keyResource = new Volcengine.Kms.Key("keyResource", new()
{
KeyName = "string",
KeyringName = "string",
MultiRegion = false,
KeySpec = "string",
KeyUsage = "string",
Description = "string",
CustomKeyStoreId = "string",
Origin = "string",
PendingWindowInDays = 0,
ProtectionLevel = "string",
RotateInterval = 0,
RotateState = "string",
Tags = new[]
{
new Volcengine.Kms.Inputs.KeyTagArgs
{
Key = "string",
Value = "string",
},
},
XksKeyId = "string",
});
example, err := kms.NewKey(ctx, "keyResource", &kms.KeyArgs{
KeyName: pulumi.String("string"),
KeyringName: pulumi.String("string"),
MultiRegion: pulumi.Bool(false),
KeySpec: pulumi.String("string"),
KeyUsage: pulumi.String("string"),
Description: pulumi.String("string"),
CustomKeyStoreId: pulumi.String("string"),
Origin: pulumi.String("string"),
PendingWindowInDays: pulumi.Int(0),
ProtectionLevel: pulumi.String("string"),
RotateInterval: pulumi.Int(0),
RotateState: pulumi.String("string"),
Tags: kms.KeyTagArray{
&kms.KeyTagArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
XksKeyId: pulumi.String("string"),
})
var keyResource = new Key("keyResource", KeyArgs.builder()
.keyName("string")
.keyringName("string")
.multiRegion(false)
.keySpec("string")
.keyUsage("string")
.description("string")
.customKeyStoreId("string")
.origin("string")
.pendingWindowInDays(0)
.protectionLevel("string")
.rotateInterval(0)
.rotateState("string")
.tags(KeyTagArgs.builder()
.key("string")
.value("string")
.build())
.xksKeyId("string")
.build());
key_resource = volcengine.kms.Key("keyResource",
key_name="string",
keyring_name="string",
multi_region=False,
key_spec="string",
key_usage="string",
description="string",
custom_key_store_id="string",
origin="string",
pending_window_in_days=0,
protection_level="string",
rotate_interval=0,
rotate_state="string",
tags=[{
"key": "string",
"value": "string",
}],
xks_key_id="string")
const keyResource = new volcengine.kms.Key("keyResource", {
keyName: "string",
keyringName: "string",
multiRegion: false,
keySpec: "string",
keyUsage: "string",
description: "string",
customKeyStoreId: "string",
origin: "string",
pendingWindowInDays: 0,
protectionLevel: "string",
rotateInterval: 0,
rotateState: "string",
tags: [{
key: "string",
value: "string",
}],
xksKeyId: "string",
});
type: volcengine:kms:Key
properties:
customKeyStoreId: string
description: string
keyName: string
keySpec: string
keyUsage: string
keyringName: string
multiRegion: false
origin: string
pendingWindowInDays: 0
protectionLevel: string
rotateInterval: 0
rotateState: string
tags:
- key: string
value: string
xksKeyId: string
Key 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 Key resource accepts the following input properties:
- Key
Name string - The name of the key.
- Keyring
Name string - The name of the keyring.
- Custom
Key stringStore Id - The ID of the custom key store.
- Description string
- The description of the key.
- Key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- Key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- Multi
Region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- Origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- Pending
Window intIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- Protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- Rotate
Interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- Rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
-
List<Key
Tag> - Tags.
- Xks
Key stringId - The ID of the external key store.
- Key
Name string - The name of the key.
- Keyring
Name string - The name of the keyring.
- Custom
Key stringStore Id - The ID of the custom key store.
- Description string
- The description of the key.
- Key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- Key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- Multi
Region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- Origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- Pending
Window intIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- Protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- Rotate
Interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- Rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
-
[]Key
Tag Args - Tags.
- Xks
Key stringId - The ID of the external key store.
- key
Name String - The name of the key.
- keyring
Name String - The name of the keyring.
- custom
Key StringStore Id - The ID of the custom key store.
- description String
- The description of the key.
- key
Spec String - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage String - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- multi
Region Boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- origin String
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window IntegerIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level String - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval Integer - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State String - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
-
List<Key
Tag> - Tags.
- xks
Key StringId - The ID of the external key store.
- key
Name string - The name of the key.
- keyring
Name string - The name of the keyring.
- custom
Key stringStore Id - The ID of the custom key store.
- description string
- The description of the key.
- key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- multi
Region boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window numberIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval number - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
-
Key
Tag[] - Tags.
- xks
Key stringId - The ID of the external key store.
- key_
name str - The name of the key.
- keyring_
name str - The name of the keyring.
- custom_
key_ strstore_ id - The ID of the custom key store.
- description str
- The description of the key.
- key_
spec str - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key_
usage str - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- multi_
region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- origin str
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending_
window_ intin_ days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection_
level str - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate_
interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate_
state str - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
-
Sequence[Key
Tag Args] - Tags.
- xks_
key_ strid - The ID of the external key store.
- key
Name String - The name of the key.
- keyring
Name String - The name of the keyring.
- custom
Key StringStore Id - The ID of the custom key store.
- description String
- The description of the key.
- key
Spec String - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage String - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- multi
Region Boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- origin String
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window NumberIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level String - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval Number - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State String - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- List<Property Map>
- Tags.
- xks
Key StringId - The ID of the external key store.
Outputs
All input properties are implicitly available as output properties. Additionally, the Key resource produces the following output properties:
- Creation
Date int - The date when the keyring was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Material stringExpire Time - The time when the key material will expire.
- Last
Rotation stringTime - The last time the key was rotated.
- Multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- Rotation
State string - The rotation configuration of the key.
- Schedule
Delete stringTime - The time when the key will be deleted.
- Schedule
Rotation stringTime - The next time the key will be rotated.
- State string
- The state of the key.
- Trn string
- The name of the resource.
- Update
Date int - The date when the keyring was updated.
- Creation
Date int - The date when the keyring was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key
Material stringExpire Time - The time when the key material will expire.
- Last
Rotation stringTime - The last time the key was rotated.
- Multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- Rotation
State string - The rotation configuration of the key.
- Schedule
Delete stringTime - The time when the key will be deleted.
- Schedule
Rotation stringTime - The next time the key will be rotated.
- State string
- The state of the key.
- Trn string
- The name of the resource.
- Update
Date int - The date when the keyring was updated.
- creation
Date Integer - The date when the keyring was created.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Material StringExpire Time - The time when the key material will expire.
- last
Rotation StringTime - The last time the key was rotated.
- multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- rotation
State String - The rotation configuration of the key.
- schedule
Delete StringTime - The time when the key will be deleted.
- schedule
Rotation StringTime - The next time the key will be rotated.
- state String
- The state of the key.
- trn String
- The name of the resource.
- update
Date Integer - The date when the keyring was updated.
- creation
Date number - The date when the keyring was created.
- id string
- The provider-assigned unique ID for this managed resource.
- key
Material stringExpire Time - The time when the key material will expire.
- last
Rotation stringTime - The last time the key was rotated.
- multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- rotation
State string - The rotation configuration of the key.
- schedule
Delete stringTime - The time when the key will be deleted.
- schedule
Rotation stringTime - The next time the key will be rotated.
- state string
- The state of the key.
- trn string
- The name of the resource.
- update
Date number - The date when the keyring was updated.
- creation_
date int - The date when the keyring was created.
- id str
- The provider-assigned unique ID for this managed resource.
- key_
material_ strexpire_ time - The time when the key material will expire.
- last_
rotation_ strtime - The last time the key was rotated.
- multi_
region_ Keyconfiguration Multi Region Configuration - The configuration of Multi-region key.
- rotation_
state str - The rotation configuration of the key.
- schedule_
delete_ strtime - The time when the key will be deleted.
- schedule_
rotation_ strtime - The next time the key will be rotated.
- state str
- The state of the key.
- trn str
- The name of the resource.
- update_
date int - The date when the keyring was updated.
- creation
Date Number - The date when the keyring was created.
- id String
- The provider-assigned unique ID for this managed resource.
- key
Material StringExpire Time - The time when the key material will expire.
- last
Rotation StringTime - The last time the key was rotated.
- multi
Region Property MapConfiguration - The configuration of Multi-region key.
- rotation
State String - The rotation configuration of the key.
- schedule
Delete StringTime - The time when the key will be deleted.
- schedule
Rotation StringTime - The next time the key will be rotated.
- state String
- The state of the key.
- trn String
- The name of the resource.
- update
Date Number - The date when the keyring was updated.
Look up Existing Key Resource
Get an existing Key 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?: KeyState, opts?: CustomResourceOptions): Key@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
creation_date: Optional[int] = None,
custom_key_store_id: Optional[str] = None,
description: Optional[str] = None,
key_material_expire_time: Optional[str] = None,
key_name: Optional[str] = None,
key_spec: Optional[str] = None,
key_usage: Optional[str] = None,
keyring_name: Optional[str] = None,
last_rotation_time: Optional[str] = None,
multi_region: Optional[bool] = None,
multi_region_configuration: Optional[KeyMultiRegionConfigurationArgs] = None,
origin: Optional[str] = None,
pending_window_in_days: Optional[int] = None,
protection_level: Optional[str] = None,
rotate_interval: Optional[int] = None,
rotate_state: Optional[str] = None,
rotation_state: Optional[str] = None,
schedule_delete_time: Optional[str] = None,
schedule_rotation_time: Optional[str] = None,
state: Optional[str] = None,
tags: Optional[Sequence[KeyTagArgs]] = None,
trn: Optional[str] = None,
update_date: Optional[int] = None,
xks_key_id: Optional[str] = None) -> Keyfunc GetKey(ctx *Context, name string, id IDInput, state *KeyState, opts ...ResourceOption) (*Key, error)public static Key Get(string name, Input<string> id, KeyState? state, CustomResourceOptions? opts = null)public static Key get(String name, Output<String> id, KeyState state, CustomResourceOptions options)resources: _: type: volcengine:kms:Key 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.
- Creation
Date int - The date when the keyring was created.
- Custom
Key stringStore Id - The ID of the custom key store.
- Description string
- The description of the key.
- Key
Material stringExpire Time - The time when the key material will expire.
- Key
Name string - The name of the key.
- Key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- Key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- Keyring
Name string - The name of the keyring.
- Last
Rotation stringTime - The last time the key was rotated.
- Multi
Region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- Multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- Origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- Pending
Window intIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- Protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- Rotate
Interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- Rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- Rotation
State string - The rotation configuration of the key.
- Schedule
Delete stringTime - The time when the key will be deleted.
- Schedule
Rotation stringTime - The next time the key will be rotated.
- State string
- The state of the key.
-
List<Key
Tag> - Tags.
- Trn string
- The name of the resource.
- Update
Date int - The date when the keyring was updated.
- Xks
Key stringId - The ID of the external key store.
- Creation
Date int - The date when the keyring was created.
- Custom
Key stringStore Id - The ID of the custom key store.
- Description string
- The description of the key.
- Key
Material stringExpire Time - The time when the key material will expire.
- Key
Name string - The name of the key.
- Key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- Key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- Keyring
Name string - The name of the keyring.
- Last
Rotation stringTime - The last time the key was rotated.
- Multi
Region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- Multi
Region KeyConfiguration Multi Region Configuration Args - The configuration of Multi-region key.
- Origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- Pending
Window intIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- Protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- Rotate
Interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- Rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- Rotation
State string - The rotation configuration of the key.
- Schedule
Delete stringTime - The time when the key will be deleted.
- Schedule
Rotation stringTime - The next time the key will be rotated.
- State string
- The state of the key.
-
[]Key
Tag Args - Tags.
- Trn string
- The name of the resource.
- Update
Date int - The date when the keyring was updated.
- Xks
Key stringId - The ID of the external key store.
- creation
Date Integer - The date when the keyring was created.
- custom
Key StringStore Id - The ID of the custom key store.
- description String
- The description of the key.
- key
Material StringExpire Time - The time when the key material will expire.
- key
Name String - The name of the key.
- key
Spec String - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage String - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- keyring
Name String - The name of the keyring.
- last
Rotation StringTime - The last time the key was rotated.
- multi
Region Boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- origin String
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window IntegerIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level String - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval Integer - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State String - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- rotation
State String - The rotation configuration of the key.
- schedule
Delete StringTime - The time when the key will be deleted.
- schedule
Rotation StringTime - The next time the key will be rotated.
- state String
- The state of the key.
-
List<Key
Tag> - Tags.
- trn String
- The name of the resource.
- update
Date Integer - The date when the keyring was updated.
- xks
Key StringId - The ID of the external key store.
- creation
Date number - The date when the keyring was created.
- custom
Key stringStore Id - The ID of the custom key store.
- description string
- The description of the key.
- key
Material stringExpire Time - The time when the key material will expire.
- key
Name string - The name of the key.
- key
Spec string - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage string - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- keyring
Name string - The name of the keyring.
- last
Rotation stringTime - The last time the key was rotated.
- multi
Region boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- multi
Region KeyConfiguration Multi Region Configuration - The configuration of Multi-region key.
- origin string
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window numberIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level string - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval number - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State string - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- rotation
State string - The rotation configuration of the key.
- schedule
Delete stringTime - The time when the key will be deleted.
- schedule
Rotation stringTime - The next time the key will be rotated.
- state string
- The state of the key.
-
Key
Tag[] - Tags.
- trn string
- The name of the resource.
- update
Date number - The date when the keyring was updated.
- xks
Key stringId - The ID of the external key store.
- creation_
date int - The date when the keyring was created.
- custom_
key_ strstore_ id - The ID of the custom key store.
- description str
- The description of the key.
- key_
material_ strexpire_ time - The time when the key material will expire.
- key_
name str - The name of the key.
- key_
spec str - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key_
usage str - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- keyring_
name str - The name of the keyring.
- last_
rotation_ strtime - The last time the key was rotated.
- multi_
region bool - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- multi_
region_ Keyconfiguration Multi Region Configuration Args - The configuration of Multi-region key.
- origin str
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending_
window_ intin_ days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection_
level str - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate_
interval int - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate_
state str - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- rotation_
state str - The rotation configuration of the key.
- schedule_
delete_ strtime - The time when the key will be deleted.
- schedule_
rotation_ strtime - The next time the key will be rotated.
- state str
- The state of the key.
-
Sequence[Key
Tag Args] - Tags.
- trn str
- The name of the resource.
- update_
date int - The date when the keyring was updated.
- xks_
key_ strid - The ID of the external key store.
- creation
Date Number - The date when the keyring was created.
- custom
Key StringStore Id - The ID of the custom key store.
- description String
- The description of the key.
- key
Material StringExpire Time - The time when the key material will expire.
- key
Name String - The name of the key.
- key
Spec String - The type of the key. Valid values: SYMMETRIC_256, SYMMETRIC_128, RSA_2048, RSA_3072, RSA_4096, EC_P256K, EC_P256, EC_P384, EC_P521, EC_SM2. Default value: SYMMETRIC_256.
- key
Usage String - The usage of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, GENERATE_VERIFY_MAC. Default value: ENCRYPT_DECRYPT.
- keyring
Name String - The name of the keyring.
- last
Rotation StringTime - The last time the key was rotated.
- multi
Region Boolean - Whether it is the master key of the Multi-region type. When multi_region is true, the key name must start with "mrk-".
- multi
Region Property MapConfiguration - The configuration of Multi-region key.
- origin String
- The origin of the key. Valid values: CloudKMS, External, ExternalKeyStore. Default value: CloudKMS.
- pending
Window NumberIn Days - The pre-deletion cycle of the key. Valid values: [7, 30]. Default value: 7.
- protection
Level String - The protection level of the key. Valid values: SOFTWARE, HSM. Default value: SOFTWARE.
- rotate
Interval Number - Key rotation period, unit: days; value range: [90, 2560], required when rotate_state is Enable.
- rotate
State String - The rotation state of the key. Valid values: Enable, Disable. Only symmetric keys support rotation.
- rotation
State String - The rotation configuration of the key.
- schedule
Delete StringTime - The time when the key will be deleted.
- schedule
Rotation StringTime - The next time the key will be rotated.
- state String
- The state of the key.
- List<Property Map>
- Tags.
- trn String
- The name of the resource.
- update
Date Number - The date when the keyring was updated.
- xks
Key StringId - The ID of the external key store.
Supporting Types
KeyMultiRegionConfiguration, KeyMultiRegionConfigurationArgs
- Multi
Region stringKey Type - The type of the multi-region key.
- Primary
Key KeyMulti Region Configuration Primary Key - Trn and region id of the primary multi-region key.
- Replica
Keys List<KeyMulti Region Configuration Replica Key> - Trn and region id of replica multi-region keys.
- Multi
Region stringKey Type - The type of the multi-region key.
- Primary
Key KeyMulti Region Configuration Primary Key - Trn and region id of the primary multi-region key.
- Replica
Keys []KeyMulti Region Configuration Replica Key - Trn and region id of replica multi-region keys.
- multi
Region StringKey Type - The type of the multi-region key.
- primary
Key KeyMulti Region Configuration Primary Key - Trn and region id of the primary multi-region key.
- replica
Keys List<KeyMulti Region Configuration Replica Key> - Trn and region id of replica multi-region keys.
- multi
Region stringKey Type - The type of the multi-region key.
- primary
Key KeyMulti Region Configuration Primary Key - Trn and region id of the primary multi-region key.
- replica
Keys KeyMulti Region Configuration Replica Key[] - Trn and region id of replica multi-region keys.
- multi_
region_ strkey_ type - The type of the multi-region key.
- primary_
key KeyMulti Region Configuration Primary Key - Trn and region id of the primary multi-region key.
- replica_
keys Sequence[KeyMulti Region Configuration Replica Key] - Trn and region id of replica multi-region keys.
- multi
Region StringKey Type - The type of the multi-region key.
- primary
Key Property Map - Trn and region id of the primary multi-region key.
- replica
Keys List<Property Map> - Trn and region id of replica multi-region keys.
KeyMultiRegionConfigurationPrimaryKey, KeyMultiRegionConfigurationPrimaryKeyArgs
KeyMultiRegionConfigurationReplicaKey, KeyMultiRegionConfigurationReplicaKeyArgs
KeyTag, KeyTagArgs
Import
KmsKey can be imported using the id, e.g.
$ pulumi import volcengine:kms/key:Key default resource_id
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
volcengineTerraform Provider.
