google_composer_user_workloads_secret

User workloads Secret used by Airflow tasks that run with Kubernetes Executor or KubernetesPodOperator. Intended for Composer 3 Environments.

Example Usage

resource "google_composer_environment" "example" {
  name              = "example-environment"
  project           = "example-project"
  region            = "us-central1"
  config {
    software_config {
      image_version = "example-image-version"
    }
  }
}

resource "google_composer_user_workloads_secret" "example" {
  name = "example-secret"
  project = "example-project"
  region = "us-central1"
  environment = google_composer_environment.example.name
  data = {
    email: base64encode("example-email"),
    password: base64encode("example-password"),
  }
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Import

Secret can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import User Workloads Secret using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}}"
  to = google_composer_user_workloads_secret.example
}

When using the terraform import command, Environment can be imported using one of the formats above. For example:

$ terraform import google_composer_user_workloads_secret.example projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}}
$ terraform import google_composer_user_workloads_secret.example {{project}}/{{region}}/{{environment}}/{{name}}
$ terraform import google_composer_user_workloads_secret.example {{name}}