opentelekomcloud.KmsKeyMaterialV1
Explore with Pulumi AI
Up-to-date reference of API arguments for KMS Key Material you can get at documentation portal
Manages a KMS key material resource within OpenTelekomCloud.
NOTE: Please confirm that the state of the imported key is pending import.
Example Usage
Basic usage
variable “key_id” {} variable “import_token” {} variable “encrypted_key_material” {}
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const test = new opentelekomcloud.KmsKeyMaterialV1("test", {
keyId: _var.key_id,
importToken: _var.import_token,
encryptedKeyMaterial: _var.encrypted_key_material,
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
test = opentelekomcloud.KmsKeyMaterialV1("test",
key_id=var["key_id"],
import_token=var["import_token"],
encrypted_key_material=var["encrypted_key_material"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewKmsKeyMaterialV1(ctx, "test", &opentelekomcloud.KmsKeyMaterialV1Args{
KeyId: pulumi.Any(_var.Key_id),
ImportToken: pulumi.Any(_var.Import_token),
EncryptedKeyMaterial: pulumi.Any(_var.Encrypted_key_material),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var test = new Opentelekomcloud.KmsKeyMaterialV1("test", new()
{
KeyId = @var.Key_id,
ImportToken = @var.Import_token,
EncryptedKeyMaterial = @var.Encrypted_key_material,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.KmsKeyMaterialV1;
import com.pulumi.opentelekomcloud.KmsKeyMaterialV1Args;
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 test = new KmsKeyMaterialV1("test", KmsKeyMaterialV1Args.builder()
.keyId(var_.key_id())
.importToken(var_.import_token())
.encryptedKeyMaterial(var_.encrypted_key_material())
.build());
}
}
resources:
test:
type: opentelekomcloud:KmsKeyMaterialV1
properties:
keyId: ${var.key_id}
importToken: ${var.import_token}
encryptedKeyMaterial: ${var.encrypted_key_material}
Create KmsKeyMaterialV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KmsKeyMaterialV1(name: string, args: KmsKeyMaterialV1Args, opts?: CustomResourceOptions);
@overload
def KmsKeyMaterialV1(resource_name: str,
args: KmsKeyMaterialV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def KmsKeyMaterialV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
encrypted_key_material: Optional[str] = None,
import_token: Optional[str] = None,
key_id: Optional[str] = None,
expiration_time: Optional[str] = None,
kms_key_material_v1_id: Optional[str] = None)
func NewKmsKeyMaterialV1(ctx *Context, name string, args KmsKeyMaterialV1Args, opts ...ResourceOption) (*KmsKeyMaterialV1, error)
public KmsKeyMaterialV1(string name, KmsKeyMaterialV1Args args, CustomResourceOptions? opts = null)
public KmsKeyMaterialV1(String name, KmsKeyMaterialV1Args args)
public KmsKeyMaterialV1(String name, KmsKeyMaterialV1Args args, CustomResourceOptions options)
type: opentelekomcloud:KmsKeyMaterialV1
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 KmsKeyMaterialV1Args
- 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 KmsKeyMaterialV1Args
- 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 KmsKeyMaterialV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KmsKeyMaterialV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KmsKeyMaterialV1Args
- 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 kmsKeyMaterialV1Resource = new Opentelekomcloud.KmsKeyMaterialV1("kmsKeyMaterialV1Resource", new()
{
EncryptedKeyMaterial = "string",
ImportToken = "string",
KeyId = "string",
ExpirationTime = "string",
KmsKeyMaterialV1Id = "string",
});
example, err := opentelekomcloud.NewKmsKeyMaterialV1(ctx, "kmsKeyMaterialV1Resource", &opentelekomcloud.KmsKeyMaterialV1Args{
EncryptedKeyMaterial: pulumi.String("string"),
ImportToken: pulumi.String("string"),
KeyId: pulumi.String("string"),
ExpirationTime: pulumi.String("string"),
KmsKeyMaterialV1Id: pulumi.String("string"),
})
var kmsKeyMaterialV1Resource = new KmsKeyMaterialV1("kmsKeyMaterialV1Resource", KmsKeyMaterialV1Args.builder()
.encryptedKeyMaterial("string")
.importToken("string")
.keyId("string")
.expirationTime("string")
.kmsKeyMaterialV1Id("string")
.build());
kms_key_material_v1_resource = opentelekomcloud.KmsKeyMaterialV1("kmsKeyMaterialV1Resource",
encrypted_key_material="string",
import_token="string",
key_id="string",
expiration_time="string",
kms_key_material_v1_id="string")
const kmsKeyMaterialV1Resource = new opentelekomcloud.KmsKeyMaterialV1("kmsKeyMaterialV1Resource", {
encryptedKeyMaterial: "string",
importToken: "string",
keyId: "string",
expirationTime: "string",
kmsKeyMaterialV1Id: "string",
});
type: opentelekomcloud:KmsKeyMaterialV1
properties:
encryptedKeyMaterial: string
expirationTime: string
importToken: string
keyId: string
kmsKeyMaterialV1Id: string
KmsKeyMaterialV1 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 KmsKeyMaterialV1 resource accepts the following input properties:
- Encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - Import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - Key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- Expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- Kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
.
- Encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - Import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - Key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- Expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- Kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
.
- encrypted
Key StringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - import
Token String - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id String - Specifies the ID of the KMS key. Changing this creates a new resource.
- expiration
Time String - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- kms
Key StringMaterial V1Id - The resource ID which equals the
key_id
.
- encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
.
- encrypted_
key_ strmaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - import_
token str - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key_
id str - Specifies the ID of the KMS key. Changing this creates a new resource.
- expiration_
time str - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- kms_
key_ strmaterial_ v1_ id - The resource ID which equals the
key_id
.
- encrypted
Key StringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - import
Token String - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id String - Specifies the ID of the KMS key. Changing this creates a new resource.
- expiration
Time String - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- kms
Key StringMaterial V1Id - The resource ID which equals the
key_id
.
Outputs
All input properties are implicitly available as output properties. Additionally, the KmsKeyMaterialV1 resource produces the following output properties:
Look up Existing KmsKeyMaterialV1 Resource
Get an existing KmsKeyMaterialV1 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?: KmsKeyMaterialV1State, opts?: CustomResourceOptions): KmsKeyMaterialV1
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
encrypted_key_material: Optional[str] = None,
expiration_time: Optional[str] = None,
import_token: Optional[str] = None,
key_id: Optional[str] = None,
key_state: Optional[str] = None,
kms_key_material_v1_id: Optional[str] = None,
region: Optional[str] = None) -> KmsKeyMaterialV1
func GetKmsKeyMaterialV1(ctx *Context, name string, id IDInput, state *KmsKeyMaterialV1State, opts ...ResourceOption) (*KmsKeyMaterialV1, error)
public static KmsKeyMaterialV1 Get(string name, Input<string> id, KmsKeyMaterialV1State? state, CustomResourceOptions? opts = null)
public static KmsKeyMaterialV1 get(String name, Output<String> id, KmsKeyMaterialV1State state, CustomResourceOptions options)
resources: _: type: opentelekomcloud:KmsKeyMaterialV1 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.
- Encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - Expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- Import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - Key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- Key
State string - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- Kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
. - Region string
- The region in which KMS key is created.
- Encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - Expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- Import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - Key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- Key
State string - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- Kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
. - Region string
- The region in which KMS key is created.
- encrypted
Key StringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - expiration
Time String - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- import
Token String - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id String - Specifies the ID of the KMS key. Changing this creates a new resource.
- key
State String - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- kms
Key StringMaterial V1Id - The resource ID which equals the
key_id
. - region String
- The region in which KMS key is created.
- encrypted
Key stringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - expiration
Time string - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- import
Token string - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id string - Specifies the ID of the KMS key. Changing this creates a new resource.
- key
State string - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- kms
Key stringMaterial V1Id - The resource ID which equals the
key_id
. - region string
- The region in which KMS key is created.
- encrypted_
key_ strmaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - expiration_
time str - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- import_
token str - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key_
id str - Specifies the ID of the KMS key. Changing this creates a new resource.
- key_
state str - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- kms_
key_ strmaterial_ v1_ id - The resource ID which equals the
key_id
. - region str
- The region in which KMS key is created.
- encrypted
Key StringMaterial - Specifies the encrypted symmetric key material in Base64 format.
The value contains
344
to360
characters, including letters, digits, slashes(/) and equals(=). If an asymmetric key is imported, this parameter is a temporary intermediate key used to encrypt the private key. This value is obtained refer to documentation. - expiration
Time String - Specifies the expiration time of the key material. This field is only valid for symmetric keys. The time is in the format of timestamp, that is, the offset seconds from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
- import
Token String - Specifies the key import token in Base64 format.
The value contains
200
to6144
characters, including letters, digits, slashes(/) and equals(=). This value is obtained through the interface Obtaining Key Import Parameters or by usingdata_source/kms_key_material_parameters_v1
. - key
Id String - Specifies the ID of the KMS key. Changing this creates a new resource.
- key
State String - The status of the kms key. The valid values are as follows: 1: To be activated 2: Enabled. 3: Disabled. 4: Pending deletion. 5: Pending import.
- kms
Key StringMaterial V1Id - The resource ID which equals the
key_id
. - region String
- The region in which KMS key is created.
Import
The KMS key material can be imported using id
, e.g.
bash
$ pulumi import opentelekomcloud:index/kmsKeyMaterialV1:KmsKeyMaterialV1 test 7056d636-ac60-4663-8a6c-82d3c32c1c64
Note that the imported state may not be identical to your resource definition,
due to import_token
, encrypted_key_material
and encrypted_privatekey
are missing from the API response.
It is generally recommended running pulumi preview
after importing a KMS key material.
You can then decide if changes should be applied to the KMS key material, or the resource
definition should be updated to align with the KMS key material. Also you can ignore changes as below.
hcl
resource “opentelekomcloud_kms_key_material_v1” “test” {
lifecycle {
ignore_changes = [import_token, encrypted_key_material, encrypted_privatekey]
}
}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
- License
- Notes
- This Pulumi package is based on the
opentelekomcloud
Terraform Provider.