terrascan icon indicating copy to clipboard operation
terrascan copied to clipboard

Terraform init: Unsupported block type; Blocks of type "moved" are not expected here

Open ShrishmaL7 opened this issue 1 year ago • 2 comments

  • terrascan version: v0.14.4

Description

I am facing similar issue as like described here: https://github.com/tenable/terrascan/issues/1182

Error: Unsupported block type on .terraform/modules/website_with_cname.logs/moved.tf line 7: 7: moved { Blocks of type "moved" are not expected here.

ShrishmaL7 avatar Sep 20 '23 16:09 ShrishmaL7

Similar issue here using Terrascan v1.18.5 on Ubuntu 20.04 LTS.

$ terraform version
Terraform v1.6.5
on linux_amd64

$ terrascan version
version: v1.18.5

$ terrascan scan -i terraform -f resources-codepipeline/s3.tf 
2023-12-06T10:47:13.043Z	error	cli/run.go:141	scan run failed{error 26 0  failed to load iac file 'resources-codepipeline/s3.tf'. error:
resources-codepipeline/s3.tf:49,1-6: Unsupported block type; Blocks of type "moved" are not expected here.
}

Example Terraform code causing the issue:

moved {
  from = aws_s3_bucket_acl.codepipeline_bucket_acl
  to   = aws_s3_bucket_acl.codepipeline_bucket
}

This is blocking me from using Terrascan as there is no way to skip the Terraform moved block check.

lisenet avatar Dec 06 '23 10:12 lisenet

+1 this issue is a blocker. Duplicate: https://github.com/tenable/terrascan/issues/1262

mjnowen avatar Dec 29 '23 21:12 mjnowen