forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_source_compute_lb_ip_ranges.go
45 lines (37 loc) · 1.03 KB
/
data_source_compute_lb_ip_ranges.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package google
import (
"github.com/hashicorp/terraform/helper/schema"
)
func dataSourceGoogleComputeLbIpRanges() *schema.Resource {
return &schema.Resource{
Read: dataSourceGoogleComputeLbIpRangesRead,
Schema: map[string]*schema.Schema{
"network": {
Type: schema.TypeList,
Elem: &schema.Schema{Type: schema.TypeString},
Computed: true,
},
"http_ssl_tcp_internal": {
Type: schema.TypeList,
Elem: &schema.Schema{Type: schema.TypeString},
Computed: true,
},
},
}
}
func dataSourceGoogleComputeLbIpRangesRead(d *schema.ResourceData, meta interface{}) error {
d.SetId("compute-lb-ip-ranges")
// https://cloud.google.com/compute/docs/load-balancing/health-checks#health_check_source_ips_and_firewall_rules
networkIpRanges := []string{
"209.85.152.0/22",
"209.85.204.0/22",
"35.191.0.0/16",
}
d.Set("network", networkIpRanges)
httpSslTcpInternalRanges := []string{
"130.211.0.0/22",
"35.191.0.0/16",
}
d.Set("http_ssl_tcp_internal", httpSslTcpInternalRanges)
return nil
}