{% extends "gcp/base_resource.tf.j2" %}
{% import "common/macros.j2" as macros %}
{% block resources %}
{% for sa in resources %}
{{ resource_spacer() }}
resource "google_service_account" "{{ sa.account_id | replace('-', '_') | replace('.', '_') | replace('@', '_') }}" {
  account_id   = "{{ sa.account_id }}"
  display_name = "{{ sa.display_name }}"
  {% if sa.description %}
  description  = "{{ sa.description }}"
  {% endif %}

  {% if sa.disabled %}
  disabled     = {{ sa.disabled | lower }}
  {% endif %}

  lifecycle {
    prevent_destroy = true
  }
}

{% endfor %}
{% endblock %}
