diff --git a/google/resource_google_folder_organization_policy.go b/google/resource_google_folder_organization_policy.go index 812a3244370..6a12247f7c1 100644 --- a/google/resource_google_folder_organization_policy.go +++ b/google/resource_google_folder_organization_policy.go @@ -92,7 +92,7 @@ func setFolderOrganizationPolicy(d *schema.ResourceData, meta interface{}) error return err } - restore_default, err := expandRestoreOrganizationPolicy(d.Get("restore_policy").([]interface{})) + restoreDefault, err := expandRestoreOrganizationPolicy(d.Get("restore_policy").([]interface{})) if err != nil { return err } @@ -102,7 +102,7 @@ func setFolderOrganizationPolicy(d *schema.ResourceData, meta interface{}) error Constraint: canonicalOrgPolicyConstraint(d.Get("constraint").(string)), BooleanPolicy: expandBooleanOrganizationPolicy(d.Get("boolean_policy").([]interface{})), ListPolicy: listPolicy, - RestoreDefault: restore_default, + RestoreDefault: restoreDefault, Version: int64(d.Get("version").(int)), Etag: d.Get("etag").(string), }, diff --git a/google/resource_google_organization_policy.go b/google/resource_google_organization_policy.go index b9c109d782e..01778321613 100644 --- a/google/resource_google_organization_policy.go +++ b/google/resource_google_organization_policy.go @@ -249,17 +249,17 @@ func flattenBooleanOrganizationPolicy(policy *cloudresourcemanager.BooleanPolicy } func flattenRestoreOrganizationPolicy(restore_policy *cloudresourcemanager.RestoreDefault) []map[string]interface{} { - bRestore_policy := make([]map[string]interface{}, 0, 1) + rp := make([]map[string]interface{}, 0, 1) if restore_policy == nil { - return bRestore_policy + return rp } - bRestore_policy = append(bRestore_policy, map[string]interface{}{ + rp = append(rp, map[string]interface{}{ "default": true, }) - return bRestore_policy + return rp } func expandBooleanOrganizationPolicy(configured []interface{}) *cloudresourcemanager.BooleanPolicy { diff --git a/google/resource_google_organization_policy_test.go b/google/resource_google_organization_policy_test.go index 3c794ca157e..b62a0bac927 100644 --- a/google/resource_google_organization_policy_test.go +++ b/google/resource_google_organization_policy_test.go @@ -316,12 +316,12 @@ func getGoogleOrganizationPolicyTestResource(s *terraform.State, n string) (*clo func testAccOrganizationPolicyConfig_boolean(org string, enforced bool) string { return fmt.Sprintf(` resource "google_organization_policy" "bool" { - org_id = "%s" - constraint = "constraints/compute.disableSerialPortAccess" + org_id = "%s" + constraint = "constraints/compute.disableSerialPortAccess" - boolean_policy { - enforced = %t - } + boolean_policy { + enforced = %t + } } `, org, enforced) } @@ -329,14 +329,14 @@ resource "google_organization_policy" "bool" { func testAccOrganizationPolicyConfig_list_allowAll(org string) string { return fmt.Sprintf(` resource "google_organization_policy" "list" { - org_id = "%s" - constraint = "constraints/serviceuser.services" - - list_policy { - allow { - all = true - } - } + org_id = "%s" + constraint = "constraints/serviceuser.services" + + list_policy { + allow { + all = true + } + } } `, org) } @@ -344,16 +344,16 @@ resource "google_organization_policy" "list" { func testAccOrganizationPolicyConfig_list_allowSome(org, project string) string { return fmt.Sprintf(` resource "google_organization_policy" "list" { - org_id = "%s" - constraint = "constraints/compute.trustedImageProjects" - - list_policy { - allow { - values = [ - "projects/%s", - "projects/debian-cloud" - ] - } + org_id = "%s" + constraint = "constraints/compute.trustedImageProjects" + + list_policy { + allow { + values = [ + "projects/%s", + "projects/debian-cloud" + ] + } } } `, org, project) @@ -362,17 +362,17 @@ resource "google_organization_policy" "list" { func testAccOrganizationPolicyConfig_list_denySome(org string) string { return fmt.Sprintf(` resource "google_organization_policy" "list" { - org_id = "%s" - constraint = "serviceuser.services" - - list_policy { - deny { - values = [ - "doubleclicksearch.googleapis.com", - "replicapoolupdater.googleapis.com", - ] - } - } + org_id = "%s" + constraint = "serviceuser.services" + + list_policy { + deny { + values = [ + "doubleclicksearch.googleapis.com", + "replicapoolupdater.googleapis.com", + ] + } + } } `, org) } @@ -380,12 +380,12 @@ resource "google_organization_policy" "list" { func testAccOrganizationPolicyConfig_restore_defaultTrue(org string) string { return fmt.Sprintf(` resource "google_organization_policy" "restore" { - org_id = "%s" - constraint = "serviceuser.services" + org_id = "%s" + constraint = "serviceuser.services" - restore_policy { - default = true - } + restore_policy { + default = true + } } `, org) } diff --git a/google/resource_google_project_organization_policy_test.go b/google/resource_google_project_organization_policy_test.go index 79e53b113da..12067285c24 100644 --- a/google/resource_google_project_organization_policy_test.go +++ b/google/resource_google_project_organization_policy_test.go @@ -339,9 +339,9 @@ resource "google_project_organization_policy" "restore" { project = "%s" constraint = "constraints/serviceuser.services" - restore_policy { - default = true - } + restore_policy { + default = true + } } `, pid) }