{% set config = merged_configs.get('google_bigquery_dataset', {}) %}
# Compliance: {{ compliance_comments.get('google_bigquery_dataset', []) | join(', ') }}
resource "google_bigquery_dataset" "main" {
  dataset_id  = "{{ config.get('dataset_id', 'main_dataset') }}"
  project     = var.project_id
  location    = "{{ config.get('location', 'US') }}"
  description = "{{ config.get('description', 'Managed by ComplyForm') }}"

  default_table_expiration_ms     = {{ config.get('default_table_expiration_ms', 'null') }}
  default_partition_expiration_ms = {{ config.get('default_partition_expiration_ms', 'null') }}
{% if config.get('default_encryption_key') %}

  default_encryption_configuration {
    kms_key_name = {{ config.get('default_encryption_key') }}
  }
{% endif %}
}
