diff --git a/internal/service/s3/object_data_source_test.go b/internal/service/s3/object_data_source_test.go index 179f8ad1c2b..8be7b761479 100644 --- a/internal/service/s3/object_data_source_test.go +++ b/internal/service/s3/object_data_source_test.go @@ -634,7 +634,8 @@ resource "aws_s3_bucket_versioning" "object_bucket" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.object_bucket.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.object_bucket.bucket key = "tf-testing-obj-%[1]d" content = "Hello World" object_lock_legal_hold_status = "OFF" @@ -665,7 +666,8 @@ resource "aws_s3_bucket_versioning" "object_bucket" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.object_bucket.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.object_bucket.bucket key = "tf-testing-obj-%[1]d" content = "Hello World" force_destroy = true diff --git a/internal/service/s3/object_test.go b/internal/service/s3/object_test.go index 752458ff7b4..5843838ea6a 100644 --- a/internal/service/s3/object_test.go +++ b/internal/service/s3/object_test.go @@ -1687,7 +1687,8 @@ resource "aws_s3_bucket_versioning" "object_bucket_3" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.object_bucket_3.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.object_bucket_3.bucket key = "updateable-key" source = %[3]q etag = filemd5(%[3]q) @@ -1709,7 +1710,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_access_point" "test" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket name = %[1]q } @@ -1768,7 +1770,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = "test-key" content = %[2]q acl = %[3]q @@ -1805,7 +1808,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = %[2]q content = %[3]q @@ -1832,7 +1836,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = %[2]q content = %[3]q @@ -1860,7 +1865,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = %[2]q content = %[3]q } @@ -1903,7 +1909,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = "test-key" content = %[2]q force_destroy = true @@ -1929,7 +1936,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = "test-key" content = %[2]q object_lock_legal_hold_status = %[3]q @@ -1956,7 +1964,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = "test-key" content = %[2]q force_destroy = true @@ -1982,7 +1991,8 @@ resource "aws_s3_bucket_versioning" "test" { } resource "aws_s3_object" "object" { - bucket = aws_s3_bucket.test.bucket + # Must have bucket versioning enabled first + bucket = aws_s3_bucket_versioning.test.bucket key = "test-key" content = %[2]q force_destroy = true