"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.RegionalSecret = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Regional Secret is a logical secret whose value and versions can be created and accessed within a region only.
 *
 * To get more information about RegionalSecret, see:
 *
 * * [API documentation](https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.locations.secrets)
 * * How-to Guides
 *     * [Create and deploy a Regional Secret](https://cloud.google.com/secret-manager/regional-secrets/create-regional-secret)
 *
 * ## Example Usage
 *
 * ### Regional Secret Config Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const regional_secret_basic = new gcp.secretmanager.RegionalSecret("regional-secret-basic", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     labels: {
 *         label: "my-label",
 *     },
 *     annotations: {
 *         key1: "value1",
 *         key2: "value2",
 *         key3: "value3",
 *     },
 *     deletionProtection: false,
 * });
 * ```
 * ### Regional Secret With Cmek
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const kms_secret_binding = new gcp.kms.CryptoKeyIAMMember("kms-secret-binding", {
 *     cryptoKeyId: "kms-key",
 *     role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-secretmanager.iam.gserviceaccount.com`),
 * });
 * const regional_secret_with_cmek = new gcp.secretmanager.RegionalSecret("regional-secret-with-cmek", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     customerManagedEncryption: {
 *         kmsKeyName: "kms-key",
 *     },
 * }, {
 *     dependsOn: [kms_secret_binding],
 * });
 * ```
 * ### Regional Secret With Rotation
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const topic = new gcp.pubsub.Topic("topic", {name: "tf-topic"});
 * const secretsManagerAccess = new gcp.pubsub.TopicIAMMember("secrets_manager_access", {
 *     topic: topic.name,
 *     role: "roles/pubsub.publisher",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-secretmanager.iam.gserviceaccount.com`),
 * });
 * const regional_secret_with_rotation = new gcp.secretmanager.RegionalSecret("regional-secret-with-rotation", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     topics: [{
 *         name: topic.id,
 *     }],
 *     rotation: {
 *         rotationPeriod: "3600s",
 *         nextRotationTime: "2045-11-30T00:00:00Z",
 *     },
 * }, {
 *     dependsOn: [secretsManagerAccess],
 * });
 * ```
 * ### Regional Secret With Ttl
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const regional_secret_with_ttl = new gcp.secretmanager.RegionalSecret("regional-secret-with-ttl", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     labels: {
 *         label: "my-label",
 *     },
 *     annotations: {
 *         key1: "value1",
 *         key2: "value2",
 *         key3: "value3",
 *     },
 *     ttl: "36000s",
 * });
 * ```
 * ### Regional Secret With Expire Time
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const regional_secret_with_expire_time = new gcp.secretmanager.RegionalSecret("regional-secret-with-expire-time", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     labels: {
 *         label: "my-label",
 *     },
 *     annotations: {
 *         key1: "value1",
 *         key2: "value2",
 *         key3: "value3",
 *     },
 *     expireTime: "2055-11-30T00:00:00Z",
 * });
 * ```
 * ### Regional Secret With Version Destroy Ttl
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const regional_secret_with_version_destroy_ttl = new gcp.secretmanager.RegionalSecret("regional-secret-with-version-destroy-ttl", {
 *     secretId: "tf-reg-secret",
 *     location: "us-central1",
 *     labels: {
 *         label: "my-label",
 *     },
 *     annotations: {
 *         key1: "value1",
 *         key2: "value2",
 *         key3: "value3",
 *     },
 *     versionDestroyTtl: "86400s",
 * });
 * ```
 *
 * ## Import
 *
 * RegionalSecret can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}`
 *
 * * `{{project}}/{{location}}/{{secret_id}}`
 *
 * * `{{location}}/{{secret_id}}`
 *
 * When using the `pulumi import` command, RegionalSecret can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:secretmanager/regionalSecret:RegionalSecret default projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:secretmanager/regionalSecret:RegionalSecret default {{project}}/{{location}}/{{secret_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:secretmanager/regionalSecret:RegionalSecret default {{location}}/{{secret_id}}
 * ```
 */
class RegionalSecret extends pulumi.CustomResource {
    /**
     * Get an existing RegionalSecret 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 RegionalSecret(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionalSecret.  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'] === RegionalSecret.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["annotations"] = state?.annotations;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["customerManagedEncryption"] = state?.customerManagedEncryption;
            resourceInputs["deletionProtection"] = state?.deletionProtection;
            resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["expireTime"] = state?.expireTime;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["rotation"] = state?.rotation;
            resourceInputs["secretId"] = state?.secretId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["topics"] = state?.topics;
            resourceInputs["ttl"] = state?.ttl;
            resourceInputs["versionAliases"] = state?.versionAliases;
            resourceInputs["versionDestroyTtl"] = state?.versionDestroyTtl;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.secretId === undefined && !opts.urn) {
                throw new Error("Missing required property 'secretId'");
            }
            resourceInputs["annotations"] = args?.annotations;
            resourceInputs["customerManagedEncryption"] = args?.customerManagedEncryption;
            resourceInputs["deletionProtection"] = args?.deletionProtection;
            resourceInputs["expireTime"] = args?.expireTime;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["rotation"] = args?.rotation;
            resourceInputs["secretId"] = args?.secretId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["topics"] = args?.topics;
            resourceInputs["ttl"] = args?.ttl;
            resourceInputs["versionAliases"] = args?.versionAliases;
            resourceInputs["versionDestroyTtl"] = args?.versionDestroyTtl;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveAnnotations"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(RegionalSecret.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionalSecret = RegionalSecret;
/** @internal */
RegionalSecret.__pulumiType = 'gcp:secretmanager/regionalSecret:RegionalSecret';
//# sourceMappingURL=regionalSecret.js.map