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

{% block resources %}
{% for resource in resources %}
{{ resource_spacer() }}
resource "azurerm_route" "{{ resource.name }}" {
  name                   = "{{ resource.properties.name }}"
  resource_group_name    = "{{ resource.properties.resource_group_name }}"
  route_table_name       = "{{ resource.properties.route_table_name }}"
  address_prefix         = "{{ resource.properties.address_prefix }}"
  next_hop_type          = "{{ resource.properties.next_hop_type }}"
  
  {% if resource.properties.next_hop_in_ip_address is defined %}
  next_hop_in_ip_address = "{{ resource.properties.next_hop_in_ip_address }}"
  {% endif %}
}

{% endfor %}
{% endblock %}
