{# terraback/templates/azure/resources/azure_resource_group.tf.j2 #}
# Generated by Terraback
# Azure Resource Groups

{% for rg in resources %}
resource "azurerm_resource_group" "{{ rg.name_sanitized }}" {
  name     = "{{ rg.name }}"
  location = "{{ rg.location }}"
  
  {%- if rg.managed_by %}
  # Note: This resource group is managed by: {{ rg.managed_by }}
  {%- endif %}
  
  {%- if rg.tags %}
  tags = {
    {%- for key, value in rg.tags.items() %}
    {{ key }} = "{{ value }}"{{ "," if not loop.last }}
    {%- endfor %}
  }
  {%- endif %}

  lifecycle {
    prevent_destroy = true
  }
}
{% endfor %}