{% extends "gcp/base_resource.tf.j2" %}
{% block resources %}
{% for db in resources %}
{{ resource_spacer() }}
resource "google_sql_database" "{{ db.name_sanitized }}" {
  name     = "{{ db.name }}"
  instance = "{{ db.instance }}"
  
  {% if db.charset %}
  charset  = "{{ db.charset }}"
  {% endif %}
  
  {% if db.collation %}
  collation = "{{ db.collation }}"
  {% endif %}

  lifecycle {
    prevent_destroy = true
  }
}

{% endfor %}
{% endblock %}
