Skip to content

Commit

Permalink
Use rName
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-rich committed Jul 27, 2021
1 parent 4f70291 commit 2d0ce0b
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions aws/resource_aws_s3_bucket_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func TestAccAWSS3BucketObject_empty(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -182,8 +182,8 @@ func TestAccAWSS3BucketObject_source(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -212,8 +212,8 @@ func TestAccAWSS3BucketObject_content(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "content", "content_base64"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "content", "content_base64", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -245,8 +245,8 @@ func TestAccAWSS3BucketObject_etagEncryption(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -324,8 +324,8 @@ func TestAccAWSS3BucketObject_sourceHashTrigger(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "content", "content_base64"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "content", "content_base64", "force_destroy", "source", "source_hash"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -371,12 +371,20 @@ func TestAccAWSS3BucketObject_nonVersioned(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSS3BucketObjectDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSS3BucketObjectConfig_nonVersioned(rName, sourceInitial),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSS3BucketObjectExists(resourceName, &originalObj),
testAccCheckAWSS3BucketObjectBody(&originalObj, "initial object state"),
resource.TestCheckResourceAttr(resourceName, "version_id", ""),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -424,8 +432,8 @@ func TestAccAWSS3BucketObject_updates(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/updateable-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/updateable-key", rName),
},
},
})
Expand Down Expand Up @@ -515,8 +523,8 @@ func TestAccAWSS3BucketObject_updatesWithVersioning(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/updateable-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/updateable-key", rName),
},
},
})
Expand Down Expand Up @@ -588,8 +596,8 @@ func TestAccAWSS3BucketObject_kms(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -622,8 +630,8 @@ func TestAccAWSS3BucketObject_sse(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "source"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "source", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -673,8 +681,8 @@ func TestAccAWSS3BucketObject_acl(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl", "content"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "content", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -720,8 +728,8 @@ func TestAccAWSS3BucketObject_metadata(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"acl"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"acl", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -783,8 +791,8 @@ func TestAccAWSS3BucketObject_storageClass(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"content", "acl"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/test-key", rInt),
ImportStateVerifyIgnore: []string{"content", "acl", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/test-key", rName),
},
},
})
Expand Down Expand Up @@ -855,8 +863,8 @@ func TestAccAWSS3BucketObject_tags(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"content", "acl"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/%s", rInt, key),
ImportStateVerifyIgnore: []string{"content", "acl", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/%s", rName, key),
},
},
})
Expand Down Expand Up @@ -927,8 +935,8 @@ func TestAccAWSS3BucketObject_tagsLeadingSingleSlash(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"content", "acl"},
ImportStateId: fmt.Sprintf("s3://tf-object-test-bucket-%d/%s", rInt, key),
ImportStateVerifyIgnore: []string{"content", "acl", "force_destroy"},
ImportStateId: fmt.Sprintf("s3://%s/%s", rName, key),
},
},
})
Expand Down

0 comments on commit 2d0ce0b

Please sign in to comment.