"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecretVersion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * 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: `secretDataWo`.
 * Read more about Write-only Arguments.
 *
 * ## 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),
 * });
 * ```
 *
 * ## 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}}
 * ```
 */
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, id, state, opts) {
        return new SecretVersion(name, state, { ...opts, id: id });
    }
    /**
     * 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) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === SecretVersion.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["deletionPolicy"] = state?.deletionPolicy;
            resourceInputs["destroyTime"] = state?.destroyTime;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["isSecretDataBase64"] = state?.isSecretDataBase64;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["secret"] = state?.secret;
            resourceInputs["secretData"] = state?.secretData;
            resourceInputs["secretDataWo"] = state?.secretDataWo;
            resourceInputs["secretDataWoVersion"] = state?.secretDataWoVersion;
            resourceInputs["version"] = state?.version;
        }
        else {
            const args = argsOrState;
            if (args?.secret === undefined && !opts.urn) {
                throw new Error("Missing required property 'secret'");
            }
            resourceInputs["deletionPolicy"] = args?.deletionPolicy;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["isSecretDataBase64"] = args?.isSecretDataBase64;
            resourceInputs["project"] = args?.project;
            resourceInputs["secret"] = args?.secret;
            resourceInputs["secretData"] = args?.secretData ? pulumi.secret(args.secretData) : undefined;
            resourceInputs["secretDataWo"] = args?.secretDataWo ? pulumi.secret(args.secretDataWo) : undefined;
            resourceInputs["secretDataWoVersion"] = args?.secretDataWoVersion;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["destroyTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["version"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["secretData", "secretDataWo"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(SecretVersion.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SecretVersion = SecretVersion;
/** @internal */
SecretVersion.__pulumiType = 'gcp:secretmanager/secretVersion:SecretVersion';
//# sourceMappingURL=secretVersion.js.map