gcp cloud run, how to define multiple secret volumes via terraform, currently only 1 secret seems supported in documentation

Viewed 91

Currently the terraform documentation for cloud run here shows you an example on how to mount 1 single secret volume to the cloud run service.

  template {
    spec {
      containers {
        image = "gcr.io/cloudrun/hello"
        volume_mounts {
          name = "a-volume"
          mount_path = "/secrets"
        }
      }
      volumes {
        name = "a-volume"
        secret {
          secret_name = google_secret_manager_secret.secret.secret_id
          default_mode = 292 # 0444
          items {
            key = "1"
            path = "my-secret"
            mode = 256 # 0400
          }
        }
      }
    }
  }

I've tried to add multiple volumes and secret blocks but this will error out saying only 1 is allowed.

I've also tried to look through the documentation for a general example of multiple volumes but no such example exists.

0 Answers
Related