import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Retrieve the versions of a Secrets Manager secret. To retrieve secret metadata, see the data sources `aws.secretsmanager.Secret` and `aws.secretsmanager.SecretVersion`. * * ## Example Usage * * ### Retrieve All Versions of a Secret * * By default, this data sources retrieves all versions of a secret. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const secret_versions = aws.secretsmanager.getSecretVersions({ * secretId: example.id, * }); * ``` * * ### Retrieve Specific Secret Version * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const by_version_stage = aws.secretsmanager.getSecretVersion({ * secretId: example.id, * versionStage: "example", * }); * ``` * * ### Handling Key-Value Secret Strings in JSON * * Reading key-value pairs from JSON back into a native Terraform map can be accomplished in Terraform 0.12 and later with the `jsondecode()` function: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * * export const example = std.jsondecode({ * input: exampleAwsSecretsmanagerSecretVersion.secretString, * }).then(invoke => invoke.result?.key1); * ``` */ export declare function getSecretVersions(args: GetSecretVersionsArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getSecretVersions. */ export interface GetSecretVersionsArgs { /** * If true, all deprecated secret versions are included in the response. If false, no deprecated secret versions are included in the response. If no value is specified, the default value is `false`. */ includeDeprecated?: boolean; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: string; /** * Secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret. */ secretId: string; } /** * A collection of values returned by getSecretVersions. */ export interface GetSecretVersionsResult { /** * (**Deprecated**) ARN of the secret. Use `secretArn` instead. * * @deprecated arn is deprecated. Use secretArn instead. */ readonly arn: string; readonly includeDeprecated?: boolean; /** * (**Deprecated**) Name of the secret. Use `secretName` instead. * * @deprecated name is deprecated. Use secretName instead. */ readonly name: string; readonly region: string; /** * ARN of the secret. */ readonly secretArn: string; readonly secretId: string; /** * Name of the secret. */ readonly secretName: string; /** * List of the versions of the secret. Attributes are specified below. */ readonly versions: outputs.secretsmanager.GetSecretVersionsVersion[]; } /** * Retrieve the versions of a Secrets Manager secret. To retrieve secret metadata, see the data sources `aws.secretsmanager.Secret` and `aws.secretsmanager.SecretVersion`. * * ## Example Usage * * ### Retrieve All Versions of a Secret * * By default, this data sources retrieves all versions of a secret. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const secret_versions = aws.secretsmanager.getSecretVersions({ * secretId: example.id, * }); * ``` * * ### Retrieve Specific Secret Version * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const by_version_stage = aws.secretsmanager.getSecretVersion({ * secretId: example.id, * versionStage: "example", * }); * ``` * * ### Handling Key-Value Secret Strings in JSON * * Reading key-value pairs from JSON back into a native Terraform map can be accomplished in Terraform 0.12 and later with the `jsondecode()` function: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * * export const example = std.jsondecode({ * input: exampleAwsSecretsmanagerSecretVersion.secretString, * }).then(invoke => invoke.result?.key1); * ``` */ export declare function getSecretVersionsOutput(args: GetSecretVersionsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getSecretVersions. */ export interface GetSecretVersionsOutputArgs { /** * If true, all deprecated secret versions are included in the response. If false, no deprecated secret versions are included in the response. If no value is specified, the default value is `false`. */ includeDeprecated?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret. */ secretId: pulumi.Input; } //# sourceMappingURL=getSecretVersions.d.ts.map