hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.25k stars 1.7k forks source link

Allow configuring Identity-Aware Proxy (IAP) customization settings #6471

Open tbcardoso opened 4 years ago

tbcardoso commented 4 years ago

Community Note

Description

It would be useful to have a resource that configures the Identity-Aware Proxy (IAP) customization settings described in https://cloud.google.com/iap/docs/customizing.

For example, we need to let some IAP proxies pass through HTTP OPTIONS requests. For that, we need to set access_settings.cors_settings.allow_http_options to true.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_iap_settings" "allow_cors" {
  resource_type = "compute"
  service       = "google_compute_backend_service.istio_global_http_iap_bes.self_link"

  accessSettings {
    corsSettings {
      allowHttpOptions = true
    }
  }
}

Workaround

It's possible to workaround this limitation by using a null resource with a local-exec provisioner:

locals {
  iap_settings = <<-EOT
  accessSettings:
    corsSettings:
      allowHttpOptions: true
  EOT
}

resource "null_resource" "iap_settings" {
  triggers = {
    bes_iap_settings = local.bes_iap_settings
    project_id       = data.google_project.project.project_id
    bes_name         = google_compute_backend_service.bes.name
  }

  provisioner "local-exec" {
    command = <<-EOT
    echo '${local.bes_iap_settings}' | \
    gcloud iap settings set /dev/stdin \
      --project=${data.google_project.project.project_id} \
      --resource-type=compute \
      --service=${google_compute_backend_service.bes.name}
    EOT
  }
}

References

b/305197972

wvanderdeijl commented 3 years ago

The resource documentation can be found at https://cloud.google.com/iap/docs/reference/rest/v1/IapSettings

We are mainly interested in the accessSettings.gcipSettings and not the accessSettings. corsSettings from this original request. But I hope all fields of IapSettings will be included if this resource is created

dinvlad commented 3 years ago

Any updates on this?

sankit2020 commented 2 years ago

Please also add support for PolicyDelegationSettings.

This bug should be linked : https://b.corp.google.com/issues/195649321

maucaro commented 1 year ago

I am also interested, as @wvanderdeijl , in accessSettings.gcipSettings. Any updates?

Ironlink commented 8 months ago

I am interested in this. I would like to be able to set the default cookie domain for IAP at a project level.

MattiasOlla commented 8 months ago

We'd also be interested in this, especially allowed_domains_settings.

markConklin commented 5 months ago

plus 1. thank you.

jacobshirley commented 3 months ago

It's been nearly 4 years.. will this ever be added?

radsec commented 2 months ago

++