Provider configuration, versioning, and multi-provider patterns
Manages Terraform provider configurations, version constraints, and multi-provider setups for single and multi-cloud deployments. Use when creating or modifying provider blocks, handling version constraints, or configuring aliased providers for multi-region and multi-account scenarios.
/plugin marketplace add pluginagentmarketplace/custom-plugin-terraform/plugin install terraform-assistant@pluginagentmarketplace-terraformThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonassets/versions.tfreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyConfigure and manage Terraform providers for single and multi-cloud deployments.
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.80"
}
google = {
source = "hashicorp/google"
version = "~> 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.24"
}
}
}
version = "5.0.0" # Exact version
version = ">= 5.0" # Minimum version
version = "~> 5.0" # >= 5.0.0, < 6.0.0
version = ">= 5.0, < 6.0" # Explicit range
version = "!= 5.1.0" # Exclude version
provider "aws" {
region = var.aws_region
default_tags {
tags = {
Environment = var.environment
ManagedBy = "Terraform"
}
}
assume_role {
role_arn = var.assume_role_arn
session_name = "TerraformSession"
}
}
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = true
}
key_vault {
purge_soft_delete_on_destroy = false
}
}
subscription_id = var.subscription_id
tenant_id = var.tenant_id
}
provider "google" {
project = var.project_id
region = var.region
}
provider "google-beta" {
project = var.project_id
region = var.region
}
provider "aws" {
alias = "us_east_1"
region = "us-east-1"
}
provider "aws" {
alias = "us_west_2"
region = "us-west-2"
}
resource "aws_s3_bucket" "primary" {
provider = aws.us_east_1
bucket = "${var.project}-primary"
}
resource "aws_s3_bucket" "replica" {
provider = aws.us_west_2
bucket = "${var.project}-replica"
}
provider "aws" {
alias = "prod"
region = "us-east-1"
assume_role {
role_arn = "arn:aws:iam::PROD_ACCOUNT:role/TerraformRole"
}
}
provider "aws" {
alias = "dev"
region = "us-east-1"
assume_role {
role_arn = "arn:aws:iam::DEV_ACCOUNT:role/TerraformRole"
}
}
# Root module
provider "aws" {
alias = "west"
region = "us-west-2"
}
module "vpc" {
source = "./modules/vpc"
providers = {
aws = aws.west
}
cidr_block = "10.0.0.0/16"
}
# .terraform.lock.hcl (auto-generated)
provider "registry.terraform.io/hashicorp/aws" {
version = "5.31.0"
constraints = "~> 5.0"
hashes = [
"h1:xyz...",
"zh:abc...",
]
}
# Update lock file
terraform init -upgrade
# Platform-specific locks
terraform providers lock \
-platform=linux_amd64 \
-platform=darwin_amd64 \
-platform=darwin_arm64
| Error | Cause | Solution |
|---|---|---|
Provider not found | Not in required_providers | Add provider block |
Version constraint | Incompatible version | Update constraint |
Configuration missing | No provider block | Add configuration |
Alias not found | Wrong alias reference | Check alias name |
# Show providers
terraform providers
# Show provider versions
terraform version
# Initialize providers
terraform init -upgrade
Skill("terraform-providers")
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.