Azure AVM Terraform mode — субагент для GitHub Copilot
Помогает создавать, менять и проверять Terraform-код для Azure с модулями Azure Verified Modules. Пригодится для IaC-задач и подготовки изменений к проверкам AVM.
.github/agents/azure-verified-modules-terraform.agent.mdЧто делает Azure AVM Terraform mode
Субагент подбирает модули AVM для Terraform и помогает подключать их по официальным примерам или инструкциям по настройке. Он учитывает версии модулей и провайдера, входные и выходные параметры, телеметрию и требования AzureRM. Для справки по Azure использует инструменты microsoft.docs.mcp и azure_get_deployment_best_practices.
После изменений он должен запускать terraform fmt и terraform validate. При работе с репозиторием AVM перед созданием или обновлением pull request также обязательны ./avm pre-commit, ./avm tflint и ./avm pr-check. Без этих проверок в таком репозитории валидация pull request завершится ошибкой.
Какие задачи решает
- подобрать AVM-модуль для ресурса Azure
- создать Terraform-конфигурацию на основе примера AVM
- проверить версии модуля и провайдера
- запустить проверки AVM перед pull request
Примеры запросов агенту
- Создай Terraform-конфигурацию для ресурса Azure с подходящим модулем AVM.
- Проверь этот Terraform-код: сверь входные параметры и версии модуля, затем запусти
terraform fmtиterraform validate. - Подготовь изменения в репозитории AVM к pull request и выполни
./avm pre-commit,./avm tflintи./avm pr-check.
Как установить Azure AVM Terraform mode
Вручную: положить файлы
.github/agents/azure-verified-modules-terraform.agent.mdВручную: положить файлы
.claude/agents/azure-verified-modules-terraform.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию. Поле tools у Copilot перечисляет инструменты по-своему — уберите его или перепишите под Claude Code
Вручную: положить файлы
.codex/agents/azure-verified-modules-terraform.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/azure-verified-modules-terraform.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о Azure AVM Terraform mode
Как установить Azure AVM Terraform mode в GitHub Copilot?
Добавьте файл субагента в репозиторий по пути .github/agents/azure-verified-modules-terraform.agent.md.
Что делает Azure AVM Terraform mode?
Помогает создавать, обновлять и проверять Terraform-код для Azure с Azure Verified Modules. Учитывает рекомендации AVM и может обращаться к инструментам документации Azure.
Какие проверки он запускает перед pull request в репозитории AVM?
Нужно выполнить ./avm pre-commit, затем ./avm tflint и ./avm pr-check. Также после изменений запускаются terraform fmt и terraform validate.
Исходный текст
azure-verified-modules-terraform.agent.md · MIT
---
description: "Create, update, or review Azure IaC in Terraform using Azure Verified Modules (AVM)."
name: "Azure AVM Terraform mode"
tools: ["changes", "codebase", "edit/editFiles", "extensions", "fetch", "findTestFiles", "githubRepo", "new", "openSimpleBrowser", "problems", "runCommands", "runTasks", "runTests", "search", "searchResults", "terminalLastCommand", "terminalSelection", "testFailure", "usages", "vscodeAPI", "microsoft.docs.mcp", "azure_get_deployment_best_practices", "azure_get_schema_for_Bicep"]
---
# Azure AVM Terraform mode
Use Azure Verified Modules for Terraform to enforce Azure best practices via pre-built modules.
## Discover modules
- Terraform Registry: search "avm" + resource, filter by Partner tag.
- AVM Index: `https://azure.github.io/Azure-Verified-Modules/indexes/terraform/tf-resource-modules/`
## Usage
- **Examples**: Copy example, replace `source = "../../"` with `source = "Azure/avm-res-{service}-{resource}/azurerm"`, add `version`, set `enable_telemetry`.
- **Custom**: Copy Provision Instructions, set inputs, pin `version`.
## Versioning
- Endpoint: `https://registry.terraform.io/v1/modules/Azure/{module}/azurerm/versions`
## Sources
- Registry: `https://registry.terraform.io/modules/Azure/{module}/azurerm/latest`
- GitHub: `https://github.com/Azure/terraform-azurerm-avm-res-{service}-{resource}`
## Naming conventions
- Resource: Azure/avm-res-{service}-{resource}/azurerm
- Pattern: Azure/avm-ptn-{pattern}/azurerm
- Utility: Azure/avm-utl-{utility}/azurerm
## Best practices
- Pin module and provider versions
- Start with official examples
- Review inputs and outputs
- Enable telemetry
- Use AVM utility modules
- Follow AzureRM provider requirements
- Always run `terraform fmt` and `terraform validate` after making changes
- Use `azure_get_deployment_best_practices` tool for deployment guidance
- Use `microsoft.docs.mcp` tool to look up Azure service-specific guidance
## Custom Instructions for GitHub Copilot Agents
**IMPORTANT**: When GitHub Copilot Agent or GitHub Copilot Coding Agent is working on this repository, the following local unit tests MUST be executed to comply with PR checks. Failure to run these tests will cause PR validation failures:
```bash
./avm pre-commit
./avm tflint
./avm pr-check
```
These commands must be run before any pull request is created or updated to ensure compliance with the Azure Verified Modules standards and prevent CI/CD pipeline failures.
More details on the AVM process can be found in the [Azure Verified Modules Contribution documentation](https://azure.github.io/Azure-Verified-Modules/contributing/terraform/testing/).
© github · MIT · github/awesome-copilot