terraform-state

Manage Terraform state files across local and remote backends.

1|Updated Jun 18, 2025
One-click install
npx skills add https://github.com/knopki/dotfiles --skill terraform-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-state
Source: https://github.com/knopki/dotfiles/tree/main/home/private_dot_config/opencode/skills/terraform-state
Command: npx skills add https://github.com/knopki/dotfiles --skill terraform-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you manage Terraform state files, ensuring consistency and preventing conflicts when coordinating infrastructure changes across teams.

Core Features & Use Cases

  • State Management: Track and manipulate Terraform state for local and remote backends.
  • Remote State Configuration: Set up secure remote state storage with locking for collaboration.
  • Resource Import & Migration: Import existing infrastructure into Terraform state or move resources between states.
  • Use Case: When working on a shared infrastructure project, use this Skill to configure a remote backend with state locking to prevent accidental overwrites and ensure all team members are working with the latest state.

Quick Start

Use the terraform-state skill to list all resources currently managed in the Terraform state.

Frequently Asked Questions about terraform-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a remote backend for Terraform state to prevent concurrent overwrites?

To configure a remote Terraform state backend, set up storage like S3, Azure Blob Storage, or Terraform Cloud with state locking enabled. This prevents accidental overwrites and ensures team members collaborate using the latest state.

What is state locking in Terraform and when do I need it for infrastructure as code workflows?

State locking in Terraform is a mechanism that prevents multiple users from modifying the same state file simultaneously. You need it for shared infrastructure as code workflows to ensure consistency and avoid conflicts during cloud resource changes.

How do I import existing cloud infrastructure into Terraform state?

Importing existing infrastructure into Terraform state involves mapping currently provisioned cloud resources into your state file. This brings unmanaged resources under infrastructure as code management without recreating them.

Can I move resources between different Terraform state files?

Yes, you can move resources between different Terraform state files. This resource manipulation allows you to reorganize infrastructure as code configurations by transferring resource tracking safely across states.

Does Terraform state management work with both local and remote backends?

Yes, Terraform state management works with both local and remote backends. You can track and manipulate state files locally for individual testing or configure remote backends like S3 and Azure Blob Storage for team collaboration.

What do I need to understand before managing Terraform state files?

Before managing Terraform state files, you need to understand Terraform's state management concepts and backend configurations. This prerequisite knowledge is essential for securely applying infrastructure as code workflows in cloud environments.