Skip to content

Schema API

Type-safe schema definition system for Terraform resources, data sources, and providers.

๐Ÿค– AI-Generated Content

This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.

Overview

The schema system provides Python-first schema definition with full Terraform compatibility.

Key Components

  • Schema Types (PvsSchema, PvsObjectType) - Container types
  • Attributes (PvsAttribute) - Schema fields with types and modifiers
  • Blocks (PvsNestedBlock) - Nested configuration blocks
  • Validators - Built-in and custom validation
  • Factory Functions - Schema builders (s_provider, s_resource, etc.)

Type System

Maps Python types to Terraform types: - str โ†’ String - int / float โ†’ Number - bool โ†’ Boolean - list โ†’ List - dict โ†’ Map/Object - set โ†’ Set

Modifiers

Attributes support modifiers: - required=True - Must be provided - optional=True - May be omitted - computed=True - Provider-calculated - sensitive=True - Redacted in logs - default=value - Default value

Module Reference