Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/galleybytes/terraform-operator-api
https://github.com/galleybytes/terraform-operator-api
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/galleybytes/terraform-operator-api
- Owner: GalleyBytes
- License: apache-2.0
- Created: 2022-10-20T19:45:51.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T17:02:31.000Z (8 months ago)
- Last Synced: 2024-05-20T18:12:57.883Z (8 months ago)
- Language: Go
- Size: 265 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Operator API
The Terraform Operator API provides endpoints for managing infrastructure resources using Terraform. This README explains how to set up the development environment and configure the server.
## Prerequisites
Before running the server, make sure you have the following prerequisites installed:
- Go (version 1.16 or higher)
- Git
- Docker (optional, for containerized development)## Installation
1. Clone the repository:
`git clone https://github.com/GalleyBytes/terraform-operator-api.git `
2. Navigate to the project directory:
`cd terraform-operator-api `
3. Install Go dependencies:
`go mod download `
## Configuration
### Environment Variables
Export the following environment variables
- `KUBECONFIG`: The kubernetes cluster API config (In-cluster is used when running in a Kubernetes pod)
- `ADDR`: The address on which the server will listen (default: `0.0.0.0:3000`)
- `DB_URL`: Connection string for your database (if applicable)### Flags
You can also configure the server using command-line flags:
- `--addr`: Specify the address (e.g., `--addr ':3000'`)
- `--db-url`: Specify the database connection string (e.g., `--db-url postgres://user:password@localhost/dbname`)## Running the Server
To start the API server, run:
`go run cmd/main.go `
The server will be accessible at `http://localhost:3000` (or the specified port).
## Testing
Use tools like `curl` or Postman to test the API endpoints. Verify that the responses match your expectations.