|
1 |
| -# terraform-provider-wallix-bastion |
| 1 | +# Terraform Provider for Wallix Bastion |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +A Terraform provider for managing Wallix Bastion resources |
| 6 | + |
| 7 | +[](https://goreportcard.com/report/github.com/wallix/terraform-provider-wallix-bastion) |
| 8 | +[](https://opensource.org/licenses/MPL-2.0) |
| 9 | +[](https://registry.terraform.io/providers/wallix/wallix-bastion/latest) |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +The Terraform Wallix Bastion provider allows you to manage Wallix Bastion resources such as users, groups, authorizations, and more through Infrastructure as Code. |
2 | 14 |
|
3 | 15 | ## Requirements
|
4 | 16 |
|
5 |
| -- [Terraform](https://www.terraform.io/downloads.html) |
| 17 | +- [Terraform](https://www.terraform.io/downloads.html) >= 1.0 |
| 18 | +- [Go](https://golang.org/doc/install) `v1.22` or `v1.23` (for development) |
| 19 | +- [Terraform](https://www.terraform.io/downloads.html) >= 1.0 |
| 20 | + |
| 21 | +- [Go](https://golang.org/doc/install) `v1.22` or `v1.23` (for development) |
| 22 | + |
| 23 | +### From Terraform Registry |
| 24 | + |
| 25 | +```hcl |
| 26 | +terraform { |
| 27 | + required_providers { |
| 28 | + wallix-bastion = { |
| 29 | + source = "wallix/wallix-bastion" |
| 30 | + version = "~> 0.14.0" |
| 31 | + } |
| 32 | + } |
| 33 | +} |
| 34 | +
|
| 35 | +provider "wallix-bastion" { |
| 36 | + ip = "your-bastion-host" |
| 37 | + user = "<user>" |
| 38 | + token = "<your-api-token>" |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +### Local Development Installation |
| 43 | + |
| 44 | +```bash |
| 45 | +# Clone the repository |
| 46 | +git clone https://github.com/wallix/terraform-provider-wallix-bastion.git |
| 47 | +cd terraform-provider-wallix-bastion |
| 48 | + |
| 49 | +# Build and install locally |
| 50 | +make install |
| 51 | +``` |
| 52 | + |
| 53 | +## Building the Provider |
| 54 | + |
| 55 | +### Prerequisites |
| 56 | + |
| 57 | +Ensure you have the following installed: |
| 58 | + |
| 59 | +- Go 1.22 or 1.23 |
| 60 | +- Make |
| 61 | +- Git |
| 62 | + |
| 63 | +### Build Commands |
| 64 | + |
| 65 | +```bash |
| 66 | +# Build the provider |
| 67 | +make build |
| 68 | + |
| 69 | +# Build for all platforms |
| 70 | +make build-all |
| 71 | + |
| 72 | +# Clean build artifacts |
| 73 | +make clean |
| 74 | +``` |
| 75 | + |
| 76 | +### Development Build |
| 77 | + |
| 78 | +```bash |
| 79 | +# Install development dependencies |
| 80 | +go mod download |
| 81 | + |
| 82 | +# Format code |
| 83 | +make fmt |
| 84 | + |
| 85 | +# Run linters |
| 86 | +make lint |
| 87 | + |
| 88 | +# Build development version |
| 89 | +go build -o terraform-provider-wallix-bastion |
| 90 | +``` |
| 91 | + |
| 92 | +## Testing |
| 93 | + |
| 94 | +### Running Unit Tests |
| 95 | + |
| 96 | +```bash |
| 97 | +# Run all tests |
| 98 | +make test |
| 99 | + |
| 100 | +# Run tests with coverage |
| 101 | +make test-coverage |
| 102 | + |
| 103 | +# Run specific test |
| 104 | +go test -v ./bastion -run TestAccResourceAuthorization_basic |
| 105 | +``` |
| 106 | + |
| 107 | +### Running Acceptance Tests |
| 108 | + |
| 109 | +Acceptance tests require a running Wallix Bastion instance. |
| 110 | + |
| 111 | +```bash |
| 112 | +# Set environment variables |
| 113 | +export WALLIX_BASTION_IP="your-bastion-host" |
| 114 | +export WALLIX_BASTION_TOKEN="<your-api-token>" |
| 115 | +export WALLIX_BASTION_API_VERSION="v3.12" |
| 116 | + |
| 117 | +# Run acceptance tests |
| 118 | +make testacc |
| 119 | + |
| 120 | +# Run specific acceptance test |
| 121 | +TF_ACC=1 go test -v ./bastion -run TestAccResourceAuthorization_sessionSharing |
| 122 | +``` |
| 123 | + |
| 124 | +### Test Environment Setup |
| 125 | + |
| 126 | +1. **Set up test environment variables:** |
6 | 127 |
|
7 |
| -### In addition to develop |
| 128 | + ```bash |
| 129 | + export WALLIX_BASTION_HOST="your-test-bastion" |
| 130 | + export WALLIX_BASTION_TOKEN="<your-test-token>" |
| 131 | + export WALLIX_BASTION_API_VERSION="v3.8" |
| 132 | + export TF_ACC=1 |
| 133 | + ``` |
8 | 134 |
|
9 |
| -- [Go](https://golang.org/doc/install) `v1.22` or `v1.23` |
| 135 | +2. **Create test configuration:** |
10 | 136 |
|
11 |
| -### Special Thanks |
| 137 | + ```bash |
| 138 | + # Copy example configuration |
| 139 | + cp examples/authorization_test.tf test.tf |
12 | 140 |
|
13 |
| -We would like to Greatly thanks: |
| 141 | + # Edit with your test values |
| 142 | + vim test.tf |
| 143 | + ``` |
| 144 | + |
| 145 | +3. **Run manual tests:** |
| 146 | + |
| 147 | + ```bash |
| 148 | + terraform init |
| 149 | + terraform plan |
| 150 | + terraform apply |
| 151 | + terraform destroy |
| 152 | + ``` |
| 153 | + |
| 154 | +## Local Development Workflow |
| 155 | + |
| 156 | +### 1. Setup Development Environment |
| 157 | + |
| 158 | +```bash |
| 159 | +# Clone and setup |
| 160 | +git clone https://github.com/wallix/terraform-provider-wallix-bastion.git |
| 161 | +cd terraform-provider-wallix-bastion |
| 162 | + |
| 163 | +# Install dependencies |
| 164 | +go mod download |
| 165 | +go mod tidy |
| 166 | + |
| 167 | +# Setup pre-commit hooks (optional) |
| 168 | +make setup-dev |
| 169 | +``` |
| 170 | + |
| 171 | +### 2. Make Changes |
| 172 | + |
| 173 | +```bash |
| 174 | +# Create feature branch |
| 175 | +git checkout -b feature/your-feature-name |
| 176 | + |
| 177 | +# Make your changes |
| 178 | +# ... |
| 179 | + |
| 180 | +# Format and lint |
| 181 | +make fmt |
| 182 | +make lint |
| 183 | + |
| 184 | +# Run tests |
| 185 | +make test |
| 186 | +``` |
| 187 | + |
| 188 | +### 3. Test Locally |
| 189 | + |
| 190 | +```bash |
| 191 | +# Build and install locally |
| 192 | +make install |
| 193 | + |
| 194 | +# Test with your Terraform configuration |
| 195 | +cd examples/ |
| 196 | +terraform init |
| 197 | +terraform plan |
| 198 | +``` |
| 199 | + |
| 200 | +### 4. Submit Changes |
| 201 | + |
| 202 | +```bash |
| 203 | +# Run full test suite |
| 204 | +make test-all |
| 205 | + |
| 206 | +# Commit changes |
| 207 | +git add . |
| 208 | +git commit -m "feat: your feature description" |
| 209 | +git push origin feature/your-feature-name |
| 210 | + |
| 211 | +# Create pull request |
| 212 | +``` |
| 213 | + |
| 214 | +## Makefile Commands |
| 215 | + |
| 216 | +```bash |
| 217 | +# Build commands |
| 218 | +# Quality commands |
| 219 | +make fmt # Format Go code |
| 220 | +make lint # Run linters |
| 221 | +make vet # Run go vet |
| 222 | +# Quality commands |
| 223 | +make fmt # Format Go code |
| 224 | +make lint # Run linters |
| 225 | +make vet # Run go vet |
| 226 | + |
| 227 | +# Test commands |
| 228 | +make test # Run unit tests |
| 229 | +make test-coverage # Run tests with coverage |
| 230 | +make testacc # Run acceptance tests |
| 231 | +make test-all # Run all tests |
| 232 | + |
| 233 | +# Development commands |
| 234 | +make clean # Clean build artifacts |
| 235 | +make setup-dev # Setup development environment |
| 236 | +make docs # Generate documentation |
| 237 | +``` |
| 238 | + |
| 239 | +## Documentation |
| 240 | + |
| 241 | +- [Provider Documentation](https://registry.terraform.io/providers/wallix/wallix-bastion/latest/docs) |
| 242 | +- [API Documentation](https://docs.wallix.com/) |
| 243 | +- [Examples](./examples/) |
| 244 | + |
| 245 | +## Contributing |
| 246 | + |
| 247 | +We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. |
| 248 | + |
| 249 | +1. Fork the repository |
| 250 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 251 | +3. Make your changes and add tests |
| 252 | +4. Run the test suite (`make test-all`) |
| 253 | +5. Commit your changes (`git commit -m 'Add amazing feature'`) |
| 254 | +6. Push to the branch (`git push origin feature/amazing-feature`) |
| 255 | +7. Open a Pull Request |
| 256 | + |
| 257 | +## Version Compatibility |
| 258 | + |
| 259 | +| Provider Version | Terraform Version | Go Version | Wallix Bastion API | |
| 260 | +|------------------|-------------------|------------|-------------------| |
| 261 | +| >= 0.14.0 | >= 1.0 | 1.22-1.23 | v3.8, v3.12 | |
| 262 | +| 0.13.x | >= 0.14 | 1.19-1.21 | v3.3, v3.6 | |
| 263 | + |
| 264 | +## License |
| 265 | + |
| 266 | +This project is licensed under the Mozilla Public License 2.0 - see the [LICENSE](LICENSE) file for details. |
| 267 | + |
| 268 | +## Special Thanks |
| 269 | + |
| 270 | +We would like to greatly thanks: |
14 | 271 |
|
15 | 272 | - [Claranet](https://www.claranet.fr/) for their great work on this provider!
|
| 273 | +- The Terraform community for their continuous support and contributions |
| 274 | + |
| 275 | +## Support |
| 276 | + |
| 277 | +- 📖 [Documentation](https://registry.terraform.io/providers/wallix/wallix-bastion/latest/docs) |
| 278 | +- 🐛 [Issue Tracker](https://github.com/wallix/terraform-provider-wallix-bastion/issues) |
| 279 | +- 💬 [Discussions](https://github.com/wallix/terraform-provider-wallix-bastion/discussions) |
0 commit comments