Skip to content

Commit

Permalink
Validate on deleted members
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick authored and modular-magician committed Nov 22, 2019
1 parent a6681b9 commit 510d635
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package google

import (
"encoding/json"
"regexp"
"sort"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"google.golang.org/api/cloudresourcemanager/v1"
)

Expand Down Expand Up @@ -39,7 +41,10 @@ func dataSourceGoogleIamPolicy() *schema.Resource {
"members": {
Type: schema.TypeSet,
Required: true,
Elem: &schema.Schema{Type: schema.TypeString},
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringDoesNotMatch(regexp.MustCompile("^deleted:"), "Terraform does not support deleted IAM members"),
},
Set: schema.HashString,
},
<% unless version == 'ga' -%>
Expand Down

0 comments on commit 510d635

Please sign in to comment.