Skip to content

AWS Provider Hardcoded Regions

Rule: aws_provider_hardcoded_region

This rule checks AWS provider configurations for hardcoded regions. It detects:

  • Hardcoded regions in provider region attribute
  • Hardcoded regions in assume_role ARNs
provider "aws" {
region = "us-east-1" # ❌ Hardcoded region
}
provider "aws" {
region = var.aws_region # ✅ Use variables
}

This rule is disabled by default. To enable it, add it to your .tflint.hcl:

rule "aws_provider_hardcoded_region" {
enabled = true
}