|
| 1 | +data "google_project" "project" { |
| 2 | +} |
| 3 | + |
| 4 | +resource "google_compute_region_backend_service" "default" { |
| 5 | + name = "iap-settings-tf-${local.name_suffix}" |
| 6 | + region = "us-central1" |
| 7 | + health_checks = [google_compute_health_check.default.id] |
| 8 | + connection_draining_timeout_sec = 10 |
| 9 | + session_affinity = "CLIENT_IP" |
| 10 | +} |
| 11 | + |
| 12 | +resource "google_compute_health_check" "default" { |
| 13 | + name = "iap-bs-health-check-${local.name_suffix}" |
| 14 | + check_interval_sec = 1 |
| 15 | + timeout_sec = 1 |
| 16 | + |
| 17 | + tcp_health_check { |
| 18 | + port = "80" |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +resource "google_iap_settings" "iap_settings" { |
| 23 | + name = "projects/${data.google_project.project.number}/iap_web/compute-us-central1/services/${google_compute_region_backend_service.default.name}" |
| 24 | + access_settings { |
| 25 | + identity_sources = ["WORKFORCE_IDENTITY_FEDERATION"] |
| 26 | + allowed_domains_settings { |
| 27 | + domains = ["test.abc.com"] |
| 28 | + enable = true |
| 29 | + } |
| 30 | + cors_settings { |
| 31 | + allow_http_options = true |
| 32 | + } |
| 33 | + reauth_settings { |
| 34 | + method = "SECURE_KEY" |
| 35 | + max_age = "305s" |
| 36 | + policy_type = "MINIMUM" |
| 37 | + } |
| 38 | + gcip_settings { |
| 39 | + login_page_uri = "https://test.com/?apiKey=abc" |
| 40 | + } |
| 41 | + oauth_settings { |
| 42 | + login_hint = "test" |
| 43 | + } |
| 44 | + workforce_identity_settings { |
| 45 | + workforce_pools = ["wif-pool"] |
| 46 | + oauth2 { |
| 47 | + client_id = "test-client-id" |
| 48 | + client_secret = "test-client-secret" |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + application_settings { |
| 53 | + cookie_domain = "test.abc.com" |
| 54 | + csm_settings { |
| 55 | + rctoken_aud = "test-aud-set" |
| 56 | + } |
| 57 | + access_denied_page_settings { |
| 58 | + access_denied_page_uri = "test-uri" |
| 59 | + generate_troubleshooting_uri = true |
| 60 | + remediation_token_generation_enabled = false |
| 61 | + } |
| 62 | + attribute_propagation_settings { |
| 63 | + output_credentials = ["HEADER"] |
| 64 | + expression = "attributes.saml_attributes.filter(attribute, attribute.name in [\"test1\", \"test2\"])" |
| 65 | + enable = false |
| 66 | + } |
| 67 | + } |
| 68 | +} |
0 commit comments