Skip to content

Rules ​

core ​

RuleDescriptionSeverityCategoryRecommendedFixable
documented-outputsRequire every output block to have a description.errorcore✔
documented-variablesRequire every variable block to have a description.errorcore✔
module-source-pinnedRequire module sources to be pinned via ?ref=, a version attribute, or a local path.errorcore✔
no-bool-as-countFlag a count meta-argument set to a boolean; Terraform 0.12 removed bool-to-number coercion.errorcore✔✔
no-duplicate-map-keysFlag a repeated statically-known key in an object literal. HCL keeps only the last entry and silently discards the earlier ones.errorcore✔
no-empty-list-equalityFlag == or != against an empty tuple literal [], which never matches a list, set, or map value. Use length(expr) == 0 instead.errorcore✔✔
no-external-refs-in-destroy-provisionerFlag references to anything other than self, count.index, or each.key/each.value inside provisioner blocks with when = destroy.errorcore✔
no-legacy-count-attributeFlag references to the legacy .count attribute of a resource, removed in Terraform 0.12. Use length(...) instead.errorcore✔✔
no-legacy-dot-indexFlag legacy dot forms list.0 and a.*.b. Use bracket index list[0] and full splat a[*].b.warncore✔✔
no-legacy-ignore-changes-wildcardFlag the quoted ["*"] wildcard in a lifecycle ignore_changes list, replaced by the unquoted all keyword in Terraform 0.15.errorcore✔✔
no-legacy-list-functionFlag the legacy list(...) function, removed in Terraform 0.15. Use a [...] tuple literal instead.errorcore✔✔
no-legacy-lookupFlag two-argument lookup(), deprecated since Terraform 0.7. Use index syntax instead.warncore✔✔
no-legacy-map-functionFlag the legacy map(...) function, removed in Terraform 0.15, in favor of a { key = value } object literal.errorcore✔✔
no-legacy-provider-proxyFlag empty provider blocks that exist only to declare an alias; replace with configuration_aliases in required_providers.errorcore✔
no-provider-version-constraintFlag a version argument inside a provider block; declare the version in terraform.required_providers instead.warncore✔
no-quoted-depends-onDisallow quoted references in depends_on; use bare references.warncore✔✔
no-quoted-ignore-changesDisallow quoted references in a lifecycle ignore_changes list; use bare attribute references.warncore✔✔
no-quoted-provider-referenceDisallow quoted provider references in provider arguments and module providers maps; use a bare traversal.warncore✔✔
no-quoted-type-constraintsDisallow quoted type constraints in variable blocks; use the unquoted type keyword.errorcore✔✔
no-reserved-variable-namesDisallow variable blocks named after an OpenTofu reserved meta-argument.errorcore✔
no-splat-bracket-indexFlag a constant index applied to a splat result, a pre-0.12 artifact; index the resource first instead.warncore✔
no-template-providerFlag use of the archived hashicorp/template provider; prefer the built-in templatefile() function or the cloudinit provider.errorcore✔
no-terraform-env-referenceFlag references to terraform.env, replaced by terraform.workspace since Terraform 0.10.errorcore✔✔
no-winrm-connectionFlag connection blocks with type = "winrm"; winrm is deprecated in OpenTofu 1.12 and slated for removal in 1.13. Use type = "ssh".warncore✔
prefer-bare-expressionPrefer the bare expression form over the redundant "${expr}" wrapping.warncore✔
provider-source-requiredRequire every provider in terraform.required_providers to declare an explicit source.errorcore✔
remote-state-outputs-prefixFlag a data.terraform_remote_state reference that omits the required .outputs. prefix, required since Terraform 0.12.errorcore✔✔
required-providers-pinnedRequire every provider in terraform.required_providers to declare a version constraint.errorcore✔
required-version-declaredRequire a terraform block that declares required_providers to also declare required_version somewhere in the same file.warncore✔
typed-variablesRequire every variable block to declare a type.errorcore✔

