terraform-state-manager

Manage Terraform state files across AWS S3, Azure Blob Storage, and Google Cloud Storage.

19|5|Updated Nov 23, 2025
One-click install
npx skills add https://github.com/Nir-Bhay/markups --skill terraform-state-manager-nir-bhay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-state-manager
Source: https://github.com/Nir-Bhay/markups/tree/main/.agents/skills/terraform-state-manager
Command: npx skills add https://github.com/Nir-Bhay/markups --skill terraform-state-manager-nir-bhay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and commands for managing Terraform state files, ensuring data integrity, security, and efficient collaboration in infrastructure as code workflows.

Core Features & Use Cases

  • Remote Backend Configuration: Set up secure and collaborative state storage using AWS S3, Azure Blob Storage, or Google Cloud Storage.
  • State Operations: Perform essential tasks like listing, showing, moving, importing, and removing resources from the state.
  • Workspace Management: Effectively manage different environments (dev, staging, prod) using Terraform workspaces.
  • Recovery & Migration: Recover from state corruption or deletion and migrate state between backends.
  • Drift Detection: Identify and address discrepancies between your Terraform state and actual infrastructure.
  • Use Case: Securely configure an S3 backend with DynamoDB for state locking, manage multiple environments using workspaces, and recover a corrupted state file using versioning.

Quick Start

Use the terraform-state-manager skill to list all resources in the current Terraform state.

Frequently Asked Questions about terraform-state-manager

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

FAQPage Schema
How do I configure a remote backend for Terraform state using AWS S3?

Configure Terraform remote backend state storage by setting up an AWS S3 bucket with encryption and a DynamoDB table for state locking. This ensures secure, collaborative infrastructure as code workflows without local state file conflicts.

What is the best way to detect and resolve Terraform state drift?

Terraform state drift detection identifies discrepancies between your configured state and actual cloud infrastructure. You can resolve drift by importing existing resources, refactoring configurations, or manually updating the state file to match reality.

Can I manage multiple environments like dev and prod using Terraform workspaces?

Yes, Terraform workspace management allows you to isolate and effectively manage multiple environments like dev, staging, and prod within a single configuration. This prevents state file collisions and maintains environment-specific infrastructure isolation.

How do I recover a corrupted or deleted Terraform state file?

Recover corrupted or deleted Terraform state files by utilizing versioning features in your remote backend, such as AWS S3 or Azure Blob Storage. You can restore previous state versions and execute state migration procedures to resume operations.

Does this Terraform state manager support Azure Blob Storage and Google Cloud Storage backends?

Yes, Terraform state management supports remote backend configuration across AWS S3, Azure Blob Storage, and Google Cloud Storage. Each platform provides native encryption and state locking mechanisms to secure your infrastructure as code deployments.

How do I import existing infrastructure into a Terraform state file?

Import existing infrastructure into Terraform state by executing specific state operations to map real-world cloud resources to your configuration. This allows you to adopt infrastructure as code practices without recreating currently running resources.