Standard Components for the Pyvider Framework
Project description
Pyvider Components
This repository provides a standard set of example components for the Pyvider framework, a Python-based framework for building Terraform providers.
What is pyvider-components?
pyvider-components is a learning and reference library that demonstrates how to build Terraform provider components using the Pyvider framework. It contains 100+ working examples of resources, data sources, and functions that you can:
- ๐ Learn from - See real-world examples of Pyvider components
- ๐ Reference - Use as templates for your own providers
- ๐งช Test with - Try out Pyvider features without writing code
- ๐๏ธ Build on - Fork and customize for your needs
Note: This is primarily an example/learning library, not a production provider. For production use, the terraform-provider-pyvider packages these components into a deployable provider.
Relationship to terraform-provider-pyvider
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ pyvider (framework) โ โ Core framework for building providers
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ pyvider-components โโโโโโถโ terraform-provider-pyvider โ
โ (example library) โ โ (production provider) โ
โ โ โ โ
โ โข Learning resources โ โ โข Uses components from โ โ
โ โข Reference examples โ โ โข Packaged & tested โ
โ โข 100+ demonstrations โ โ โข Production-ready โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Difference:
- pyvider-components: Learn how to build components (this repo)
- terraform-provider-pyvider: Use components in production (terraform-provider-pyvider)
When to use pyvider-components
Use this repository when you want to:
โ Learn how to build Pyvider providers โ See working examples of resources, data sources, and functions โ Experiment with Pyvider features โ Reference implementation patterns โ Build your own custom provider
When to use terraform-provider-pyvider
Use the provider when you want to:
โ Use utility resources/data sources in production Terraform โ Access provider functions in your configurations โ Follow a getting started tutorial โ Deploy with Terraform registry compatibility
Part of the provide.io Ecosystem
This project is part of a larger ecosystem of tools for Python and Terraform development.
Understand how provide-foundation, pyvider, flavorpack, and other projects work together.
Getting Started
To use the pyvider-components provider, configure it in your Terraform project:
terraform {
required_providers {
pyvider = {
source = "local/providers/pyvider"
version = "0.1.0"
}
}
}
provider "pyvider" {
# Provider configuration options go here
}
Components
Data Sources
pyvider_env_variables: Provides access to environment variables.pyvider_file_info: Provides metadata about a file or directory.pyvider_http_api: Makes an HTTP request and returns the response.pyvider_lens_jq: Transforms data using a JQ expression.
Resources
pyvider_file_content: Manages the content of a file.pyvider_local_directory: Manages a directory on the local filesystem.pyvider_private_state_verifier: Verifies the private state of a resource (for testing).pyvider_timed_token: Manages a short-lived token (for testing).pyvider_warning_example: Demonstrates how to return warnings (for testing).
Functions
A rich set of utility functions are provided for common data manipulations.
- Numeric:
add,subtract,multiply,divide,sum,min,max,round - String:
upper,lower,split,join,replace,format,truncate,format_size,pluralize,to_snake_case,to_kebab_case,to_camel_case - Collection:
length,contains,lookup - Type Conversion:
tostring - Transformation:
lens_jq
Examples
Read Environment Variables
data "pyvider_env_variables" "shell" {
keys = ["SHELL"]
}
output "shell_path" {
value = data.pyvider_env_variables.shell.values["SHELL"]
}
Manage a File
resource "pyvider_file_content" "example" {
filename = "/tmp/example.txt"
content = "This file is managed by Terraform."
}
output "file_hash" {
value = pyvider_file_content.example.content_hash
}
Use a String Function
output "uppercase_example" {
value = provider::pyvider::upper("hello world")
}
Development
To contribute, set up the development environment using uv.
# Create a virtual environment and install all dependencies
uv sync --all-groups
# Activate the environment
source .venv/bin/activate
Testing
Run the test suite with pytest.
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvider_components-0.0.1100.post1.tar.gz.
File metadata
- Download URL: pyvider_components-0.0.1100.post1.tar.gz
- Upload date:
- Size: 62.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff7ca6ea75190b9784801263c07e8bba38268911ce305ac72fac27e1b985a683
|
|
| MD5 |
1b2925033397fb29da9b6ae3901ba6b9
|
|
| BLAKE2b-256 |
fd0059f859ab356676fdeca9e36e4b10a76dfebc2a1991388a201efb5c226015
|
File details
Details for the file pyvider_components-0.0.1100.post1-py3-none-any.whl.
File metadata
- Download URL: pyvider_components-0.0.1100.post1-py3-none-any.whl
- Upload date:
- Size: 107.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8baebc1670fee5d2f14c45bf267e8391a2194fdb886bbc5f7b2f66b31627c420
|
|
| MD5 |
69ecf3f91e1567bedc1e22476e6538b7
|
|
| BLAKE2b-256 |
d6f6555522cb773d98b3b6c1b5b89ba8607f6f0146644be1fd59befe826866db
|