home / skills / jeremylongshore / claude-code-plugins-plus-skills / terraform-state-manager

terraform-state-manager skill

/skills/02-devops-advanced/terraform-state-manager

This skill helps automate terraform state manager tasks with step-by-step guidance, production-ready configurations, and best-practice validation.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill terraform-state-manager

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: "terraform-state-manager"
description: |
  Manage terraform state manager operations. Auto-activating skill for DevOps Advanced.
  Triggers on: terraform state manager, terraform state manager
  Part of the DevOps Advanced skill category. Use when working with terraform state manager functionality. Trigger with phrases like "terraform state manager", "terraform manager", "terraform".
allowed-tools: "Read, Write, Edit, Bash(cmd:*), Grep"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# Terraform State Manager

## Overview

This skill provides automated assistance for terraform state manager tasks within the DevOps Advanced domain.

## When to Use

This skill activates automatically when you:
- Mention "terraform state manager" in your request
- Ask about terraform state manager patterns or best practices
- Need help with advanced devops skills covering kubernetes, terraform, advanced ci/cd, monitoring, and infrastructure as code.

## Instructions

1. Provides step-by-step guidance for terraform state manager
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with terraform state manager"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of devops advanced concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **DevOps Advanced** skill category.
Tags: kubernetes, terraform, helm, monitoring, iac

Overview

This skill automates Terraform state manager operations and guidance for advanced DevOps workflows. It helps generate production-ready configurations, enforce best practices, and validate state-related operations. Use it to reduce state drift, manage remote backends, and handle state migrations safely.

How this skill works

The skill inspects your Terraform configuration, backend settings, and current state to recommend actions and generate code snippets. It provides step-by-step commands for common tasks such as initializing backends, migrating state, locking, and recovering corrupted state. Outputs include validated configuration fragments, recommended commands, and checks against common misconfigurations.

When to use it

  • When you need to configure or migrate Terraform remote state backends
  • When resolving state drift, locking issues, or state corruption
  • During CI/CD pipeline design to integrate Terraform state operations
  • When auditing state access, permissions, or encryption settings
  • When automating state snapshots, backups, or recovery procedures

Best practices

  • Use a remote backend (e.g., S3, GCS, Azure Blob) with state locking enabled to prevent concurrent writes
  • Keep state minimal by using modules and avoiding sensitive data in plaintext
  • Automate state backups and periodic validation checks in CI pipelines
  • Restrict access with least-privilege IAM roles and enforce encryption at rest and in transit
  • Document state migration steps and test migrations in a staging environment before production

Example use cases

  • Generate Terraform backend configuration for S3 with DynamoDB locking and encryption enabled
  • Create step-by-step migration plan and commands to move local state to a remote backend
  • Produce CI pipeline snippets that run terraform init, plan, apply with safe state locking and automated backups
  • Diagnose and provide remediation steps for a corrupted state file or failed apply due to lock contention
  • Recommend IAM permissions and policies for teams that need read-only or apply access to state

FAQ

Can this skill modify my live Terraform state automatically?

It generates commands and validated configuration but does not run changes automatically; you review and execute recommended commands in your environment.

What backends does it support recommendations for?

It provides patterns for common backends such as AWS S3 (with DynamoDB locks), Google Cloud Storage, and Azure Blob Storage, and can adapt guidance to other supported backends on request.