Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/s3_bucket_replication_configuration: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation failing in main #23578

Closed
anGie44 opened this issue Mar 8, 2022 · 1 comment · Fixed by #23582
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/s3 Issues and PRs that pertain to the s3 service. service/sts Issues and PRs that pertain to the sts service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@anGie44
Copy link
Contributor

anGie44 commented Mar 8, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Test Error with Output

------- Stdout: -------
=== RUN   TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation
=== PAUSE TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation
=== CONT  TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation
    bucket_replication_configuration_test.go:306: Step 1/4 error: Error running apply: exit status 1
        
        Error: error creating S3 replication configuration for bucket (tf-acc-test-4349085454300687495-source): InvalidRequest: Destination bucket must have versioning enabled.
        	status code: 400, request id: Z0CWHKN2H4X9438D, host id: F/A3ItOAtiiDBG3iF2EfX81gCtKVVqi1Ep+3cbXiYrAV0QmySWfWPEQHVVVNE+gqEQi4LzgtAPc=
        
          with aws_s3_bucket_replication_configuration.test,
          on terraform_plugin_test.tf line 49, in resource "aws_s3_bucket_replication_configuration" "test":
          49: resource "aws_s3_bucket_replication_configuration" "test" {
        
--- FAIL: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation (63.09s)
FAIL

Important Factoids:

  • The test configuration is missing a dependency on the destination bucket's versioning
func testAccBucketReplicationConfigurationWithAccessControlTranslation(rName string) string {
	return testAccBucketReplicationConfigurationBase(rName) + `
data "aws_caller_identity" "current" {}

resource "aws_s3_bucket_replication_configuration" "test" {
  depends_on = [aws_s3_bucket_versioning.source] <-- add aws_s3_bucket_versioning.destination 

  bucket = aws_s3_bucket.source.id
  role   = aws_iam_role.test.arn

  rule {
    id     = "foobar"
    prefix = "foo"
    status = "Enabled"

    destination {
      account       = data.aws_caller_identity.current.account_id
      bucket        = aws_s3_bucket.destination.arn
      storage_class = "STANDARD"

      access_control_translation {
        owner = "Destination"
      }
    }
  }
}`
}
@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. service/sts Issues and PRs that pertain to the sts service. labels Mar 8, 2022
@anGie44 anGie44 added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. labels Mar 8, 2022
@anGie44 anGie44 changed the title tests/s3_bucket_replication_configuration: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation tests/s3_bucket_replication_configuration: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation failing in main Mar 8, 2022
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/s3 Issues and PRs that pertain to the s3 service. service/sts Issues and PRs that pertain to the sts service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
1 participant