{% set config = merged_configs.get('google_storage_bucket_iam_member', {}) %}
# Compliance: {{ compliance_comments.get('google_storage_bucket_iam_member', []) | join(', ') }}
resource "google_storage_bucket_iam_member" "main" {
  bucket = google_storage_bucket.main.name
  role   = "{{ config.get('role', 'roles/storage.objectViewer') }}"
  member = "{{ config.get('member', 'serviceAccount:${var.project_id}@appspot.gserviceaccount.com') }}"

  {% if config.get('condition') %}
  condition {
    title       = "{{ config.condition.get('title', '') }}"
    description = "{{ config.condition.get('description', '') }}"
    expression  = "{{ config.condition.get('expression', '') }}"
  }
  {% endif %}
}
