Skip to content

fix(terraform-engineer): replace obsolete recommendations with current practices - #318

Open
uridium wants to merge 2 commits into
Jeffallan:mainfrom
uridium:fix/terraform-engineer-current-practices
Open

uridium wants to merge 2 commits into
Jeffallan:mainfrom
uridium:fix/terraform-engineer-current-practices

Conversation

@uridium

@uridium uridium commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

Replaces obsolete recommendations across the whole terraform-engineer skill: SKILL.md and all five reference files. Content follows HashiCorp's terraform-style-guide (including SECURITY.md) and terraform-test skills from hashicorp/agent-skills.

What changed

  • providers.md: current majors (aws 6, azurerm 5, google 8, kubernetes 3, helm 3); Helm 3 attribute syntax; exec-based EKS auth (no token in state); OIDC / Workload Identity Federation preferred over stored secrets.
  • state-management.md: use_lockfile replaces dynamodb_table (DynamoDB table removed); import / moved / removed blocks replace terraform import and state mv/rm; force-unlock and state push flagged as approval-only; invalid versioning backend argument removed; azurerm renames (https_traffic_only_enabled, storage_account_id).
  • best-practices.md: secrets via managed passwords / ephemeral + write-only attributes instead of a Secrets Manager data source; standalone aws_vpc_security_group_*_rule; AL2023 AMI; prevent_destroy as a literal (variables are not allowed there); terraform.tf layout.
  • testing.md: mock_provider unit tests, flat tests/ layout, -filter usage; Rego v1 policy; Trivy replaces tfsec; updated action, tflint-ruleset and pre-commit versions; Terratest example updated (AWS SDK v1 example removed).
  • module-patterns.md: terraform.tf, native tests, current module versions.
  • SKILL.md: trivy config instead of tfsec; azurerm ~> 5.0 (the previous commit pinned 4.x); secrets guidance.

Verification

  • Provider versions and deprecated attributes checked via terraform providers schema -json on Terraform 1.17.1.
  • All HCL snippets pass terraform fmt -check; the provider, state, module and best-practices snippets pass terraform validate against the real provider schemas.
  • The .tftest.hcl examples run and pass offline (terraform test, 3 passed).
  • Rego passes opa check and was exercised against a sample plan JSON.
  • Terratest go.mod and test compile and vet with Go 1.26.0 (required by terratest v1.0.1).
  • make validate: 0 errors (remaining warnings pre-date this PR).

Not verified

  • Action tags in the CI example and the tflint-aws / pre-commit versions come from the latest GitHub releases and were not executed.
  • Integration (apply) test and Terratest examples were not run, since they create real cloud resources.

🤖 Generated with Claude Code

uridium and others added 2 commits November 6, 2026 13:36
…t practices

- S3 backend example uses use_lockfile instead of deprecated dynamodb_table
- Drift recovery uses apply -refresh-only and moved/import/removed blocks
  instead of deprecated terraform refresh and state commands
- Bump example version pins (Terraform >= 1.14, aws ~> 6.0, azurerm ~> 4.0)
- Add terraform test, lock file, sensitive, for_each and file layout
  conventions aligned with hashicorp/agent-skills terraform-style-guide
- Require user approval for any state-writing recovery command

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…files

SKILL.md was updated in the previous commit; the five reference files still
taught obsolete or invalid patterns. Verified against provider schemas
(terraform providers schema -json) and Terraform 1.17.1.

- providers: aws ~> 6, azurerm ~> 5, google ~> 8, kubernetes/helm ~> 3;
  Helm 3 attribute syntax (kubernetes = {}, set = []); exec-based EKS auth;
  OIDC/WIF over stored secrets; explicit azurerm subscription_id
- state-management: use_lockfile instead of dynamodb_table (and drop the
  invalid `versioning` backend argument); import/moved/removed blocks instead
  of state CLI surgery; approval framing for force-unlock and state push;
  azurerm 4+ attribute renames
- best-practices: managed/ephemeral secrets instead of secret data sources;
  standalone aws_vpc_security_group_*_rule; Amazon Linux 2023 AMI; literal
  prevent_destroy; terraform.tf file layout matching SKILL.md
- testing: mock_provider unit tests, flat tests/ layout (nested dirs are not
  discovered), -filter usage, no -no-cleanup (experimental only); Rego v1
  policy that works on plan JSON; Trivy replaces tfsec; current action, tflint
  ruleset and pre-commit versions; Terratest go.mod (Go 1.26.0) with the
  AWS SDK v1 example removed
- module-patterns: terraform.tf, .tftest.hcl instead of Go test, module
  versions (vpc 6.x, eks 21.x)
- SKILL.md: trivy config instead of tfsec, azurerm ~> 5.0, secrets guidance

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants