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.
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 install
Note: 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_basic
Acceptance 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
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
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