Shared libraries, utilities, and common code for Sonatype Terraform Providers.
This repository contains reusable schema builders, validators, error handling, and common patterns used across multiple Terraform providers:
- Schema Builders: Utility functions for creating consistent Terraform schema attributes
- Validators: Pre-built validation rules for common patterns (IDs, emails, enums, etc.)
- Error Handling: Standardized error response handling across providers
- Base Resources: Common base resource implementations
- Helper Functions: Reusable utilities for API operations and data conversion
Add this module as a dependency to your Terraform provider:
require github.com/sonatype-nexus-community/terraform-provider-shared v0.1.0Comprehensive examples are available in the examples directory:
- Schema Builders - Creating consistent Terraform resource schema attributes
- Validators - Enforcing constraints on attribute values (enums, patterns, ranges)
- Type Conversions - Converting between Go types and Terraform framework types
- Error Handling - Standardized error messages and HTTP status code handling
go build -v .go test -v -cover -timeout=5m ./...go fmt ./...
go vet ./...See CONTRIBUTING.md for details.
This project is part of the Sonatype Nexus Community organization, which is not officially supported by Sonatype. Please review the latest pull requests, issues, and commits to understand this project's readiness for contribution and use.
- File suggestions and requests on this repo through GitHub Issues, so that the community can pitch in
- Use or contribute to this project according to your organization's policies and your own risk tolerance
- Don't file Sonatype support tickets related to this project— it won't reach the right people that way
Last but not least of all - have fun!