yandex.KmsSecretCiphertext
Explore with Pulumi AI
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
})
}
Coming soon!
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",
});
Coming soon!
Create KmsSecretCiphertext Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KmsSecretCiphertext(name: string, args: KmsSecretCiphertextArgs, opts?: CustomResourceOptions);
@overload
def KmsSecretCiphertext(resource_name: str,
args: KmsSecretCiphertextArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KmsSecretCiphertext(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_id: Optional[str] = None,
plaintext: Optional[str] = None,
aad_context: Optional[str] = None)
func NewKmsSecretCiphertext(ctx *Context, name string, args KmsSecretCiphertextArgs, opts ...ResourceOption) (*KmsSecretCiphertext, error)
public KmsSecretCiphertext(string name, KmsSecretCiphertextArgs args, CustomResourceOptions? opts = null)
public KmsSecretCiphertext(String name, KmsSecretCiphertextArgs args)
public KmsSecretCiphertext(String name, KmsSecretCiphertextArgs args, CustomResourceOptions options)
type: yandex:KmsSecretCiphertext
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 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.
- name String
- The unique name of the resource.
- args KmsSecretCiphertextArgs
- 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 kmsSecretCiphertextResource = new Yandex.KmsSecretCiphertext("kmsSecretCiphertextResource", new()
{
KeyId = "string",
Plaintext = "string",
AadContext = "string",
});
example, err := yandex.NewKmsSecretCiphertext(ctx, "kmsSecretCiphertextResource", &yandex.KmsSecretCiphertextArgs{
KeyId: pulumi.String("string"),
Plaintext: pulumi.String("string"),
AadContext: pulumi.String("string"),
})
var kmsSecretCiphertextResource = new KmsSecretCiphertext("kmsSecretCiphertextResource", KmsSecretCiphertextArgs.builder()
.keyId("string")
.plaintext("string")
.aadContext("string")
.build());
kms_secret_ciphertext_resource = yandex.KmsSecretCiphertext("kmsSecretCiphertextResource",
key_id="string",
plaintext="string",
aad_context="string")
const kmsSecretCiphertextResource = new yandex.KmsSecretCiphertext("kmsSecretCiphertextResource", {
keyId: "string",
plaintext: "string",
aadContext: "string",
});
type: yandex:KmsSecretCiphertext
properties:
aadContext: string
keyId: string
plaintext: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The KmsSecretCiphertext resource accepts the following input properties:
- Key
Id string - ID of the symmetric KMS key to use for encryption.
- Plaintext string
- Plaintext to be encrypted.
- Aad
Context string - Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the
SymmetricDecryptRequest
- Key
Id string - ID of the symmetric KMS key to use for encryption.
- Plaintext string
- Plaintext to be encrypted.
- Aad
Context string - Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the
SymmetricDecryptRequest
- key
Id String - ID of the symmetric KMS key to use for encryption.
- plaintext String
- Plaintext to be encrypted.
- aad
Context String - Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the
SymmetricDecryptRequest
- key
Id string - ID of the symmetric KMS key to use for encryption.
- plaintext string
- Plaintext to be encrypted.
- aad
Context 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
- key
Id String - ID of the symmetric KMS key to use for encryption.
- plaintext String
- Plaintext to be encrypted.
- aad
Context String - 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 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.
- 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.
Look up 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)
public static KmsSecretCiphertext get(String name, Output<String> id, KmsSecretCiphertextState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Aad
Context 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
- Key
Id string - ID of the symmetric KMS key to use for encryption.
- Plaintext string
- Plaintext to be encrypted.
- Aad
Context 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
- Key
Id string - ID of the symmetric KMS key to use for encryption.
- Plaintext string
- Plaintext to be encrypted.
- aad
Context 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
- key
Id String - ID of the symmetric KMS key to use for encryption.
- plaintext String
- Plaintext to be encrypted.
- aad
Context 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
- key
Id 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.
- aad
Context 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
- key
Id String - ID of the symmetric KMS key to use for encryption.
- plaintext String
- Plaintext to be encrypted.
Package Details
- Repository
- Yandex pulumi/pulumi-yandex
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
yandex
Terraform Provider.