Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 3.57 KB

File metadata and controls

39 lines (29 loc) · 3.57 KB

Architecture Decision Records

This directory contains Architecture Decision Records (ADRs) for terraform-provider-proxmox. ADRs document the key architectural patterns contributors must follow.

ADRs

ADR Title Summary
001 Use Plugin Framework All new resources use Terraform Plugin Framework, not SDKv2
002 API Client Structure Layered domain clients in proxmox/ with ExpandPath() pattern
003 Resource File Organization Domain hierarchy, 3-file pattern, naming conventions
004 Schema Design Conventions Attribute types, validators, model-API conversion, CheckDelete, PVE-defaults rule
005 Error Handling "Unable to [Action] [Resource]" format, 3-layer error architecture, retry policies
006 Testing Requirements Acceptance tests required, table-driven structure, test helpers
007 Resource Type Name Migration Migrate from proxmox_virtual_environment_ to proxmox_ prefix in 3 phases
008 Sub-block Contract Value-centric NewValue / FillCreateBody / FillUpdateBody shape for sub-packages of VM-style composite resources

Reading Order for New Resource Implementation

When implementing a new resource, read the ADRs in this order:

  1. ADR-001 — Confirms you're using the right framework
  2. ADR-003 — Where to put files and what to name them
  3. ADR-002 — How to access the Proxmox API
  4. ADR-004 — Schema attributes, model conversion, field deletion, PVE-defaults rule
  5. ADR-005 — Error message format and sentinel error handling
  6. ADR-006 — Acceptance test structure and helpers
  7. ADR-008Only if the resource composes sub-packages (VM-style). Skip otherwise.
  8. reference-examples.md — Copy-from code walkthroughs and checklist

Reference Examples

The reference-examples.md document provides annotated walkthroughs of three real resources at increasing complexity:

  1. SDN VNet — start here for any new resource (simplest clean 3-file pattern)
  2. Replication — many optional fields, split create/update methods, perfect audit score
  3. Backup Job — ConfigValidators, comma-separated-to-list, nested objects

It also includes a checklist for new resource implementation.