diff --git a/.changelog/4809.txt b/.changelog/4809.txt new file mode 100644 index 00000000000..5a944d38da0 --- /dev/null +++ b/.changelog/4809.txt @@ -0,0 +1,3 @@ +```release-note:bug +storage: fixed error when `matches_storage_class` is set empty on `google_storage_bucket` +``` diff --git a/google/resource_storage_bucket.go b/google/resource_storage_bucket.go index 0ce7bb1d8e2..c8fcf4ecb52 100644 --- a/google/resource_storage_bucket.go +++ b/google/resource_storage_bucket.go @@ -194,7 +194,6 @@ func resourceStorageBucket() *schema.Resource { "matches_storage_class": { Type: schema.TypeList, Optional: true, - MinItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, Description: `Storage Class of objects to satisfy this condition. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, DURABLE_REDUCED_AVAILABILITY.`, }, diff --git a/google/resource_storage_bucket_test.go b/google/resource_storage_bucket_test.go index ae42cebabe2..46128bd993a 100644 --- a/google/resource_storage_bucket_test.go +++ b/google/resource_storage_bucket_test.go @@ -1332,6 +1332,7 @@ resource "google_storage_bucket" "bucket" { type = "Delete" } condition { + matches_storage_class = [] age = 10 } }