{%- if environment.active_deployment %}
{%- for resource in environment.config.resources %}
{%- for k, v in resource.settings.managed_secret_values_for_tf.items() %}
resource "google_secret_manager_secret" "{{ k }}" {
  secret_id = "{{ k }}"

  replication {
    auto {}
  }
}

resource "google_secret_manager_secret_version" "{{ k }}" {
  secret = "${google_secret_manager_secret.{{ k }}.id}"
  secret_data = "{{ v }}"
}
{%- endfor %}
{%- endfor %}
{%- endif %}
