Skip to content

Commit 3d9ee2a

Browse files
Ty Larrabeemodular-magician
Ty Larrabee
authored andcommitted
Add purpose and role to subnetwork for L7 load balancing
Signed-off-by: Modular Magician <[email protected]>
1 parent 57bde0d commit 3d9ee2a

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

google/iam.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,8 @@ func createIamBindingsMap(bindings []*cloudresourcemanager.Binding) map[string]m
199199
}
200200
// Get each member (user/principal) for the binding
201201
for _, m := range b.Members {
202-
// members are in <type>:<value> format
203-
// <type> is case sensitive
204-
// <value> isn't
205-
// so let's lowercase the value and leave the type alone
206-
pieces := strings.SplitN(m, ":", 2)
207-
if len(pieces) > 1 {
208-
pieces[1] = strings.ToLower(pieces[1])
209-
}
210-
m = strings.Join(pieces, ":")
211-
212202
// Add the member
213-
bm[b.Role][m] = struct{}{}
203+
bm[b.Role][strings.ToLower(m)] = struct{}{}
214204
}
215205
}
216206
return bm

website/docs/r/compute_subnetwork.html.markdown

+30
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,36 @@ provider "google-beta"{
113113
zone = "us-central1-a"
114114
}
115115
```
116+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
117+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=subnetwork_internal_l7lb&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
118+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
119+
</a>
120+
</div>
121+
## Example Usage - Subnetwork Internal L7lb
122+
123+
124+
```hcl
125+
provider "google-beta" {
126+
region = "us-central1"
127+
zone = "us-central1-a"
128+
}
129+
130+
resource "google_compute_subnetwork" "network-for-l7lb" {
131+
provider = "google-beta"
132+
name = "l7lb-test-subnetwork"
133+
ip_cidr_range = "10.0.0.0/22"
134+
region = "us-central1"
135+
purpose = "INTERNAL_HTTPS_LOAD_BALANCER"
136+
role = "ACTIVE"
137+
network = "${google_compute_network.custom-test.self_link}"
138+
}
139+
140+
resource "google_compute_network" "custom-test" {
141+
provider = "google-beta"
142+
name = "l7lb-test-network"
143+
auto_create_subnetworks = false
144+
}
145+
```
116146

117147
## Argument Reference
118148

0 commit comments

Comments
 (0)