This repository serves as a template for creating a Terraform provider using the Terraform Plugin Framework. It provides a starting point for building Terraform providers and includes the following components:
- A resource and a data source implementation (internal/provider/)
- Examples demonstrating usage (examples/)
- Generated documentation (docs/)
- Miscellaneous meta files
Before you begin, ensure that you meet the following requirements:
- Terraform >= 1.0
- Go >= 1.19
-
Clone this repository to your local machine.
-
Navigate to the repository directory.
-
Build the provider using the following Go install command:
sh go install
This provider uses Go modules. To add a new dependency (github.com/author/dependency) to your Terraform provider:
sh go get github.com/author/dependency go mod tidy
Remember to commit the changes to go.mod and go.sum.
Replace this section with usage instructions specific to your provider.
Your provider implementation seems to be centered around the Bitrise API. It involves creating, deleting, and configuring resources related to Bitrise applications. Here's a brief overview of your provider's key components and functionalities:
-
BitriseProvider: The main provider struct that implements the provider.Provider interface. It handles metadata, schema, and resource configuration.
-
ClientProvider: An interface for getting an HTTP client. It appears to be part of your provider's dependency injection mechanism.
-
AppResource: A resource implementation responsible for managing Bitrise applications. It includes methods to create, delete, read, and update resources.
-
authenticatedTransport: An HTTP transport implementation that adds an authorization header to outgoing requests.
If you wish to contribute to or modify the provider, follow these steps:
-
Ensure that you have Go installed on your machine (see Requirements above).
-
Compile the provider by running the following command:
sh go install
This command will build the provider and place the binary in the $GOPATH/bin directory.
-
Generate or update documentation using the command:
sh go generate
-
Run the full suite of acceptance tests by executing:
sh make testacc
Note: Acceptance tests create real resources, which may incur costs.
For more detailed information on creating Terraform providers, you can explore tutorials and guides on the HashiCorp Developer platform. Additionally, consult the official Terraform documentation to learn about Terraform Plugin Framework-specific details and best practices.
When your provider is ready, consider publishing it on the Terraform Registry so that others can benefit from and use it.