{% set config = merged_configs.get('google_redis_instance', {}) %}
# Compliance: {{ compliance_comments.get('google_redis_instance', []) | join(', ') }}
resource "google_redis_instance" "main" {
  name           = "{{ config.get('name', '${var.project_id}-redis') }}"
  project        = var.project_id
  region         = var.region
  memory_size_gb = {{ config.get('memory_size_gb', 1) }}
  tier           = "{{ config.get('tier', 'STANDARD_HA') }}"
  redis_version  = "{{ config.get('redis_version', 'REDIS_7_0') }}"

  auth_enabled            = {{ config.get('auth_enabled', true) | lower }}
  transit_encryption_mode = "{{ config.get('transit_encryption_mode', 'SERVER_AUTHENTICATION') }}"

  authorized_network = "{{ config.get('authorized_network', '') }}"
  connect_mode       = "{{ config.get('connect_mode', 'PRIVATE_SERVICE_ACCESS') }}"
}
