A Terraform provider for managing WALLIX Bastion resources
The Terraform WALLIX Bastion provider allows you to manage WALLIX Bastion resources such as users, groups, authorizations, and more through Infrastructure as Code.
- Visit the official Terraform website for downloads
- Go
v1.22orv1.23(for development)
terraform {
required_providers {
wallix-bastion = {
source = "wallix/wallix-bastion"
version = "~> 0.14.0"
}
}
}
provider "wallix-bastion" {
ip = "your-bastion-host"
user = "<user>"
token = "<your-api-token>"
}# Clone the repository
git clone https://github.com/wallix/terraform-provider-wallix-bastion.git
cd terraform-provider-wallix-bastion
```bash
# Build and install the provider locally
make installNote: When testing your locally built provider, you may need to explicitly specify the local source and version in your Terraform configuration. This ensures Terraform uses your development build instead of the published version.
Example:
terraform {
required_providers {
wallix-bastion = {
source = "terraform.local/local/wallix-bastion"
version = "0.0.0-dev"
}
}
}Ensure you have the following installed:
- Go 1.22 to 1.24
- Make
- Git
# Build the provider
make build
# Build for all platforms
make build-all
# Clean build artifacts
make clean# Install development dependencies
go mod download
# Format code
make fmt
# Run linters
make lint
# Build development version
go build -o terraform-provider-wallix-bastion# Run all tests
make test
# Run tests with coverage
make test-coverage
# Run specific test
go test -v ./bastion -run TestAccResourceAuthorization_basicAcceptance tests require a running WALLIX Bastion instance.
# Set environment variables
export WALLIX_BASTION_HOST="your-bastion-host"
export WALLIX_BASTION_USER="admin"
export WALLIX_BASTION_TOKEN="<your-api-token>"
export WALLIX_BASTION_API_VERSION="v3.12"
# Run acceptance tests
make testacc
# Run specific acceptance test
TF_ACC=1 go test -v ./bastion -run TestAccResourceAuthorization_sessionSharing-
Set up test environment variables:
export WALLIX_BASTION_HOST="your-test-bastion" export WALLIX_BASTION_TOKEN="<your-test-token>" export WALLIX_BASTION_USER="admin" export WALLIX_BASTION_API_VERSION="v3.12" export TF_ACC=1
-
Create test configuration:
# Copy example configuration cp examples/authorization_test.tf test.tf # Edit with your test values vim test.tf
-
Run manual tests:
terraform init terraform plan terraform apply terraform destroy
# Clone and setup
git clone https://github.com/wallix/terraform-provider-wallix-bastion.git
cd terraform-provider-wallix-bastion
# Install dependencies
go mod download
go mod tidy
# Setup pre-commit hooks (optional)
make setup-dev# Create feature branch
git checkout -b feature/your-feature-name
# Make your changes
# ...
# Format and lint
make fmt
make lint
# Run tests
make test# Build and install locally
make install
# Test with your Terraform configuration
cd examples/
# Choose an example directory, e.g., authorization
cd authorization
# Update the provider to use the development build
# terraform {
# required_version = ">= 1.0"
# required_providers {
# wallix-bastion = {
# # source = "wallix/wallix-bastion"
# # version = "0.14.7"
# source = "terraform.local/local/wallix-bastion"
# version = "0.0.0-dev"
# }
# }
# }
terraform init
terraform plan
terraform apply# Run full test suite
make test-all
# Commit changes
git add .
git commit -m "feat: your feature description"
git push origin feature/your-feature-name
# Create pull request# Build commands
make build # Build the provider
make build-all # Build for all platforms
# Quality commands
make fmt # Format Go code and Terraform examples
make lint # Run linters
make vet # Run go vet
# Test commands
make test # Run unit tests
make test-coverage # Run tests with coverage
make testacc # Run acceptance tests
make test-all # Run all tests
# Development commands
make clean # Clean build artifacts
make setup-dev # Setup development environment
make install # Install the provider locally
make docs # Generate documentation
make docs-verify # Verify documentation quality
# Maintenance and release commands
make maintenance # Run maintenance tasks (deps, lint, test, build)
make dev-check # Quick development checks (lint, test, build)
make update-deps # Update Go dependencies only
make prepare-release # Dry-run release preparation
make release-patch # Prepare patch release (X.Y.Z+1)
make release-minor # Prepare minor release (X.Y+1.0)
make release-major # Prepare major release (X+1.0.0)See RELEASE.md for detailed release process documentation.
- Provider Documentation
- Documentation Generation Guide - How to generate and verify documentation
- API Documentation
- Examples
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Run the test suite (
make test-all) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
| Provider Version | Terraform Version | Go Version | WALLIX Bastion API |
|---|---|---|---|
| >= 0.14.0 | >= 1.0 | 1.22-1.24 | v3.12, v3.12 |
| 0.13.x | >= 0.14 | 1.19-1.21 | v3.3, v3.6 |
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
We would like to greatly thanks:
- Claranet for their great work on this provider!
- The Terraform community for their continuous support and contributions
- π Documentation
- π Issue Tracker
- π¬ Discussions
