@@ -250,6 +250,81 @@ func TestAccStorageBucket_dualLocation(t *testing.T) {
250250 })
251251}
252252
253+ func TestAccStorageBucket_dualLocation_lowercase (t * testing.T ) {
254+ t .Parallel ()
255+
256+ bucketName := acctest .TestBucketName (t )
257+
258+ acctest .VcrTest (t , resource.TestCase {
259+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
260+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
261+ CheckDestroy : testAccStorageBucketDestroyProducer (t ),
262+ Steps : []resource.TestStep {
263+ {
264+ Config : testAccStorageBucket_dualLocation_lowercase (bucketName ),
265+ },
266+ {
267+ ResourceName : "google_storage_bucket.bucket" ,
268+ ImportState : true ,
269+ ImportStateVerify : true ,
270+ ImportStateVerifyIgnore : []string {"force_destroy" },
271+ },
272+ },
273+ })
274+ }
275+
276+ func TestAccStorageBucket_dualLocation_versionChange (t * testing.T ) {
277+ // Test is not parallel because ENVs are set.
278+ // Need to skip VCR as this test downloads providers from the Terraform Registry
279+ acctest .SkipIfVcr (t )
280+
281+ creds := envvar .GetTestCredsFromEnv ()
282+ project := envvar .GetTestProjectFromEnv ()
283+ t .Setenv ("GOOGLE_CREDENTIALS" , creds )
284+ t .Setenv ("GOOGLE_PROJECT" , project )
285+
286+ bucketName := acctest .TestBucketName (t )
287+
288+ acctest .VcrTest (t , resource.TestCase {
289+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
290+ CheckDestroy : testAccStorageBucketDestroyProducer (t ),
291+ Steps : []resource.TestStep {
292+ {
293+ Config : testAccStorageBucket_dualLocation (bucketName ),
294+ ExternalProviders : map [string ]resource.ExternalProvider {
295+ "google" : {
296+ VersionConstraint : "5.30.0" ,
297+ Source : "hashicorp/google" ,
298+ },
299+ },
300+ },
301+ {
302+ ResourceName : "google_storage_bucket.bucket" ,
303+ ExternalProviders : map [string ]resource.ExternalProvider {
304+ "google" : {
305+ VersionConstraint : "5.30.0" ,
306+ Source : "hashicorp/google" ,
307+ },
308+ },
309+ ImportState : true ,
310+ ImportStateVerify : true ,
311+ ImportStateVerifyIgnore : []string {"force_destroy" },
312+ },
313+ {
314+ Config : testAccStorageBucket_dualLocation (bucketName ),
315+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
316+ },
317+ {
318+ ResourceName : "google_storage_bucket.bucket" ,
319+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
320+ ImportState : true ,
321+ ImportStateVerify : true ,
322+ ImportStateVerifyIgnore : []string {"force_destroy" },
323+ },
324+ },
325+ })
326+ }
327+
253328func TestAccStorageBucket_dualLocation_rpo (t * testing.T ) {
254329 t .Parallel ()
255330 bucketName := acctest .TestBucketName (t )
@@ -1715,6 +1790,19 @@ resource "google_storage_bucket" "bucket" {
17151790` , bucketName )
17161791}
17171792
1793+ func testAccStorageBucket_dualLocation_lowercase (bucketName string ) string {
1794+ return fmt .Sprintf (`
1795+ resource "google_storage_bucket" "bucket" {
1796+ name = "%s"
1797+ location = "ASIA"
1798+ force_destroy = true
1799+ custom_placement_config {
1800+ data_locations = ["asia-east1", "asia-southeast1"]
1801+ }
1802+ }
1803+ ` , bucketName )
1804+ }
1805+
17181806func testAccStorageBucket_dualLocation_rpo (bucketName string , rpo string ) string {
17191807 return fmt .Sprintf (`
17201808resource "google_storage_bucket" "bucket" {
0 commit comments