# 📀 Step 4: Implementation Plan - {project-name}

![Step](https://img.shields.io/badge/Step-4-blue?style=for-the-badge)
![Status](https://img.shields.io/badge/Status-Draft-orange?style=for-the-badge)
![Agent](https://img.shields.io/badge/Agent-Bicep%20Plan-purple?style=for-the-badge)

<details open>
<summary><strong>📑 Implementation Contents</strong></summary>

- [📋 Overview](#-overview)
- [📦 Resource Inventory](#-resource-inventory)
- [🗂️ Module Structure](#-module-structure)
- [🔨 Implementation Tasks](#-implementation-tasks)
- [🚀 Deployment Phases](#-deployment-phases)
- [🔗 Dependency Graph](#-dependency-graph)
- [🔄 Runtime Flow Diagram](#-runtime-flow-diagram)
- [🏷️ Naming Conventions](#-naming-conventions)
- [🔐 Security Configuration](#-security-configuration)
- [⏱️ Estimated Implementation Time](#-estimated-implementation-time)
- [🔒 Approval Gate](#-approval-gate)
- [References](#references)

</details>

> Generated by IaC Planner agent | {date}

| ⬅️ Previous                                                  | 📑 Index            | Next ➡️                                        |
| ------------------------------------------------------------ | ------------------- | ---------------------------------------------- |
| [04-governance-constraints.md](04-governance-constraints.md) | [README](README.md) | [04-preflight-check.md](04-preflight-check.md) |

## 📋 Overview

Brief description of what will be implemented.

---

## 📦 Resource Inventory

| Resource   | Type                            | SKU | AVM Status            | Dependencies | Status  |
| ---------- | ------------------------------- | --- | --------------------- | ------------ | ------- |
| Resource 1 | Microsoft.Provider/resourceType |     | ✅ AVM                |              | ⬜ Todo |
| Resource 2 | Microsoft.Provider/resourceType |     | ⚠️ Requires Approval  |              | ⬜ Todo |
| Resource 3 | Microsoft.Provider/resourceType |     | ❌ No AVM (Justified) |              | ⬜ Todo |

---

## 🗂️ Module Structure

```text
infra/bicep/{project-name}/
├── main.bicep
├── main.bicepparam
├── modules/
│   ├── module1.bicep
│   ├── module2.bicep
│   └── module3.bicep
└── deploy.ps1
```

| Module        | AVM Source                            | Version | Purpose   |
| ------------- | ------------------------------------- | ------- | --------- |
| module1.bicep | `br/public:avm/res/{provider}/{type}` | {x.x.x} | {purpose} |
| module2.bicep | `br/public:avm/res/{provider}/{type}` | {x.x.x} | {purpose} |
| module3.bicep | `br/public:avm/res/{provider}/{type}` | {x.x.x} | {purpose} |

---

## 🔨 Implementation Tasks

### Task 1: main.bicep (Orchestration)

**Purpose**: Main entry point

**Parameters**:

- List parameters

**Variables**:

- List variables (e.g., uniqueSuffix from uniqueString(resourceGroup().id))

**Modules Called**:

1. module1.bicep
2. module2.bicep

### Task 2: modules/module1.bicep

**Resources**:

- List resources

**Outputs**:

- List outputs

### Task 3: modules/module2.bicep

**Resources**:

- List resources

**Key Configuration**:

```bicep
Example configuration snippet
```

**Outputs**:

- List outputs

### Task N: deploy.ps1 (Deployment Script)

**Features**:

- Parameter validation
- Bicep lint/build verification
- What-If preview
- Deployment execution
- Output display

---

## 🚀 Deployment Phases

> Deployment strategy: **{Phased|Single}** (chosen during planning)

### Phase 1: Foundation

| Order | Module | Resources | Validation |
| ----- | ------ | --------- | ---------- |
| 1     | ...    | ...       | ...        |

**Approval Gate**: Verify foundation resources before proceeding.

### Phase 2: Security & Data

| Order | Module | Resources | Validation |
| ----- | ------ | --------- | ---------- |
| 2     | ...    | ...       | ...        |

**Approval Gate**: Verify security controls before CDE resources.

### Phase N: ...

_(Repeat for each phase)_

### Phase Summary

| Phase | Resources | Est. Deploy Time | Approval Gate |
| ----- | --------- | ---------------- | ------------- |
| 1     | X         | X min            | ✅            |
| 2     | X         | X min            | ✅            |
| N     | X         | X min            | ✅            |

---

## 🔗 Dependency Graph

![Module Dependency Graph](./04-dependency-diagram.png)

Source: [04-dependency-diagram.py](./04-dependency-diagram.py) (Python `diagrams` library)

> Map each node label to an Implementation Task heading in the task table below.

---

## 🔄 Runtime Flow Diagram

![Runtime Flow Diagram](./04-runtime-diagram.png)

Source: [04-runtime-diagram.py](./04-runtime-diagram.py) (Python `diagrams` library)

> Keep this runtime view focused on request/auth/secret/event/telemetry paths only.

---

## 🏷️ Naming Conventions

| Resource       | Pattern                  | Example            | Generated Name |
| -------------- | ------------------------ | ------------------ | -------------- |
| Resource Group | rg-{project}-{env}       | rg-project-dev     | {actual name}  |
| Resource 1     | {prefix}-{project}-{env} | prefix-project-dev | {actual name}  |

---

## 🔐 Security Configuration

| Resource   | Security Setting | Value |
| ---------- | ---------------- | ----- |
| Resource 1 | Setting 1        |       |
| Resource 2 | Setting 2        |       |

---

## ⏱️ Estimated Implementation Time

| Task          | Estimated Duration |
| ------------- | ------------------ |
| Bicep modules | X minutes          |
| Testing       | X minutes          |
| Deployment    | X minutes          |
| **Total**     | **~X minutes**     |

---

## 🔒 Approval Gate

> [!IMPORTANT]
> **📋 Implementation Plan Ready**
>
> | Metric                           | Value   |
> | -------------------------------- | ------- |
> | Azure resources planned          | {X}     |
> | Bicep modules to create          | {X}     |
> | Governance constraints addressed | ✅ / ❌ |
> | CAF naming conventions applied   | ✅ / ❌ |
>
> - [ ] **Approved** — proceed to bicep-code
> - **Approver**: **\*\***\_\_\_**\*\***
> - **Date**: **\*\***\_\_\_**\*\***
>
> Reply **"approve"** to proceed to bicep-code, or provide feedback.

---

## References

> [!NOTE]
> 📚 The following Microsoft Learn resources inform this implementation.

| Topic                  | Link                                                                                                                          |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Azure Verified Modules | [AVM Index](https://aka.ms/avm/index)                                                                                         |
| Bicep Best Practices   | [Documentation](https://learn.microsoft.com/azure/azure-resource-manager/bicep/best-practices)                                |
| CAF Naming Conventions | [Naming Rules](https://learn.microsoft.com/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming)         |
| Resource Abbreviations | [Abbreviations](https://learn.microsoft.com/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations) |

---

_Plan generated by IaC Planner agent following Azure Well-Architected Framework guidelines._

---

<div align="center">

| ⬅️ [04-governance-constraints.md](04-governance-constraints.md) | 🏠 [Project Index](README.md) | ➡️ [04-preflight-check.md](04-preflight-check.md) |
| --------------------------------------------------------------- | ----------------------------- | ------------------------------------------------- |

</div>