aws ​

RuleDescriptionSeverityCategoryRecommendedFixable
acm-certificate-create-before-destroy-requiredRequire lifecycle { create_before_destroy = true } on aws_acm_certificate so replacing an in-use certificate does not hang until timeout.warnaws✔
no-api-gateway-deployment-stage-argsFlag stage_name, stage_description, and canary_settings on aws_api_gateway_deployment, removed in AWS provider v6; manage the stage with a separate aws_api_gateway_stage resource.erroraws✔
no-aurora-pinned-minor-with-auto-upgradeFlag an Aurora PostgreSQL cluster that pins engine_version deeper than the auto minor upgrade enabled across its instances will hold stable, which drifts on every plan.warnaws✔
no-db-instance-name-attributeFlag the top-level name argument on aws_db_instance, removed in AWS provider v5. Use db_name with the same value.erroraws✔✔
no-deprecated-lambda-runtimeFlag AWS-deprecated Lambda runtime identifiers on aws_lambda_function and aws_lambda_layer_version and name the nearest supported successor.warnaws✔
no-eip-vpc-attributeFlag the vpc argument on aws_eip, removed in AWS provider v6. Use domain = "vpc" (or omit domain).erroraws✔✔
no-eks-addon-resolve-conflictsFlag the resolve_conflicts argument on aws_eks_addon, removed in AWS provider v6. Use resolve_conflicts_on_create and resolve_conflicts_on_update.erroraws✔
no-hardcoded-provider-credentialsFlag literal access_key, secret_key, or token values in provider "aws" and s3 backend blocks, which leak credentials into source control.erroraws✔
no-iam-policy-attachmentFlag aws_iam_policy_attachment, which manages a managed policy's attachments exclusively account-wide; prefer the non-exclusive per-principal attachment resources or the *_policy_attachments_exclusive resources.warnaws✔
no-iam-role-inline-policiesFlag deprecated inline inline_policy blocks and the managed_policy_arns argument on aws_iam_role; prefer standalone aws_iam_role_policy / aws_iam_role_policy_attachment resources.warnaws✔
no-instance-cpu-count-attributesFlag cpu_core_count and cpu_threads_per_core on aws_instance, removed in AWS provider v6; move the values into a cpu_options block.erroraws✔✔
no-legacy-security-group-rulesFlag legacy aws_security_group_rule resources and inline ingress/egress blocks; prefer aws_vpc_security_group_ingress_rule and aws_vpc_security_group_egress_rule.erroraws✔
no-mixed-security-group-rule-formsWarn when a standalone security group rule targets an aws_security_group that also defines inline ingress/egress blocks, which causes drift.warnaws✔
no-pinned-minor-with-auto-upgradeFlag AWS engine resources that pin engine_version deeper than an enabled auto_minor_version_upgrade will hold stable, which drifts on every plan.warnaws✔
no-s3-bucket-inline-configFlag deprecated inline configuration on aws_s3_bucket; use the dedicated standalone aws_s3_bucket_* resources instead.warnaws✔
no-s3-bucket-objectFlag the deprecated aws_s3_bucket_object resource and data source and the aws_s3_bucket_objects data source; use aws_s3_object and aws_s3_objects instead.warnaws✔

cloudflare ​

RuleDescriptionSeverityCategoryRecommendedFixable
access-rule-country-block-requires-enterpriseFlag a cloudflare_access_rule that blocks by country while settings.lintofu.cloudflare.plan is below Enterprise, the only plan Cloudflare allows it on.errorcloudflare✔
dns-record-requires-managed-by-annotationRequire a cloudflare_dns_record to carry the configured comment, plus the configured tag when settings.lintofu.cloudflare.plan is Pro or higher, so the record shows it is managed by Terraform.warncloudflare✔
ruleset-requires-managed-by-descriptionRequire a cloudflare_ruleset to set its top-level description to the configured marker, so the ruleset shows it is managed by Terraform.warncloudflare✔