Skip to content

Commit

Permalink
Merge pull request #23100 from hashicorp/td-s3-bucket-versioning-depe…
Browse files Browse the repository at this point in the history
…ndencies

tests/s3: add dependency on `aws_s3_bucket_versioning` when configuring `s3_object` resources
  • Loading branch information
anGie44 authored Feb 10, 2022
2 parents dfb548a + ccfb6eb commit 4d568f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
6 changes: 4 additions & 2 deletions internal/service/s3/object_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
30 changes: 20 additions & 10 deletions internal/service/s3/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4d568f9

Please sign in to comment.