Google Secret Manager Secret

This page shows how to write Terraform for Secret Manager Secret and write them securely.

google_secret_manager_secret (Terraform)

The Secret in Secret Manager can be configured in Terraform with the resource name google_secret_manager_secret. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

github-iconnseblu/elo-mystudies
resource "google_secret_manager_secret" "manual_mystudies_email_address" {
  provider = google-beta

  secret_id = "manual-mystudies-email-address"
  project   = module.project.project_id

github-iconGoogleCloudPlatform/fda-mystudies
resource "google_secret_manager_secret" "manual_mystudies_email_address" {
  provider = google-beta

  secret_id = "manual-mystudies-email-address"
  project   = module.project.project_id

github-iconSimsulation/budstudies
resource "google_secret_manager_secret" "manual_mystudies_email_address" {
  provider = google-beta

  secret_id = "manual-mystudies-email-address"
  project   = module.project.project_id

github-iconbeetleaz/la_fda
resource "google_secret_manager_secret" "manual_mystudies_email_address" {
  provider = google-beta

  secret_id = "manual-mystudies-email-address"
  project   = module.project.project_id

github-iconerawlins45/fda-mystudies
resource "google_secret_manager_secret" "manual_mystudies_email_address" {
  provider = google-beta

  secret_id = "manual-mystudies-email-address"
  project   = module.project.project_id

Parameters

  • create_time requiredcomputed - string
    • The time at which the Secret was created.

  • id optionalcomputed - string
  • labels optional - map / string
    • The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [p{Ll}p{Lo}][p{ll}p{lo}p{n}_-]{0,62} Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [p{Ll}p{Lo}p{N}_-]{0,63} No more than 64 labels can be assigned to a given resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

  • name requiredcomputed - string
    • The resource name of the Secret. Format: 'projects/{{project}}/secrets/{{secret_id}}'

  • project optionalcomputed - string
  • secret_id required - string
    • This must be unique within the project.

Explanation in Terraform Registry

A Secret is a logical secret whose value and versions can be accessed. To get more information about Secret, see:

Frequently asked questions

What is Google Secret Manager Secret?

Google Secret Manager Secret is a resource for Secret Manager of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Secret Manager Secret?

For Terraform, the nseblu/elo-mystudies, GoogleCloudPlatform/fda-mystudies and Simsulation/budstudies source code examples are useful. See the Terraform Example section for further details.

security-icon

Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.