Skip to content

Commit

Permalink
Merge pull request #145 from modular-magician/codegen-pr-2128
Browse files Browse the repository at this point in the history
Sync storage_bucket.go with resource_storage_bucket.go
  • Loading branch information
slevenick authored Aug 7, 2019
2 parents 08f08ed + d267e82 commit c99fe39
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions google/storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func GetStorageBucketApiObject(d TerraformResourceData, config *Config) (map[str
Name: bucket,
Labels: expandLabels(d),
Location: location,
IamConfiguration: expandIamConfiguration(d),
}

if v, ok := d.GetOk("storage_class"); ok {
Expand Down Expand Up @@ -260,3 +261,13 @@ func resourceGCSBucketLifecycleCreateOrUpdate(d TerraformResourceData, sb *stora

return nil
}

func expandIamConfiguration(d TerraformResourceData) *storage.BucketIamConfiguration {
return &storage.BucketIamConfiguration{
ForceSendFields: []string{"BucketPolicyOnly"},
BucketPolicyOnly: &storage.BucketIamConfigurationBucketPolicyOnly{
Enabled: d.Get("bucket_policy_only").(bool),
ForceSendFields: []string{"Enabled"},
},
}
}

0 comments on commit c99fe39

Please sign in to comment.