The Redpanda Terraform Provider is a Terraform plugin that allows you to create and manage resources on Redpanda Cloud.
User documentation on the Terraform provider is available at the Terraform Registry.
When contributing to this project, please ensure you've run task ready and all tests pass before submitting a pull
request. If you've added new functionality, consider adding appropriate unit and integration tests.
- (optional) Use the label docs to generate documentation
- Use the label ci-ready to run integration tests
This guide provides an overview of the development workflow using Task for building, testing, and managing the Redpanda Terraform Provider. Task replaces our previous Makefile-based workflow with a more modern, cross-platform solution.
Before using these commands, ensure you have the following:
- Task installed on your system
- Go installed on your system
- Terraform CLI installed
- Access to a Redpanda Cloud account with appropriate permissions
- Required environment variables set (see Environment Configuration)
Create a .env file in the project root with your configuration:
# Copy the example file and customize
cp .env.example .envRequired variables:
REDPANDA_CLIENT_ID: Redpanda Cloud client IDREDPANDA_CLIENT_SECRET: Redpanda Cloud client secretREDPANDA_CLOUD_ENVIRONMENT: Redpanda Cloud environment (pre/prod)
View all available commands:
task --list-allThe task system is organized into domains:
- build: Provider compilation and installation
- test: Unit and integration testing
- docs: Documentation generation
- lint: Code quality and formatting
- local: Local development cluster management
- release: Release preparation and publishing
The local task domain provides commands for testing your locally-built provider against live Redpanda Cloud clusters. Note that "local" refers to using a locally-built version of the provider rather than the published version from the Terraform Registry - the clusters themselves are still created in Redpanda Cloud.
Test your provider changes against real cloud infrastructure:
# Create an AWS cluster using your local provider build
task local:cluster:aws:apply
# Create an Azure cluster using your local provider build
task local:cluster:azure:apply
# Create a GCP cluster using your local provider build
task local:cluster:gcp:apply
# Destroy clusters when done
task local:cluster:aws:destroy
task local:cluster:azure:destroy
task local:cluster:gcp:destroyThese commands:
- Build the provider locally from your current code
- Install the local build to the specific example directory (not globally)
- Run
terraform initandterraform apply/destroyusing your local provider build - Create real clusters in Redpanda Cloud for testing your changes
- Handle different cluster types automatically (cluster, serverless, data sources)
Example workflow:
# Build and test AWS cluster with your local provider changes
task local:cluster:aws:apply
# Make changes to your provider code or examples/cluster/aws/main.tf
# Test your changes (rebuilds provider automatically)
task local:cluster:aws:apply
# Clean up the cloud resources when done
task local:cluster:aws:destroyImportant: These commands create real resources in Redpanda Cloud and may incur costs. Always clean up test clusters when finished.
For CI/CD and integration testing, use the test domain commands:
# Run unit tests (no credentials needed)
task test:unit
# Run network tests (requires credentials)
task test:network
# Run data source tests (requires existing cluster)
task test:datasource
# Run full cluster tests (creates real resources)
task test:cluster:aws
task test:cluster:azure
task test:cluster:gcp
# Run BYOC tests
task test:byoc:aws
task test:byoc:azure
task test:byoc:gcp
# Run serverless tests
task test:serverless
task test:serverless:regionsImportant: Integration tests create real cloud resources and require valid credentials.
These commands assist in code development, testing, and maintenance.
# Build the provider binary
task build
# Install provider to local Terraform cache
task build:install
# Clean up Go modules
task build:tidy# Prepare code for commit (docs, lint, tidy)
task ready
# Run linting
task lint
# Run linting with auto-fix
task lint:fix
# Install linting tools
task lint:install# Generate provider documentation
task docs
# Install documentation tools
task docs:install# Run unit tests (no credentials needed)
task test:unit
# Generate and clean mocks
task mock
# Clean existing mocks
task mock:clean
# Generate mocks from interfaces
task mock:generateThe task ready command is especially useful before committing changes as it ensures code quality and up-to-date documentation.
These commands are used for creating and managing releases:
# Check GoReleaser configuration
task release:check
# Import GPG key for signing
task release:import-gpg
# Create a full release (requires GPG setup)
task release
# Build release artifacts locally
task release:build
# Create a snapshot release for testing
task release:snapshotEnvironment Variables for Releases:
GPG_PRIVATE_KEY: Base64-encoded GPG private keyPASSPHRASE: GPG key passphraseGPG_FINGERPRINT: GPG key fingerprintGITHUB_TOKEN: GitHub token for release publishing
- Always run
task readybefore committing changes to ensure code quality and documentation accuracy. - Use
task test:unitfor quick, local testing that doesn't require Redpanda credentials. - Use
task local:cluster:*:applyandtask local:cluster:*:destroyfor manual testing during development. - Run the integration tests by tagging your PR with
ci-readyto ensure all tests pass before merging. - Use
task release:checkto validate GoReleaser configuration before creating releases. - Set up your
.envfile with appropriate credentials for your development environment.
Do not change the Terraform Registry Manifest version! This is the version of the protocol, not the provider. To release a version cut a release in GitHub. Goreleaser will handle things from there.
To raise issues, questions, or interact with the community: