Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

KmsSecretCiphertext

Encrypts given plaintext with the specified Yandex KMS key and provides access to the ciphertext.

Note: Using this resource will allow you to conceal secret data within your resource definitions, but it does not take care of protecting that data in the logging output, plan output, or state output. Please take care to secure your secret data outside of resource definitions.

For more information, see the official documentation.

Example Usage

using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Yandex.KmsSymmetricKey("example", new Yandex.KmsSymmetricKeyArgs
        {
            Description = "description for key",
        });
        var password = new Yandex.KmsSecretCiphertext("password", new Yandex.KmsSecretCiphertextArgs
        {
            AadContext = "additional authenticated data",
            KeyId = example.Id,
            Plaintext = "strong password",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := yandex.NewKmsSymmetricKey(ctx, "example", &yandex.KmsSymmetricKeyArgs{
			Description: pulumi.String("description for key"),
		})
		if err != nil {
			return err
		}
		_, err = yandex.NewKmsSecretCiphertext(ctx, "password", &yandex.KmsSecretCiphertextArgs{
			AadContext: pulumi.String("additional authenticated data"),
			KeyId:      example.ID(),
			Plaintext:  pulumi.String("strong password"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_yandex as yandex

example = yandex.KmsSymmetricKey("example", description="description for key")
password = yandex.KmsSecretCiphertext("password",
    aad_context="additional authenticated data",
    key_id=example.id,
    plaintext="strong password")
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";

const example = new yandex.KmsSymmetricKey("example", {
    description: "description for key",
});
const password = new yandex.KmsSecretCiphertext("password", {
    aadContext: "additional authenticated data",
    keyId: example.id,
    plaintext: "strong password",
});

Create a KmsSecretCiphertext Resource

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

KmsSecretCiphertext 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 KmsSecretCiphertext resource accepts the following input properties:

KeyId string
ID of the symmetric KMS key to use for encryption.
Plaintext string
Plaintext to be encrypted.
AadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
KeyId string
ID of the symmetric KMS key to use for encryption.
Plaintext string
Plaintext to be encrypted.
AadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
keyId string
ID of the symmetric KMS key to use for encryption.
plaintext string
Plaintext to be encrypted.
aadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
key_id str
ID of the symmetric KMS key to use for encryption.
plaintext str
Plaintext to be encrypted.
aad_context str
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest

Outputs

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

Ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
Id string
The provider-assigned unique ID for this managed resource.
Ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
Id string
The provider-assigned unique ID for this managed resource.
ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
id string
The provider-assigned unique ID for this managed resource.
ciphertext str
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing KmsSecretCiphertext Resource

Get an existing KmsSecretCiphertext 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?: KmsSecretCiphertextState, opts?: CustomResourceOptions): KmsSecretCiphertext
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aad_context: Optional[str] = None,
        ciphertext: Optional[str] = None,
        key_id: Optional[str] = None,
        plaintext: Optional[str] = None) -> KmsSecretCiphertext
func GetKmsSecretCiphertext(ctx *Context, name string, id IDInput, state *KmsSecretCiphertextState, opts ...ResourceOption) (*KmsSecretCiphertext, error)
public static KmsSecretCiphertext Get(string name, Input<string> id, KmsSecretCiphertextState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
Ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
KeyId string
ID of the symmetric KMS key to use for encryption.
Plaintext string
Plaintext to be encrypted.
AadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
Ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
KeyId string
ID of the symmetric KMS key to use for encryption.
Plaintext string
Plaintext to be encrypted.
aadContext string
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
ciphertext string
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
keyId string
ID of the symmetric KMS key to use for encryption.
plaintext string
Plaintext to be encrypted.
aad_context str
Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest
ciphertext str
Resulting ciphertext, encoded with “standard” base64 alphabet as defined in RFC 4648 section 4
key_id str
ID of the symmetric KMS key to use for encryption.
plaintext str
Plaintext to be encrypted.

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.