/tsh-stack-azure:implementing-azure-terraformfrom TSH Stack: Azure
Provides Azure-specific Terraform patterns and Well-Architected defaults for VNet, AKS, PostgreSQL, MySQL, Blob Storage, Application Gateway, Key Vault, ACR, and Service Bus. Use when provisioning or reviewing Azure infrastructure code.
Ships in TSH Stack: Azure. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Azure resource patterns and the defaults TSH provisions them with. Module structure — file layout, variable validation, state, testing, Terragrunt — is generic and is not repeated here; this skill is what goes inside Azure modules.
The project's existing modules outrank these patterns. Read versions.tf and
.terraform.lock.hcl for the pinned provider version first, and search with that
version — azurerm 4.x renamed and restructured a large number of resource arguments,
so a 3.x snippet frequently fails to plan.
Verify current VM sizes, AKS versions and regional availability with context7 before
naming a specific size. Azure regional availability varies more than the other major
providers, and a size unavailable in the customer's region is a wasted recommendation.
| Severity | Rule |
|---|---|
| MUST | Run terraform plan and read the output before proposing any change. |
| MUST | Use Managed Identity for service-to-service authentication. A service principal with a password is a long-lived credential and needs an explicit recorded reason. |
| MUST | Enable diagnostic settings on every resource that emits logs, routed to Log Analytics — and set retention, because ingestion is the cost driver. |
| MUST | Enable soft delete and purge protection on Key Vault. Without purge protection a deleted vault and its keys are unrecoverable, which breaks CMEK-encrypted data permanently. |
| MUST | Prefer private endpoints over public access for PaaS data services. |
| MUST | Apply the project's mandatory tags to every taggable resource. Azure does not inherit tags from a resource group — see the tagging note below. |
| MUST | Include a cost estimate. Fixed hourly costs — Application Gateway, NAT Gateway, VPN Gateway, Bastion — and premium disk tiers are the usual surprises. |
| NEVER | Run apply, destroy or -auto-approve without explicit authorization for that specific action. Deliver apply instructions instead. |
| NEVER | Open an NSG rule to Internet or * on an administrative port — 22, 3389, or a database port. |
| Reference | Load when | Covers |
|---|---|---|
| Module patterns | Provisioning any of these resource families | VNet, AKS, Flexible Server, Blob Storage, Application Gateway, Key Vault, ACR, Service Bus |
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.0"
}
}
}
provider "azurerm" {
features {}
}
The features {} block is mandatory and easy to forget — omitting it fails at
initialization with an error that does not say so plainly. Confirm the current major
with context7 for a greenfield project; match the project's existing pin otherwise.
This is the Azure-specific trap worth knowing before you write a module: tags applied to a resource group do not flow to the resources inside it. Every resource must be tagged individually, and a handful of resource types accept no tags at all.
Consequences for module design:
tags map as a variable and apply it to every taggable resource, merged with
any module-specific tags.Apply these unless the project documents a reason not to:
CanNotDelete) on production data resources and their vaults.azurerm_subscription_policy_assignment, azurerm_resource_group_policy_assignment,
azurerm_management_group_policy_assignment (the single azurerm_policy_assignment
was removed in azurerm 3.0).context7 for the pinned azurerm version, paying
attention to 3.x-to-4.x argument renames.terraform fmt -check, terraform validate,
terraform plan -out=tfplan, then tflint and tfsec or checkov where present.| Don't | Do |
|---|---|
| Service principal with a password | Managed Identity |
| AAD pod identity | Workload Identity — pod identity is deprecated |
| Tag the resource group and assume inheritance | Tag every resource; enforce with Policy |
| Public access on a PaaS data service | Private endpoint plus private DNS zone |
| Key Vault without purge protection | Soft delete and purge protection |
| GRS redundancy by default | LRS or ZRS unless cross-region durability is required |
| Premium SSD for general workloads | Standard SSD, or Premium SSD v2 where IOPS are needed |
| Oversized disk tier for a small disk | Right-size the tier — disks bill by provisioned tier, not by bytes used |
| Basic public IP | Standard — Basic is retiring |
| App Service Plan left running with no apps | Delete the plan; stopping the app does not stop the bill |
| Log Analytics with no retention or exclusions | Explicit retention, and exclusions at ingestion |
| Cosmos DB provisioned at peak RU/s | Autoscale, or serverless for spiky workloads |
Generic Terraform mechanics — module file layout, variable validation, state backends,
Terragrunt, Terratest — live in implementing-terraform-modules in the
tsh-platform-engineering plugin. Auditing an existing subscription for cost and tag
compliance is auditing Azure cost in this plugin.
What SKILL.md sets; muted values are Claude Code's defaults
Trigger on: writing or reviewing Terraform for Azure resources, `provider "azurerm"` in a project, designing a VNet and subnet layout with NSGs, standing up AKS with node pools and workload identity, Azure Database for PostgreSQL or MySQL Flexible Server, storage accounts and redundancy choice, Application Gateway or WAF policies, Key Vault with private endpoints, Azure Container Registry, Service Bus queues and topics, resource group layout, or choosing the azurerm provider version constraint.
npx claudepluginhub thesoftwarehouse/agentic-collections --plugin tsh-stack-azure2 skills in this plugin
Other plugins' skills for the same job