# terraform-linters/tflint-ruleset-aws architecture

> Architecture diagram of the GitHub repository terraform-linters/tflint-ruleset-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/terraform-linters/tflint-ruleset-aws
- Repository: https://github.com/terraform-linters/tflint-ruleset-aws

## Overview

This is a TFLint plugin ruleset for detecting AWS-provider-specific Terraform errors and best-practice violations before apply. The principal workflow is TFLint invoking the plugin’s registered rules, which inspect Terraform resources and report issues; selected deep checks use AWS APIs. The repository also includes rule families for provider-model constraints, tags, ephemeral resources, and deprecated Lambda runtimes. AWS runtime wiring is only partly visible in the supplied excerpts and index, so uncertain links are omitted or marked unverified.

Main entry points: [`rules`](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules) (Static checks), [`main.go`](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/main.go) (Plugin entry), [`rules/api`](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/api) (AWS API checks), [`rules/provider.go`](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/provider.go) (Rule registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin runtime"]
  node_plugin_main["Plugin entry<br/>[main.go]"]
  node_ruleset["AWS ruleset<br/>[ruleset.go]"]
end

subgraph group_checks["Validation rules"]
  node_rule_registry["Rule registry<br/>[provider.go]"]
  node_standard_rules["Static checks"]
  node_model_rules["Provider model checks"]
  node_api_rules["AWS API checks"]
  node_tag_rules["Tag checks"]
  node_ephemeral_rules["Ephemeral checks"]
  node_lambda_rule["Lambda lifecycle"]
end

subgraph group_awsdata["AWS lookups"]
  node_aws_runner["AWS runner<br/>[runner.go]"]
  node_aws_client["AWS client<br/>[client.go]"]
end

subgraph group_ruledata["Rule data"]
  node_db_types["RDS type data"]
  node_cache_types["Cache type data"]
  node_rule_generators["Rule generators<br/>[main.go]"]
  node_cache_generator["Cache type generator<br/>[main.go]"]
end

node_tflint(("TFLint"))
node_aws_services(("AWS services"))
node_issues["Reported issues"]

node_tflint -->|"starts plugin"| node_plugin_main
node_plugin_main -->|"serves ruleset"| node_ruleset
node_plugin_main -->|"registers rules"| node_rule_registry
node_rule_registry -.->|"provides checks"| node_standard_rules
node_standard_rules -->|"emits findings"| node_issues
node_model_rules -.->|"validates models"| node_issues
node_api_rules -->|"requests AWS client"| node_aws_runner
node_aws_runner -.->|"provides client"| node_aws_client
node_aws_client -.->|"queries APIs"| node_aws_services
node_api_rules -->|"emits findings"| node_issues
node_tag_rules -.->|"checks tagging"| node_issues
node_ephemeral_rules -.->|"checks arguments"| node_issues
node_lambda_rule -->|"reports lifecycle"| node_issues
node_rule_generators -.->|"generates checks"| node_model_rules
node_cache_generator -.->|"generates type data"| node_cache_types
node_db_types -.->|"supplies type data"| node_standard_rules
node_cache_types -.->|"supplies type data"| node_standard_rules

click node_plugin_main "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/main.go"
click node_ruleset "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/ruleset.go"
click node_rule_registry "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/provider.go"
click node_standard_rules "https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules"
click node_model_rules "https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/models"
click node_api_rules "https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/api"
click node_tag_rules "https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/tags"
click node_ephemeral_rules "https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/ephemeral"
click node_lambda_rule "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/lambda_deprecated_runtime/aws_lambda_function_deprecated_runtime.go"
click node_db_types "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/db_instance_types/db_instance_types.go"
click node_cache_types "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/elasticache_node_types/elasticache_node_types.go"
click node_rule_generators "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/models/generator/main.go"
click node_cache_generator "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/elasticache_node_types/generator/main.go"
click node_aws_runner "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/runner.go"
click node_aws_client "https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/client.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin_main,node_ruleset toneBlue
class node_rule_registry,node_standard_rules,node_model_rules,node_api_rules,node_tag_rules,node_ephemeral_rules,node_lambda_rule toneAmber
class node_aws_runner,node_aws_client toneMint
class node_db_types,node_cache_types,node_rule_generators,node_cache_generator toneRose
class node_tflint,node_aws_services,node_issues toneIndigo
```

## Components

### Plugin runtime

- [Plugin entry](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/main.go): `main.go`
- [AWS ruleset](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/ruleset.go): `aws/ruleset.go`

### Validation rules

- [Rule registry](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/provider.go): `rules/provider.go`
- [Static checks](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules): `rules`
- [Provider model checks](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/models): `rules/models`
- [AWS API checks](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/api): `rules/api`
- [Tag checks](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/tags): `rules/tags`
- [Ephemeral checks](https://github.com/terraform-linters/tflint-ruleset-aws/tree/master/rules/ephemeral): `rules/ephemeral`
- [Lambda lifecycle](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/lambda_deprecated_runtime/aws_lambda_function_deprecated_runtime.go): `rules/lambda_deprecated_runtime/aws_lambda_function_deprecated_runtime.go`

### AWS lookups

- [AWS runner](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/runner.go): `aws/runner.go`
- [AWS client](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/aws/client.go): `aws/client.go`

### Rule data

- [RDS type data](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/db_instance_types/db_instance_types.go): `rules/db_instance_types/db_instance_types.go`
- [Cache type data](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/elasticache_node_types/elasticache_node_types.go): `rules/elasticache_node_types/elasticache_node_types.go`
- [Rule generators](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/models/generator/main.go): `rules/models/generator/main.go`
- [Cache type generator](https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/rules/elasticache_node_types/generator/main.go): `rules/elasticache_node_types/generator/main.go`

### Other components

- **TFLint**
- **AWS services**
- **Reported issues**

## Connections

- TFLint → Plugin entry: starts plugin (evidence: `README.md`)
- Plugin entry → AWS ruleset: serves ruleset (evidence: `main.go`)
- Plugin entry → Rule registry: registers rules (evidence: `main.go`)
- Rule registry → Static checks: provides checks
- Static checks → Reported issues: emits findings (evidence: `rules/aws_db_instance_invalid_engine.go`)
- Provider model checks → Reported issues: validates models
- AWS API checks → AWS runner: requests AWS client (evidence: `rules/api/aws_instance_invalid_ami.go`)
- AWS runner → AWS client: provides client
- AWS client → AWS services: queries APIs
- AWS API checks → Reported issues: emits findings (evidence: `rules/api/aws_instance_invalid_ami.go`)
- Tag checks → Reported issues: checks tagging
- Ephemeral checks → Reported issues: checks arguments
- Lambda lifecycle → Reported issues: reports lifecycle (evidence: `rules/lambda_deprecated_runtime/aws_lambda_function_deprecated_runtime.go`)
- Rule generators → Provider model checks: generates checks
- Cache type generator → Cache type data: generates type data
- RDS type data → Static checks: supplies type data (evidence: `rules/db_instance_types/db_instance_types.go`)
- Cache type data → Static checks: supplies type data (evidence: `rules/elasticache_node_types/elasticache_node_types.go`)
