Provides a resource to manage kms re encrypt
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const encryptStable = new volcengine.kms.Ciphertext("encryptStable", {
keyId: "c44870c3-f33b-421a-****-a2bba37c993e",
plaintext: "VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg==",
});
const reEncryptStable = new volcengine.kms.ReEncrypt("reEncryptStable", {
newKeyId: "33e6ae1f-62f6-415a-****-579f526274cc",
sourceCiphertextBlob: encryptStable.ciphertextBlob,
});
import pulumi
import pulumi_volcengine as volcengine
encrypt_stable = volcengine.kms.Ciphertext("encryptStable",
key_id="c44870c3-f33b-421a-****-a2bba37c993e",
plaintext="VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg==")
re_encrypt_stable = volcengine.kms.ReEncrypt("reEncryptStable",
new_key_id="33e6ae1f-62f6-415a-****-579f526274cc",
source_ciphertext_blob=encrypt_stable.ciphertext_blob)
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 {
encryptStable, err := kms.NewCiphertext(ctx, "encryptStable", &kms.CiphertextArgs{
KeyId: pulumi.String("c44870c3-f33b-421a-****-a2bba37c993e"),
Plaintext: pulumi.String("VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg=="),
})
if err != nil {
return err
}
_, err = kms.NewReEncrypt(ctx, "reEncryptStable", &kms.ReEncryptArgs{
NewKeyId: pulumi.String("33e6ae1f-62f6-415a-****-579f526274cc"),
SourceCiphertextBlob: encryptStable.CiphertextBlob,
})
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 encryptStable = new Volcengine.Kms.Ciphertext("encryptStable", new()
{
KeyId = "c44870c3-f33b-421a-****-a2bba37c993e",
Plaintext = "VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg==",
});
var reEncryptStable = new Volcengine.Kms.ReEncrypt("reEncryptStable", new()
{
NewKeyId = "33e6ae1f-62f6-415a-****-579f526274cc",
SourceCiphertextBlob = encryptStable.CiphertextBlob,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.kms.Ciphertext;
import com.pulumi.volcengine.kms.CiphertextArgs;
import com.pulumi.volcengine.kms.ReEncrypt;
import com.pulumi.volcengine.kms.ReEncryptArgs;
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 encryptStable = new Ciphertext("encryptStable", CiphertextArgs.builder()
.keyId("c44870c3-f33b-421a-****-a2bba37c993e")
.plaintext("VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg==")
.build());
var reEncryptStable = new ReEncrypt("reEncryptStable", ReEncryptArgs.builder()
.newKeyId("33e6ae1f-62f6-415a-****-579f526274cc")
.sourceCiphertextBlob(encryptStable.ciphertextBlob())
.build());
}
}
resources:
encryptStable:
type: volcengine:kms:Ciphertext
properties:
keyId: c44870c3-f33b-421a-****-a2bba37c993e
plaintext: VGhpcyBpcyBhIHBsYWludGV4dCBleGFtcGxlLg==
reEncryptStable:
type: volcengine:kms:ReEncrypt
properties:
newKeyId: 33e6ae1f-62f6-415a-****-579f526274cc
sourceCiphertextBlob: ${encryptStable.ciphertextBlob}
Create ReEncrypt Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ReEncrypt(name: string, args: ReEncryptArgs, opts?: CustomResourceOptions);@overload
def ReEncrypt(resource_name: str,
args: ReEncryptArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ReEncrypt(resource_name: str,
opts: Optional[ResourceOptions] = None,
source_ciphertext_blob: Optional[str] = None,
new_encryption_context: Optional[str] = None,
new_key_id: Optional[str] = None,
new_key_name: Optional[str] = None,
new_keyring_name: Optional[str] = None,
old_encryption_context: Optional[str] = None)func NewReEncrypt(ctx *Context, name string, args ReEncryptArgs, opts ...ResourceOption) (*ReEncrypt, error)public ReEncrypt(string name, ReEncryptArgs args, CustomResourceOptions? opts = null)
public ReEncrypt(String name, ReEncryptArgs args)
public ReEncrypt(String name, ReEncryptArgs args, CustomResourceOptions options)
type: volcengine:kms:ReEncrypt
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 ReEncryptArgs
- 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 ReEncryptArgs
- 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 ReEncryptArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ReEncryptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ReEncryptArgs
- 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 reEncryptResource = new Volcengine.Kms.ReEncrypt("reEncryptResource", new()
{
SourceCiphertextBlob = "string",
NewEncryptionContext = "string",
NewKeyId = "string",
NewKeyName = "string",
NewKeyringName = "string",
OldEncryptionContext = "string",
});
example, err := kms.NewReEncrypt(ctx, "reEncryptResource", &kms.ReEncryptArgs{
SourceCiphertextBlob: pulumi.String("string"),
NewEncryptionContext: pulumi.String("string"),
NewKeyId: pulumi.String("string"),
NewKeyName: pulumi.String("string"),
NewKeyringName: pulumi.String("string"),
OldEncryptionContext: pulumi.String("string"),
})
var reEncryptResource = new ReEncrypt("reEncryptResource", ReEncryptArgs.builder()
.sourceCiphertextBlob("string")
.newEncryptionContext("string")
.newKeyId("string")
.newKeyName("string")
.newKeyringName("string")
.oldEncryptionContext("string")
.build());
re_encrypt_resource = volcengine.kms.ReEncrypt("reEncryptResource",
source_ciphertext_blob="string",
new_encryption_context="string",
new_key_id="string",
new_key_name="string",
new_keyring_name="string",
old_encryption_context="string")
const reEncryptResource = new volcengine.kms.ReEncrypt("reEncryptResource", {
sourceCiphertextBlob: "string",
newEncryptionContext: "string",
newKeyId: "string",
newKeyName: "string",
newKeyringName: "string",
oldEncryptionContext: "string",
});
type: volcengine:kms:ReEncrypt
properties:
newEncryptionContext: string
newKeyId: string
newKeyName: string
newKeyringName: string
oldEncryptionContext: string
sourceCiphertextBlob: string
ReEncrypt 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 ReEncrypt resource accepts the following input properties:
- Source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- New
Encryption stringContext - The new encryption context JSON string.
- New
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- New
Key stringName - The new key name.
- New
Keyring stringName - The new keyring name.
- Old
Encryption stringContext - The old encryption context JSON string.
- Source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- New
Encryption stringContext - The new encryption context JSON string.
- New
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- New
Key stringName - The new key name.
- New
Keyring stringName - The new keyring name.
- Old
Encryption stringContext - The old encryption context JSON string.
- source
Ciphertext StringBlob - The source ciphertext, Base64 encoded.
- new
Encryption StringContext - The new encryption context JSON string.
- new
Key StringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key StringName - The new key name.
- new
Keyring StringName - The new keyring name.
- old
Encryption StringContext - The old encryption context JSON string.
- source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- new
Encryption stringContext - The new encryption context JSON string.
- new
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key stringName - The new key name.
- new
Keyring stringName - The new keyring name.
- old
Encryption stringContext - The old encryption context JSON string.
- source_
ciphertext_ strblob - The source ciphertext, Base64 encoded.
- new_
encryption_ strcontext - The new encryption context JSON string.
- new_
key_ strid - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new_
key_ strname - The new key name.
- new_
keyring_ strname - The new keyring name.
- old_
encryption_ strcontext - The old encryption context JSON string.
- source
Ciphertext StringBlob - The source ciphertext, Base64 encoded.
- new
Encryption StringContext - The new encryption context JSON string.
- new
Key StringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key StringName - The new key name.
- new
Keyring StringName - The new keyring name.
- old
Encryption StringContext - The old encryption context JSON string.
Outputs
All input properties are implicitly available as output properties. Additionally, the ReEncrypt resource produces the following output properties:
- Ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - Id string
- The provider-assigned unique ID for this managed resource.
- Ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - Id string
- The provider-assigned unique ID for this managed resource.
- ciphertext
Blob String - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - id String
- The provider-assigned unique ID for this managed resource.
- ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - id string
- The provider-assigned unique ID for this managed resource.
- ciphertext_
blob str - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - id str
- The provider-assigned unique ID for this managed resource.
- ciphertext
Blob String - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ReEncrypt Resource
Get an existing ReEncrypt 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?: ReEncryptState, opts?: CustomResourceOptions): ReEncrypt@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ciphertext_blob: Optional[str] = None,
new_encryption_context: Optional[str] = None,
new_key_id: Optional[str] = None,
new_key_name: Optional[str] = None,
new_keyring_name: Optional[str] = None,
old_encryption_context: Optional[str] = None,
source_ciphertext_blob: Optional[str] = None) -> ReEncryptfunc GetReEncrypt(ctx *Context, name string, id IDInput, state *ReEncryptState, opts ...ResourceOption) (*ReEncrypt, error)public static ReEncrypt Get(string name, Input<string> id, ReEncryptState? state, CustomResourceOptions? opts = null)public static ReEncrypt get(String name, Output<String> id, ReEncryptState state, CustomResourceOptions options)resources: _: type: volcengine:kms:ReEncrypt 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.
- Ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - New
Encryption stringContext - The new encryption context JSON string.
- New
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- New
Key stringName - The new key name.
- New
Keyring stringName - The new keyring name.
- Old
Encryption stringContext - The old encryption context JSON string.
- Source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- Ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - New
Encryption stringContext - The new encryption context JSON string.
- New
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- New
Key stringName - The new key name.
- New
Keyring stringName - The new keyring name.
- Old
Encryption stringContext - The old encryption context JSON string.
- Source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- ciphertext
Blob String - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - new
Encryption StringContext - The new encryption context JSON string.
- new
Key StringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key StringName - The new key name.
- new
Keyring StringName - The new keyring name.
- old
Encryption StringContext - The old encryption context JSON string.
- source
Ciphertext StringBlob - The source ciphertext, Base64 encoded.
- ciphertext
Blob string - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - new
Encryption stringContext - The new encryption context JSON string.
- new
Key stringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key stringName - The new key name.
- new
Keyring stringName - The new keyring name.
- old
Encryption stringContext - The old encryption context JSON string.
- source
Ciphertext stringBlob - The source ciphertext, Base64 encoded.
- ciphertext_
blob str - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - new_
encryption_ strcontext - The new encryption context JSON string.
- new_
key_ strid - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new_
key_ strname - The new key name.
- new_
keyring_ strname - The new keyring name.
- old_
encryption_ strcontext - The old encryption context JSON string.
- source_
ciphertext_ strblob - The source ciphertext, Base64 encoded.
- ciphertext
Blob String - The re-encrypted ciphertext, Base64 encoded. The data stays stable across applies. If a changing ciphertext is needed use the
volcengine.kms.getReEncryptsdata source. - new
Encryption StringContext - The new encryption context JSON string.
- new
Key StringId - The new key id. When new_key_id is not specified, both new_keyring_name and new_key_name must be specified.
- new
Key StringName - The new key name.
- new
Keyring StringName - The new keyring name.
- old
Encryption StringContext - The old encryption context JSON string.
- source
Ciphertext StringBlob - The source ciphertext, Base64 encoded.
Import
The KmsReEncrypt is not support import.
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.
