diff --git a/google/iam_storage_bucket.go b/google/iam_storage_bucket.go index 88db8f76520..cb7aaf77ca2 100644 --- a/google/iam_storage_bucket.go +++ b/google/iam_storage_bucket.go @@ -51,8 +51,14 @@ func (u *StorageBucketIamUpdater) SetResourceIamPolicy(policy *cloudresourcemana return errwrap.Wrapf(fmt.Sprintf("Invalid IAM policy for %s: {{err}}", u.DescribeResource()), err) } + ppolicy, err := u.Config.clientStorage.Buckets.GetIamPolicy(u.bucket).Do() + if err != nil { + return errwrap.Wrapf(fmt.Sprintf("Error setting IAM policy for %s: {{err}}", u.DescribeResource()), err) + } + storagePolicy.Etag = ppolicy.Etag _, err = u.Config.clientStorage.Buckets.SetIamPolicy(u.bucket, storagePolicy).Do() + if err != nil { return errwrap.Wrapf(fmt.Sprintf("Error setting IAM policy for %s: {{err}}", u.DescribeResource()), err) }