Skip to content
Back to skills

2654 04 Preflight Check 22be87df

ASecurity

![Step](https://img.shields.io/badge/Step-4b-blue?style=for-the-badge) ![Status](https://img.shields.io/badge/Status-Pass-green?style=for-the-badge) ![Agent](https://img.shields.io/badge/Agent-Terraform%20Code-purple?style=for-the-badge) <details open> <summary><strong>πŸ“‘ Pre-Flight Contents</strong></summary> - [🎯 Purpose](#-purpose) - [βœ… AVM Schema Validation Results](#-avm-schema-validation-results) - [οΏ½ Provider Version Resolution](#-provider-version-resolution) - [πŸ”Ž Parameter Type Anal...

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentgosqlazureterraformdatabasebackend

Works with

  • mcp

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2654-04-preflight-check_22be87df --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2654 04 Preflight Check 22be87df?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2654 04 Preflight Check 22be87df
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2654-04-preflight-check-22be87df/badge)](https://www.skillsdirectory.com/skills/tools-only-2654-04-preflight-check-22be87df)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# βœ… Step 4b: Pre-Flight AVM-TF Check - terraform-e2e

![Step](https://img.shields.io/badge/Step-4b-blue?style=for-the-badge)
![Status](https://img.shields.io/badge/Status-Pass-green?style=for-the-badge)
![Agent](https://img.shields.io/badge/Agent-Terraform%20Code-purple?style=for-the-badge)

<details open>
<summary><strong>πŸ“‘ Pre-Flight Contents</strong></summary>

- [🎯 Purpose](#-purpose)
- [βœ… AVM Schema Validation Results](#-avm-schema-validation-results)
- [οΏ½ Provider Version Resolution](#-provider-version-resolution)
- [πŸ”Ž Parameter Type Analysis](#-parameter-type-analysis)
- [πŸ“‹ Variable Schema Cross-Validation](#-variable-schema-cross-validation)
- [🌍 Region Limitations Identified](#-region-limitations-identified)
- [⚠️ Pitfalls Checklist](#-pitfalls-checklist)
- [πŸš€ Ready for Implementation](#-ready-for-implementation)

</details>

> Generated by terraform-code agent | 2026-02-26
> Source: Terraform Registry MCP (`search_modules` β†’ `get_module_details` β†’ `get_latest_module_version`)
> Status: **PASS**

| ⬅️ Previous                                            | πŸ“‘ Index            | Next ➑️                                                          |
| ------------------------------------------------------ | ------------------- | ---------------------------------------------------------------- |
| [04-implementation-plan.md](04-implementation-plan.md) | [README](README.md) | [05-implementation-reference.md](05-implementation-reference.md) |

## 🎯 Purpose

> [!IMPORTANT]
> This checkpoint validates AVM-TF module schemas BEFORE Terraform code generation
> by querying the Terraform Registry for latest versions and variable schemas.

Prevents:

- Variable type mismatches (e.g., `parent_id` vs `resource_group_name`)
- Deprecated variable usage
- Region availability issues
- Missing required variables
- Version constraint drift

## βœ… AVM Schema Validation Results

```mermaid
%%{init: {'theme':'neutral'}}%%
flowchart LR
    A["Discover AVM-TF\nModules"] --> B["Validate\nSchema"]
    B --> C["Check\nVariables"]
    C --> D["Verify\nRegions"]
    D --> E{"Pass?"}
    E -- Yes --> F["βœ… Ready"]
    E -- No --> G["❌ Blocked"]
    style F fill:#107C10,color:#fff
    style G fill:#D83B01,color:#fff
```

| Resource              | AVM-TF Module                                         | Pinned    | Latest   | Match | Verified | Published  |
| --------------------- | ----------------------------------------------------- | --------- | -------- | ----- | -------- | ---------- |
| Log Analytics         | `Azure/avm-res-operationalinsights-workspace/azurerm` | `~> 0.5`  | `0.5.1`  | βœ…    | βœ…       | 2025-12-23 |
| Application Insights  | `Azure/avm-res-insights-component/azurerm`            | `~> 0.3`  | `0.3.0`  | βœ…    | βœ…       | 2026-02-19 |
| Key Vault             | `Azure/avm-res-keyvault-vault/azurerm`                | `~> 0.10` | `0.10.2` | βœ…    | βœ…       | 2025-10-14 |
| SQL Server + Database | `Azure/avm-res-sql-server/azurerm`                    | `~> 0.1`  | `0.1.6`  | βœ…    | βœ…       | 2025-10-06 |
| App Service Plan      | `Azure/avm-res-web-serverfarm/azurerm`                | `~> 2.0`  | `2.0.2`  | βœ…    | βœ…       | 2026-02-20 |
| App Service (BE+FE)   | `Azure/avm-res-web-site/azurerm`                      | `~> 0.21` | `0.21.0` | βœ…    | βœ…       | 2026-02-19 |

> **Version Match**: All `~>` pessimistic version constraints resolve to latest available versions within their bands.

### Download Counts (Module Adoption)

| Module                                | Downloads |
| ------------------------------------- | --------: |
| avm-res-keyvault-vault                | 1,879,954 |
| avm-res-operationalinsights-workspace |   577,656 |
| avm-res-web-site                      |   329,353 |
| avm-res-insights-component            |   222,142 |
| avm-res-web-serverfarm                |   209,042 |
| avm-res-sql-server                    |   174,107 |

## πŸ”— Provider Version Resolution

| Provider            | Pinned   | Latest   | Match | Source   |
| ------------------- | -------- | -------- | ----- | -------- |
| `hashicorp/azurerm` | `~> 4.0` | `4.61.0` | βœ…    | Registry |
| `hashicorp/random`  | `~> 3.0` | `3.8.1`  | βœ…    | Registry |

## πŸ”Ž Parameter Type Analysis

### Required Variables per Module (Registry-Sourced)

<details open>
<summary><strong>Log Analytics (avm-res-operationalinsights-workspace v0.5.1)</strong></summary>

| Variable              | Type     | Required | In Code | Status |
| --------------------- | -------- | -------- | ------- | ------ |
| `name`                | `string` | βœ…       | βœ…      | βœ…     |
| `resource_group_name` | `string` | βœ…       | βœ…      | βœ…     |
| `location`            | `string` | βœ…       | βœ…      | βœ…     |

Optional variables used:

| Variable                                    | Type          | Default | In Code | Status |
| ------------------------------------------- | ------------- | ------- | ------- | ------ |
| `log_analytics_workspace_retention_in_days` | `number`      | `null`  | `30`    | βœ…     |
| `tags`                                      | `map(string)` | `null`  | βœ…      | βœ…     |

</details>

<details open>
<summary><strong>Application Insights (avm-res-insights-component v0.3.0)</strong></summary>

| Variable              | Type     | Required | In Code | Status |
| --------------------- | -------- | -------- | ------- | ------ |
| `name`                | `string` | βœ…       | βœ…      | βœ…     |
| `resource_group_name` | `string` | βœ…       | βœ…      | βœ…     |
| `location`            | `string` | βœ…       | βœ…      | βœ…     |
| `workspace_id`        | `string` | βœ…       | βœ…      | βœ…     |

> **⚠️ Pitfall Avoided**: Variable is `workspace_id` β€” NOT `workspace_resource_id`.

Optional variables used:

| Variable           | Type          | Default | In Code | Status |
| ------------------ | ------------- | ------- | ------- | ------ |
| `application_type` | `string`      | `"web"` | `"web"` | βœ…     |
| `tags`             | `map(string)` | `null`  | βœ…      | βœ…     |

</details>

<details open>
<summary><strong>Key Vault (avm-res-keyvault-vault v0.10.2)</strong></summary>

| Variable              | Type     | Required | In Code | Status |
| --------------------- | -------- | -------- | ------- | ------ |
| `name`                | `string` | βœ…       | βœ…      | βœ…     |
| `resource_group_name` | `string` | βœ…       | βœ…      | βœ…     |
| `location`            | `string` | βœ…       | βœ…      | βœ…     |
| `tenant_id`           | `string` | βœ…       | βœ…      | βœ…     |

> **⚠️ Pitfall Avoided**: No `enable_rbac_authorization` variable exists.
> RBAC is the default when `legacy_access_policies_enabled = false` (module default).

Optional variables used:

| Variable                     | Type          | Default     | In Code      | Status |
| ---------------------------- | ------------- | ----------- | ------------ | ------ |
| `purge_protection_enabled`   | `bool`        | `true`      | `true`       | βœ…     |
| `soft_delete_retention_days` | `number`      | (7–90)      | `90`         | βœ…     |
| `sku_name`                   | `string`      | `"premium"` | `"standard"` | βœ…     |
| `tags`                       | `map(string)` | `null`      | βœ…           | βœ…     |

> **⚠️ Pitfall Avoided**: Variable is `soft_delete_retention_days` β€” NOT `soft_delete_retention_in_days`.

</details>

<details open>
<summary><strong>SQL Server (avm-res-sql-server v0.1.6)</strong></summary>

| Variable              | Type     | Required | In Code  | Status |
| --------------------- | -------- | -------- | -------- | ------ |
| `resource_group_name` | `string` | βœ…       | βœ…       | βœ…     |
| `location`            | `string` | βœ…       | βœ…       | βœ…     |
| `server_version`      | `string` | βœ…       | `"12.0"` | βœ…     |

> **⚠️ Pitfall Avoided**: `minimum_tls_version` is hardcoded to `"1.2"` in the AVM module β€” NOT a variable.

Optional variables used:

| Variable                | Type                 | Default | In Code               | Status |
| ----------------------- | -------------------- | ------- | --------------------- | ------ |
| `administrator_login`   | `string`             | `null`  | `null` (AD-only auth) | βœ…     |
| `azuread_administrator` | `object({...})`      | `null`  | βœ… (3 fields)         | βœ…     |
| `databases`             | `map(object({...}))` | `{}`    | βœ… (1 database)       | βœ…     |
| `tags`                  | `map(string)`        | `null`  | βœ…                    | βœ…     |

</details>

<details open>
<summary><strong>App Service Plan (avm-res-web-serverfarm v2.0.2)</strong></summary>

| Variable    | Type     | Required | In Code                          | Status |
| ----------- | -------- | -------- | -------------------------------- | ------ |
| `name`      | `string` | βœ…       | βœ…                               | βœ…     |
| `parent_id` | `string` | βœ…       | `azurerm_resource_group.this.id` | βœ…     |
| `location`  | `string` | βœ…       | βœ…                               | βœ…     |
| `os_type`   | `string` | βœ…       | `"Linux"`                        | βœ…     |

> **⚠️ Pitfall Avoided**: Uses `parent_id` (resource group ID) β€” NOT `resource_group_name`.

Optional variables used:

| Variable   | Type          | Default  | In Code | Status |
| ---------- | ------------- | -------- | ------- | ------ |
| `sku_name` | `string`      | `"P1v2"` | `"B1"`  | βœ…     |
| `tags`     | `map(string)` | `null`   | βœ…      | βœ…     |

</details>

<details open>
<summary><strong>App Service β€” BE + FE (avm-res-web-site v0.21.0)</strong></summary>

| Variable                   | Type     | Required | In Code                          | Status |
| -------------------------- | -------- | -------- | -------------------------------- | ------ |
| `name`                     | `string` | βœ…       | βœ…                               | βœ…     |
| `parent_id`                | `string` | βœ…       | `azurerm_resource_group.this.id` | βœ…     |
| `location`                 | `string` | βœ…       | βœ…                               | βœ…     |
| `service_plan_resource_id` | `string` | βœ…       | `module.app_service_plan[0]...`  | βœ…     |

> **⚠️ Pitfall Avoided**: Uses `parent_id` (resource group ID) β€” NOT `resource_group_name`.

Optional variables used:

| Variable                                 | Type          | Default   | In Code                  | Status |
| ---------------------------------------- | ------------- | --------- | ------------------------ | ------ |
| `kind`                                   | `string`      | (varies)  | `"webapp"`               | βœ…     |
| `os_type`                                | `string`      | `"Linux"` | `"Linux"`                | βœ…     |
| `https_only`                             | `bool`        | `true`    | `true`                   | βœ…     |
| `managed_identities`                     | `object({})`  | β€”         | `system_assigned = true` | βœ…     |
| `application_insights_connection_string` | `string`      | `null`    | βœ…                       | βœ…     |
| `app_settings`                           | `map(string)` | `{}`      | βœ… (BE only)             | βœ…     |
| `tags`                                   | `map(string)` | `null`    | βœ…                       | βœ…     |

</details>

## πŸ“‹ Variable Schema Cross-Validation

Cross-validation of every variable used in `main.tf` against registry-sourced module schemas:

| Module           | Variables Set | Required Satisfied | Optional Valid | Unsupported Args | Result |
| ---------------- | :-----------: | :----------------: | :------------: | :--------------: | ------ |
| log_analytics    |       5       |        3/3         |      2/2       |        0         | βœ…     |
| app_insights     |       5       |        4/4         |   1/1 + tags   |        0         | βœ…     |
| key_vault        |       7       |        4/4         |   3/3 + tags   |        0         | βœ…     |
| sql_server       |       7       |        3/3         |   4/4 + tags   |        0         | βœ…     |
| app_service_plan |       5       |        4/4         |   1/1 + tags   |        0         | βœ…     |
| app_service (BE) |       9       |        4/4         |   5/5 + tags   |        0         | βœ…     |
| app_service_fe   |       7       |        4/4         |   3/3 + tags   |        0         | βœ…     |

### Local Validation

| Check                | Result | Command                             |
| -------------------- | ------ | ----------------------------------- |
| `terraform fmt`      | βœ…     | `terraform fmt -check -recursive .` |
| `terraform init`     | βœ…     | `terraform init -backend=false`     |
| `terraform validate` | βœ…     | `terraform validate`                |

## 🌍 Region Limitations Identified

| Resource             | Default Region | Limitation | Action    |
| -------------------- | -------------- | ---------- | --------- |
| Log Analytics        | swedencentral  | None       | No action |
| Application Insights | swedencentral  | None       | No action |
| Key Vault            | swedencentral  | None       | No action |
| SQL Server           | swedencentral  | None       | No action |
| App Service Plan     | swedencentral  | None       | No action |
| App Service          | swedencentral  | None       | No action |

> All resources are available in `swedencentral`. No region overrides required.

## ⚠️ Pitfalls Checklist

Based on AVM Known Pitfalls (terraform-patterns skill) and registry schema validation:

- [x] App Service Plan uses `parent_id` (resource group ID) β€” not `resource_group_name`
- [x] App Service uses `parent_id` (resource group ID) β€” not `resource_group_name`
- [x] App Insights uses `workspace_id` β€” not `workspace_resource_id`
- [x] Key Vault does NOT have `enable_rbac_authorization` β€” RBAC enabled via `legacy_access_policies_enabled = false` (default)
- [x] Key Vault uses `soft_delete_retention_days` β€” not `soft_delete_retention_in_days`
- [x] SQL Server requires `server_version = "12.0"` β€” `minimum_tls_version` is hardcoded in module
- [x] App Service uses `application_insights_connection_string` (not deprecated instrumentation key)
- [x] No Storage Account names contain hyphens
- [x] All `~>` version pins resolve to published versions within their constraint bands
- [x] `azurerm` provider pinned `~> 4.0` β€” latest `4.61.0` compatible

## πŸš€ Ready for Implementation

| Check                        | Status | Notes                                                |
| ---------------------------- | ------ | ---------------------------------------------------- |
| All AVM-TF modules verified  | βœ…     | 6 modules confirmed via Terraform Registry MCP       |
| Latest versions resolved     | βœ…     | All `~>` constraints match latest published versions |
| Variable types confirmed     | βœ…     | All `parent_id` vs `resource_group_name` resolved    |
| Required variables satisfied | βœ…     | 22/22 required variables across all modules          |
| Optional variables validated | βœ…     | All optional variables exist in registry schemas     |
| Region limitations handled   | βœ…     | All resources available in swedencentral             |
| Pitfalls addressed           | βœ…     | 10/10 known pitfalls checked and resolved            |
| `terraform validate`         | βœ…     | Configuration is valid                               |
| `terraform fmt -check`       | βœ…     | Formatting passes                                    |

> [!IMPORTANT]
> **Go / No-Go Verdict**
>
> | Signal               | Status       |
> | -------------------- | ------------ |
> | AVM Modules          | βœ…           |
> | Provider Versions    | βœ…           |
> | Variable Schemas     | βœ…           |
> | Regions              | βœ…           |
> | Pitfalls             | βœ…           |
> | `terraform validate` | βœ…           |
> | **Overall**          | **βœ… READY** |

---

_Pre-flight validation for terraform-e2e Terraform implementation._
_Registry data sourced via Terraform MCP: `get_latest_module_version`, `get_module_details`, `get_latest_provider_version`._

---

<div align="center">

| ⬅️ [04-implementation-plan.md](04-implementation-plan.md) | 🏠 [Project Index](README.md) | ➑️ [05-implementation-reference.md](05-implementation-reference.md) |
| --------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------- |

</div>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.