{% extends "common/base_resource.tf.j2" %}

{% block resources %}
{% for resource in resources %}
{{ resource_spacer() }}
resource "azurerm_mssql_virtual_network_rule" "{{ resource.name }}" {
  name      = "{{ resource.properties.name }}"
  server_id = "{{ resource.properties.server_id }}"
  subnet_id = "{{ resource.properties.subnet_id }}"
  
  {% if resource.properties.ignore_missing_vnet_service_endpoint is defined %}
  ignore_missing_vnet_service_endpoint = {{ resource.properties.ignore_missing_vnet_service_endpoint | lower }}
  {% endif %}
}

{% endfor %}
{% endblock %}
