Skip to content

Commit

Permalink
dns: rename a field of wrr's geo-location from region to location
Browse files Browse the repository at this point in the history
  • Loading branch information
kanata2 committed Apr 26, 2022
1 parent 2e1354e commit 93671ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions mmv1/third_party/terraform/resources/resource_dns_record_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ func resourceDnsRecordSet() *schema.Resource {
"geo": {
Type: schema.TypeList,
Optional: true,
Description: `The configuration for Geolocation based routing policy.`,
Description: `The configuration for Geo location based routing policy.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"region": {
"location": {
Type: schema.TypeString,
Required: true,
Description: `The region name defined in Google Cloud.`,
Description: `The location name defined in Google Cloud.`,
},
"rrdatas": {
Type: schema.TypeList,
Expand Down Expand Up @@ -560,7 +560,7 @@ func convertRoutingPolicy(ps []interface{}) *dns.RRSetRoutingPolicy {
return nil
}
}
location, ok := gi["region"].(string)
location, ok := gi["location"].(string)
if !ok {
return nil
}
Expand Down Expand Up @@ -610,7 +610,7 @@ func flattenDnsRecordSetRoutingPolicyGEO(geo *dns.RRSetRoutingPolicyGeoPolicy) [
ris := make([]interface{}, 0, len(geo.Items))
for _, item := range geo.Items {
ri := make(map[string]interface{})
ri["region"] = item.Location
ri["location"] = item.Location
ri["rrdatas"] = item.Rrdatas
ris = append(ris, ri)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ resource "google_dns_record_set" "foobar" {
`, zoneName, zoneName, zoneName, ttl, weight, addr2)
}

func testAccDnsRecordSet_routingPolicyGEO(zoneName, addr2 string, ttl int, region string) string {
func testAccDnsRecordSet_routingPolicyGEO(zoneName, addr2 string, ttl int, location string) string {
return fmt.Sprintf(`
resource "google_dns_managed_zone" "parent-zone" {
name = "%s"
Expand All @@ -451,15 +451,15 @@ resource "google_dns_record_set" "foobar" {

routing_policy {
geo {
region = "asia-east1"
rrdatas = ["127.0.0.1"]
location = "asia-east1"
rrdatas = ["127.0.0.1"]
}
geo {
region = "%s"
rrdatas = ["%s"]
location = "%s"
rrdatas = ["%s"]
}
}
}
`, zoneName, zoneName, zoneName, ttl, region, addr2)
`, zoneName, zoneName, zoneName, ttl, location, addr2)
}

Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ resource "google_dns_record_set" "geo" {
routing_policy {
geo {
region = "asia-east1"
rrdatas = ["10.128.1.1"]
location = "asia-east1"
rrdatas = ["10.128.1.1"]
}
geo {
region = "us-central1"
rrdatas = ["10.130.1.1"]
location = "us-central1"
rrdatas = ["10.130.1.1"]
}
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ The following arguments are supported:

<a name="nested_geo"></a>The `geo` block supports:

* `region` - (Required) The region name defined in Google Cloud.
* `location` - (Required) The location name defined in Google Cloud.

* `rrdatas` - (Required) Same as `rrdatas` above.

Expand Down

0 comments on commit 93671ba

Please sign in to comment.