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

terraform.aws.best-practice.aws-s3-bucket-versioning-not-enabled.aws-s3-bucket-versioning-not-enabled has false positive on v5+ of the Terraform provider for AWS #3497

Open
1 of 3 tasks
nint8835 opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nint8835
Copy link

Describe the bug
The rule terraform.aws.best-practice.aws-s3-bucket-versioning-not-enabled.aws-s3-bucket-versioning-not-enabled checks for object versioning being enabled based on the versioning block in the aws_s3_bucket resource being configured.

However, as of v5 of the Terraform provider, many configurations that once were blocks within the main aws_s3_bucket resource had separate resources created for them, with the block method deprecated, and this includes versioning. As a result, enabling versioning via a non-deprecated means will result in a false positive. This may also impact other rules related to S3 that are impacted by this change.

To Reproduce

resource "aws_s3_bucket" "example" {
  bucket = "example-bucket"
}

resource "aws_s3_bucket_versioning" "versioning_example" {
  bucket = aws_s3_bucket.example.id
  versioning_configuration {
    status = "Enabled"
  }
}

Expected behavior
A bucket with versioning enabled via aws_s3_bucket_versioning should not trigger a false positive saying versioning isn't configured.

Priority
How important is this to you?

  • P0: blocking me from making progress
  • P1: this will block me in the near future
  • P2: annoying but not blocking me

Additional Context
Add any other context about the problem here.

@nint8835 nint8835 added the bug Something isn't working label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant