UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

285 lines (284 loc) • 10 kB
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 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), * }); * ``` * ## 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<pulumi.ID>, 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<string>; /** * 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<string | undefined>; /** * The time at which the Secret was destroyed. Only present if state is DESTROYED. */ readonly destroyTime: pulumi.Output<string>; /** * The current state of the SecretVersion. */ readonly enabled: pulumi.Output<boolean | undefined>; /** * If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is. */ readonly isSecretDataBase64: pulumi.Output<boolean | undefined>; /** * The resource name of the SecretVersion. Format: * `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}` */ readonly name: pulumi.Output<string>; /** * Secret Manager secret resource * * * - - - */ readonly secret: pulumi.Output<string>; /** * 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<string | undefined>; /** * 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<number | undefined>; /** * The version of the Secret. */ readonly version: pulumi.Output<string>; /** * 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<string>; /** * 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<string>; /** * The time at which the Secret was destroyed. Only present if state is DESTROYED. */ destroyTime?: pulumi.Input<string>; /** * The current state of the SecretVersion. */ enabled?: pulumi.Input<boolean>; /** * If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is. */ isSecretDataBase64?: pulumi.Input<boolean>; /** * The resource name of the SecretVersion. Format: * `projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}` */ name?: pulumi.Input<string>; /** * Secret Manager secret resource * * * - - - */ secret?: pulumi.Input<string>; /** * 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<string>; /** * 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<number>; /** * The version of the Secret. */ version?: pulumi.Input<string>; } /** * 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<string>; /** * The current state of the SecretVersion. */ enabled?: pulumi.Input<boolean>; /** * If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is. */ isSecretDataBase64?: pulumi.Input<boolean>; /** * Secret Manager secret resource * * * - - - */ secret: pulumi.Input<string>; /** * 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<string>; /** * 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<number>; }