Skip to content

Commit

Permalink
Remove default addition of IAP message to resource google_compute_reg…
Browse files Browse the repository at this point in the history
…ion_backend_service
  • Loading branch information
arnabadg-google committed Dec 27, 2023
1 parent 998c06e commit 739e327
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion mmv1/products/compute/RegionBackendService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ examples:
vars:
region_backend_service_name: 'region-service'
health_check_name: 'rbs-health-check'
- !ruby/object:Provider::Terraform::Examples
name: 'region_backend_service_external_iap'
primary_resource_id: 'default'
vars:
region_backend_service_name: 'tf-test-region-service-external'
ignore_read_extra:
- 'iap.0.oauth2_client_secret'
- !ruby/object:Provider::Terraform::Examples
name: 'region_backend_service_cache'
primary_resource_id: 'default'
Expand Down Expand Up @@ -740,7 +747,6 @@ properties:
- !ruby/object:Api::Type::NestedObject
name: 'iap'
description: Settings for enabling Cloud Identity Aware Proxy
send_empty_value: true
properties:
- !ruby/object:Api::Type::String
name: 'oauth2ClientId'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@
// present in config.

iapVal := obj["iap"]
if iapVal == nil {
data := map[string]interface{}{}
data["enabled"] = false
data["oauth2ClientId"] = ""
data["oauth2ClientSecret"] = ""
obj["iap"] = data
} else {
if iapVal != nil {
iap := iapVal.(map[string]interface{})
iap["enabled"] = true
obj["iap"] = iap
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "google_compute_region_backend_service" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['region_backend_service_name'] %>"
region = "us-central1"
protocol = "HTTP"
load_balancing_scheme = "EXTERNAL"
iap {
oauth2_client_id = "abc"
oauth2_client_secret = "xyz"
}
}

0 comments on commit 739e327

Please sign in to comment.