Skip to content

Commit

Permalink
add diffsuppress for iam custom role stage. fixes TPG #1801 (#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
modular-magician authored and nat-henderson committed Dec 21, 2018
1 parent 898babb commit c27ec18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions google/resource_google_organization_iam_custom_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package google

import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"google.golang.org/api/iam/v1"
Expand Down Expand Up @@ -40,10 +41,11 @@ func resourceGoogleOrganizationIamCustomRole() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
},
"stage": {
Type: schema.TypeString,
Optional: true,
Default: "GA",
ValidateFunc: validation.StringInSlice([]string{"ALPHA", "BETA", "GA", "DEPRECATED", "DISABLED", "EAP"}, false),
Type: schema.TypeString,
Optional: true,
Default: "GA",
ValidateFunc: validation.StringInSlice([]string{"ALPHA", "BETA", "GA", "DEPRECATED", "DISABLED", "EAP"}, false),
DiffSuppressFunc: emptyOrDefaultStringSuppress("ALPHA"),
},
"description": {
Type: schema.TypeString,
Expand Down
10 changes: 6 additions & 4 deletions google/resource_google_project_iam_custom_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package google

import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"google.golang.org/api/iam/v1"
Expand Down Expand Up @@ -41,10 +42,11 @@ func resourceGoogleProjectIamCustomRole() *schema.Resource {
ForceNew: true,
},
"stage": {
Type: schema.TypeString,
Optional: true,
Default: "GA",
ValidateFunc: validation.StringInSlice([]string{"ALPHA", "BETA", "GA", "DEPRECATED", "DISABLED", "EAP"}, false),
Type: schema.TypeString,
Optional: true,
Default: "GA",
ValidateFunc: validation.StringInSlice([]string{"ALPHA", "BETA", "GA", "DEPRECATED", "DISABLED", "EAP"}, false),
DiffSuppressFunc: emptyOrDefaultStringSuppress("ALPHA"),
},
"description": {
Type: schema.TypeString,
Expand Down

0 comments on commit c27ec18

Please sign in to comment.