{% extends "aws/base_resource.tf.j2" %}
{% block resources %}
{% for log_group in resources %}
{{ resource_spacer() }}
resource "aws_cloudwatch_log_group" "{{ log_group.name_sanitized if log_group.get('name_sanitized') else log_group.logGroupName | tf_resource_name }}" {
  name = "{{ log_group.logGroupName }}"

  {% if log_group.get('retentionInDays') %}
  retention_in_days = {{ log_group.retentionInDays }}
  {%  endif %}

  {% if log_group.get('kmsKeyId') %}
  kms_key_id = "{{ log_group.kmsKeyId }}"
  {%  endif %}

  {% if log_group.get('logGroupClass') %}
  log_group_class = "{{ log_group.logGroupClass }}"
  {%  endif %}

  {{ render_common_tags(log_group, indent=2) }}
}

{% endfor %}
{% endblock %}
