import * as pulumi from "@pulumi/pulumi";
/**
* A secret version resource.
*
* To get more information about SecretVersion, see:
*
* * [API documentation](https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.secrets.versions)
* * How-to Guides
* * [Create and deploy a Secret Version](https://cloud.google.com/secret-manager/docs/add-secret-version)
*
* > **Note:** All arguments marked as write-only values will not be stored in the state: `payload.secret_data_wo`.
* Read more about Write-only Attributes.
*
* ## Example Usage
*
* ### Secret Version Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-version",
* labels: {
* label: "my-label",
* },
* replication: {
* auto: {},
* },
* });
* const secret_version_basic = new gcp.secretmanager.SecretVersion("secret-version-basic", {
* secret: secret_basic.id,
* secretData: "secret-data",
* });
* ```
* ### Secret Version Basic Write Only
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const secret_basic_write_only = new gcp.secretmanager.Secret("secret-basic-write-only", {
* secretId: "secret-version-write-only",
* labels: {
* label: "my-label",
* },
* replication: {
* auto: {},
* },
* });
* const secret_version_basic_write_only = new gcp.secretmanager.SecretVersion("secret-version-basic-write-only", {
* secret: secret_basic_write_only.id,
* secretDataWoVersion: 1,
* secretDataWo: "secret-data-write-only",
* });
* ```
* ### Secret Version Deletion Policy Abandon
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-version",
* replication: {
* userManaged: {
* replicas: [{
* location: "us-central1",
* }],
* },
* },
* });
* const secret_version_deletion_policy = new gcp.secretmanager.SecretVersion("secret-version-deletion-policy", {
* secret: secret_basic.id,
* secretData: "secret-data",
* deletionPolicy: "ABANDON",
* });
* ```
* ### Secret Version Deletion Policy Disable
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-version",
* replication: {
* userManaged: {
* replicas: [{
* location: "us-central1",
* }],
* },
* },
* });
* const secret_version_deletion_policy = new gcp.secretmanager.SecretVersion("secret-version-deletion-policy", {
* secret: secret_basic.id,
* secretData: "secret-data",
* deletionPolicy: "DISABLE",
* });
* ```
* ### Secret Version With Base64 String Secret Data
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
*
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-version",
* replication: {
* userManaged: {
* replicas: [{
* location: "us-central1",
* }],
* },
* },
* });
* const secret_version_base64 = new gcp.secretmanager.SecretVersion("secret-version-base64", {
* secret: secret_basic.id,
* isSecretDataBase64: true,
* secretData: std.filebase64({
* input: "secret-data.pfx",
* }).then(invoke => invoke.result),
* });
* ```
* ### Secret Version With Base64 String Secret Data Write Only
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
*
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-version-base64-write-only",
* replication: {
* userManaged: {
* replicas: [{
* location: "us-central1",
* }],
* },
* },
* });
* const secret_version_base64_write_only = new gcp.secretmanager.SecretVersion("secret-version-base64-write-only", {
* secret: secret_basic.id,
* isSecretDataBase64: true,
* secretDataWoVersion: 1,
* secretDataWo: std.filebase64({
* input: "secret-data-base64-write-only.pfx",
* }).then(invoke => invoke.result),
* });
* ```
*
* ## Ephemeral Attributes Reference
*
* The following write-only attributes are supported:
*
* * `secretDataWo` -
* (Optional)
* The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
* **Note**: This property is write-only and will not be read from the API.
*
* The `payload` block supports:
*
* * `secretDataWo` -
* (Optional)
* The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
* **Note**: This property is write-only and will not be read from the API.
*
* ## Import
*
* SecretVersion can be imported using any of these accepted formats:
*
* * `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}`
*
* When using the `pulumi import` command, SecretVersion can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:secretmanager/secretVersion:SecretVersion default projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
* ```
*/
export declare class SecretVersion extends pulumi.CustomResource {
/**
* Get an existing SecretVersion 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: string, id: pulumi.Input, state?: SecretVersionState, opts?: pulumi.CustomResourceOptions): SecretVersion;
/**
* Returns true if the given object is an instance of SecretVersion. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is SecretVersion;
/**
* The time at which the Secret was created.
*/
readonly createTime: pulumi.Output;
/**
* The deletion policy for the secret version. Setting `ABANDON` allows the resource
* to be abandoned rather than deleted. Setting `DISABLE` allows the resource to be
* disabled rather than deleted. Default is `DELETE`. Possible values are:
* * DELETE
* * DISABLE
* * ABANDON
*/
readonly deletionPolicy: pulumi.Output;
/**
* The time at which the Secret was destroyed. Only present if state is DESTROYED.
*/
readonly destroyTime: pulumi.Output;
/**
* The current state of the SecretVersion.
*/
readonly enabled: pulumi.Output;
/**
* If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
*/
readonly isSecretDataBase64: pulumi.Output;
/**
* The resource name of the SecretVersion. Format:
* `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}`
*/
readonly name: pulumi.Output;
/**
* The ID of the project in which the resource belongs. If it is not provided,
* the provider project is used
*/
readonly project: pulumi.Output;
/**
* Secret Manager secret resource
*/
readonly secret: pulumi.Output;
/**
* The secret data. Must be no larger than 64KiB.
* **Note**: This property is sensitive and will not be displayed in the plan.
*/
readonly secretData: pulumi.Output;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
readonly secretDataWo: pulumi.Output;
/**
* Triggers update of secret data write-only. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
readonly secretDataWoVersion: pulumi.Output;
/**
* The version of the Secret.
*/
readonly version: pulumi.Output;
/**
* Create a SecretVersion resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: SecretVersionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering SecretVersion resources.
*/
export interface SecretVersionState {
/**
* The time at which the Secret was created.
*/
createTime?: pulumi.Input;
/**
* The deletion policy for the secret version. Setting `ABANDON` allows the resource
* to be abandoned rather than deleted. Setting `DISABLE` allows the resource to be
* disabled rather than deleted. Default is `DELETE`. Possible values are:
* * DELETE
* * DISABLE
* * ABANDON
*/
deletionPolicy?: pulumi.Input;
/**
* The time at which the Secret was destroyed. Only present if state is DESTROYED.
*/
destroyTime?: pulumi.Input;
/**
* The current state of the SecretVersion.
*/
enabled?: pulumi.Input;
/**
* If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
*/
isSecretDataBase64?: pulumi.Input;
/**
* The resource name of the SecretVersion. Format:
* `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}`
*/
name?: pulumi.Input;
/**
* The ID of the project in which the resource belongs. If it is not provided,
* the provider project is used
*/
project?: pulumi.Input;
/**
* Secret Manager secret resource
*/
secret?: pulumi.Input;
/**
* The secret data. Must be no larger than 64KiB.
* **Note**: This property is sensitive and will not be displayed in the plan.
*/
secretData?: pulumi.Input;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
secretDataWo?: pulumi.Input;
/**
* Triggers update of secret data write-only. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
secretDataWoVersion?: pulumi.Input;
/**
* The version of the Secret.
*/
version?: pulumi.Input;
}
/**
* The set of arguments for constructing a SecretVersion resource.
*/
export interface SecretVersionArgs {
/**
* The deletion policy for the secret version. Setting `ABANDON` allows the resource
* to be abandoned rather than deleted. Setting `DISABLE` allows the resource to be
* disabled rather than deleted. Default is `DELETE`. Possible values are:
* * DELETE
* * DISABLE
* * ABANDON
*/
deletionPolicy?: pulumi.Input;
/**
* The current state of the SecretVersion.
*/
enabled?: pulumi.Input;
/**
* If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
*/
isSecretDataBase64?: pulumi.Input;
/**
* The ID of the project in which the resource belongs. If it is not provided,
* the provider project is used
*/
project?: pulumi.Input;
/**
* Secret Manager secret resource
*/
secret: pulumi.Input;
/**
* The secret data. Must be no larger than 64KiB.
* **Note**: This property is sensitive and will not be displayed in the plan.
*/
secretData?: pulumi.Input;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
secretDataWo?: pulumi.Input;
/**
* Triggers update of secret data write-only. For more info see [updating write-only attributes](https://www.terraform.io/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
*/
secretDataWoVersion?: pulumi.Input;
}