UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

87 lines 3.91 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.KmsSecretCiphertext = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * 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](https://cloud.yandex.com/docs/kms/concepts/). * * ## Example Usage * * ```typescript * 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", * }); * ``` */ class KmsSecretCiphertext extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aadContext"] = state ? state.aadContext : undefined; resourceInputs["ciphertext"] = state ? state.ciphertext : undefined; resourceInputs["keyId"] = state ? state.keyId : undefined; resourceInputs["plaintext"] = state ? state.plaintext : undefined; } else { const args = argsOrState; if ((!args || args.keyId === undefined) && !opts.urn) { throw new Error("Missing required property 'keyId'"); } if ((!args || args.plaintext === undefined) && !opts.urn) { throw new Error("Missing required property 'plaintext'"); } resourceInputs["aadContext"] = args ? args.aadContext : undefined; resourceInputs["keyId"] = args ? args.keyId : undefined; resourceInputs["plaintext"] = args ? args.plaintext : undefined; resourceInputs["ciphertext"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(KmsSecretCiphertext.__pulumiType, name, resourceInputs, opts); } /** * Get an existing KmsSecretCiphertext resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new KmsSecretCiphertext(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of KmsSecretCiphertext. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === KmsSecretCiphertext.__pulumiType; } } exports.KmsSecretCiphertext = KmsSecretCiphertext; /** @internal */ KmsSecretCiphertext.__pulumiType = 'yandex:index/kmsSecretCiphertext:KmsSecretCiphertext'; //# sourceMappingURL=kmsSecretCiphertext.js.map