UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

67 lines (66 loc) 3.85 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Decrypt multiple secrets from data encrypted with the AWS KMS service. * * ## Example Usage * * If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file. * * > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary. * If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase. * * That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly. */ export declare function getSecrets(args: GetSecretsArgs, opts?: pulumi.InvokeOptions): Promise<GetSecretsResult>; /** * A collection of arguments for invoking getSecrets. */ export interface GetSecretsArgs { region?: string; /** * One or more encrypted payload definitions from the KMS service. See the Secret Definitions below. */ secrets: inputs.kms.GetSecretsSecret[]; } /** * A collection of values returned by getSecrets. */ export interface GetSecretsResult { /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * Map containing each `secret` `name` as the key with its decrypted plaintext value */ readonly plaintext: { [key: string]: string; }; readonly region: string; readonly secrets: outputs.kms.GetSecretsSecret[]; } /** * Decrypt multiple secrets from data encrypted with the AWS KMS service. * * ## Example Usage * * If you do not already have a `CiphertextBlob` from encrypting a KMS secret, you can use the below commands to obtain one using the [AWS CLI kms encrypt](https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html) command. This requires you to have your AWS CLI setup correctly and replace the `--key-id` with your own. Alternatively you can use `--plaintext 'master-password'` (CLIv1) or `--plaintext fileb://<(echo -n 'master-password')` (CLIv2) instead of reading from a file. * * > If you have a newline character at the end of your file, it will be decrypted with this newline character intact. For most use cases this is undesirable and leads to incorrect passwords or invalid values, as well as possible changes in the plan. Be sure to use `echo -n` if necessary. * If you are using asymmetric keys ensure you are using the right encryption algorithm when you encrypt and decrypt else you will get IncorrectKeyException during the decrypt phase. * * That encrypted output can now be inserted into provider configurations without exposing the plaintext secret directly. */ export declare function getSecretsOutput(args: GetSecretsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetSecretsResult>; /** * A collection of arguments for invoking getSecrets. */ export interface GetSecretsOutputArgs { region?: pulumi.Input<string>; /** * One or more encrypted payload definitions from the KMS service. See the Secret Definitions below. */ secrets: pulumi.Input<pulumi.Input<inputs.kms.GetSecretsSecretArgs>[]>; }