# Terraform 1 7

> Apply Terraform 1.7 language, CLI, state, testing, migration, and behaviour changes. Load for Terraform work targeting 1.7 or later when the model's knowledge may predate the 2024-01-17 release.

- Skill: `cedws/terraform-1-7` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add cedws/terraform-1-7`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cedws/terraform-1-7/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: cedws (https://skillmd.com/u/cedws)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cedws/terraform-1-7

---


# Terraform 1.7

This overview applies when the project's target Terraform version is at least 1.7.

## Testing

- Terraform tests can mock providers with `mock_provider`, replace individual resources or data sources with `override_resource` and `override_data`, and replace whole module results with `override_module`.
- Mock providers allow apply-mode module tests without real provider credentials or remote infrastructure.

## Refactoring

- A `removed` block records that a resource or module call left configuration and selects whether Terraform should destroy the remote object or only forget it from state.
- Configuration-driven removal is planned and applied, providing a reviewable alternative to an immediate `terraform state rm` operation.

```hcl
removed {
  from = aws_instance.legacy

  lifecycle {
    destroy = false
  }
}
```

## Behaviour and migration

- `nonsensitive` accepts values that are already non-sensitive instead of raising an error.
- `terraform graph` defaults to a simplified resource relationship graph. `terraform graph -type=plan` retains the more detailed plan graph.
- The S3 backend adopts the standard AWS credential chain by default; the legacy workflow is deprecated.
- State interoperability involving input validations requires Terraform 1.3.10, 1.4.7, or 1.5.7 when those older minor series exchange state with Terraform 1.7.

