terraform-provider-shared

module
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0

README

Terraform Provider Shared

shield_gh-workflow-test shield_license


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:

Features

  • 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

Usage

Add this module as a dependency to your Terraform provider:

require github.com/sonatype-nexus-community/terraform-provider-shared v0.1.0

Examples

Comprehensive 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

Development

Building
go build -v .
Testing
go test -v -cover -timeout=5m ./...
Linting
go fmt ./...
go vet ./...

See CONTRIBUTING.md for details.

The Fine Print

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!

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL