Tour the Example Provider¶
The pyvider Terraform provider packages a curated subset of the example components from the pyvider-components library. This tour highlights the major capability areas so you can decide which examples to try first.
What's inside¶
- Resources for manipulating files, exercising Terraform workflows, and simulating infrastructure objects.
- Data sources for reading environment data, parsing inputs, and performing calculations.
- Functions that bring common Python-style utilities (string casing, formatting, math) directly into Terraform expressions.
Each component is documented in this site. Use the navigation pane to drill into the resource, data source, or function you want to inspect.
File operations¶
Manage local files and directories without leaving Terraform:
pyvider_file_contentwrites content to disk with optional templating helpers.pyvider_local_directorycreates nested folder structures from Terraform data.pyvider_file_inforemoves guesswork by returning metadata about files on disk.
resource "pyvider_file_content" "notes" {
filename = "${path.module}/notes.txt"
content = <<-EOT
Generated by Terraform at ${timestamp()}
Workspace: ${terraform.workspace}
EOT
mode = "0644"
}
Diagnostics and helpers¶
Need quick insight into the runtime environment? Try:
pyvider_env_variablesto surface environment variables into Terraform.pyvider_provider_config_readerto echo back provider configuration when you are experimenting with custom capabilities.pyvider_timed_tokento generate expiring tokens useful for test scenarios.
These components make it easy to confirm that your provider binary is wired correctly before building something more complex.
Data transformation with jq¶
Pyvider includes first-class support for jq:
pyvider_lens_jqdata source executes a query over structured data.provider::pyvider::lens_jq()function lets you run the same queries inline.
locals {
raw = jsonencode({
services = [
{ name = "api", tier = "backend" },
{ name = "web", tier = "frontend" },
]
})
}
data "pyvider_lens_jq" "frontend" {
json_input = local.raw
query = ".services[] | select(.tier == \"frontend\") | .name"
}
Test mode components¶
Want to understand how Pyvider handles diagnostics and state transitions? Explore the test-mode resources and data sources:
pyvider_private_state_verifierandpyvider_warning_examplesimulate validation flows.pyvider_nested_resource_testand friends provide state-rich examples ideal for learning how updates and diffs work.
Function library highlights¶
Try these Terraform functions for quick wins:
provider::pyvider::upper(value)andprovider::pyvider::lower(value)for case conversion.provider::pyvider::format_size(bytes)to present byte counts in human-readable units.provider::pyvider::pluralize(word, count)to tidy up generated text.
Because functions run wherever Terraform evaluates expressions, they are perfect for templating outputs or generating configuration files.
Keep exploring¶
- Follow Getting Started with Pyvider to run a complete example.
- Ready to build something custom? Check out the pyvider-components documentation for framework guides.