Back to packages

/tflint-ruleset-aws-meta

TFLint ruleset for terraform-provider-aws, checking for hardcoded Partitions and Regions

Installgo get github.com/myerscode/tflint-ruleset-aws-meta
1Stars
0Forks
91Commits
v0.5.1Latest
MITLicense
Go98.1%JavaScript1.3%TypeScript0.4%Makefile0.2%
terraform-awstflinttflint-ruleset

TFLint AWS Meta Ruleset

Build StatusLatest ReleaseGo ReferenceGo Report CardLicense

A TFLint ruleset for AWS best practices, focusing on preventing hardcoded values and promoting flexible, maintainable Terraform code.

This ruleset helps enforce multi-region and multi-partition compatibility by detecting hardcoded AWS regions and partitions in your Terraform configurations. It provides comprehensive coverage across IAM policies, provider configurations, and all AWS resource types where hardcoded values prevent flexible deployments.

Requirements

  • TFLint v0.42+
  • Go v1.25

Installation

TODO: This template repository does not contain release binaries, so this installation will not work. Please rewrite for your repository. See the "Building the plugin" section to get this template ruleset working.

You can install the plugin with tflint --init. Declare a config in .tflint.hcl as follows:

plugin "aws-meta" {
  enabled = true

  version = "0.5.1"
  source  = "github.com/myerscode/tflint-ruleset-aws-meta"
}

Rules

NameDescriptionSeverityEnabled By DefaultLink
aws_hardcoded_idsValidates that there are no hardcoded AWS account IDs or AMI IDsWARNING❌docs
aws_meta_hardcodedValidates that there are no hardcoded AWS regions or partitions in ARN values across all resource typesWARNING✅docs
aws_iam_role_policy_hardcoded_regionValidates that there are no hardcoded AWS regions in IAM role policy documentsWARNING❌docs
aws_iam_role_policy_hardcoded_partitionValidates that there are no hardcoded AWS partitions in IAM role policy documentsWARNING❌docs
aws_iam_policy_hardcoded_regionValidates that there are no hardcoded AWS regions in IAM policy documentsWARNING❌docs
aws_iam_policy_hardcoded_partitionValidates that there are no hardcoded AWS partitions in IAM policy documentsWARNING❌docs
aws_provider_hardcoded_regionValidates that there are no hardcoded AWS regions in provider configurationWARNING❌docs
aws_service_principal_hardcodedValidates that service principals don't use hardcoded DNS suffixes (e.g., amazonaws.com)WARNING✅docs
aws_service_principal_dns_suffixValidates that service principals don't use dns_suffix interpolationWARNING✅docs

For detailed examples and usage information, see the documentation site.