tenable/terrascan

Rule ID AC_AWS_0214 relies on deprecated Terraform code

lisenet opened this issue · 0 comments

  • terrascan version: 1.18.3
  • Operating System: Ubuntu 20.04 LTS

Description

Terrascan relies on deprecated Terraform code.

What I Did

Using S3 versioning in Terraform resource "aws_s3_bucket" is deprecated, the correct way is to use the resource aws_s3_bucket_versioning instead.

Example Terraform code that is used in this case:

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

resource "aws_s3_bucket_versioning" "example" {
  bucket   = aws_s3_bucket.example.id

  versioning_configuration {
    status = "Enabled"
  }
}

Terrascan incorrectly assumes that S3 versioning has not been enabled, when it has.

	Description    :	Enabling S3 versioning will enable easy recovery from both unintended user actions, like deletes and overwrites
	File           :	example/s3.tf
	Module Name    :	root
	Plan Root      :	example
	Line           :	1
	Severity       :	HIGH
	Rule Name      :	s3Versioning
	Rule ID        :	AC_AWS_0214
	Resource Name  :	example
	Resource Type  :	aws_s3_bucket
	Category       :	Resilience