Provider Configuration
This guide covers all configuration options for the Kubiya Control Plane Terraform Provider, including setup for both hosted (SaaS) and self-hosted deployments.Basic Configuration
The provider is configured using environment variables for authentication and connection settings:Environment Variables
Required Variables
KUBIYA_CONTROL_PLANE_API_KEY
Your Kubiya Control Plane API key for authentication.Optional Variables
KUBIYA_CONTROL_PLANE_BASE_URL
The base URL for your Kubiya Control Plane API. Default:https://control-plane.kubiya.ai (hosted/SaaS)
Hosted Control Plane Configuration
For the hosted Kubiya Control Plane (SaaS), minimal configuration is required:Step 1: Obtain API Key
- Visit https://compose.kubiya.ai
- Navigate to Settings → API Keys
- Click Generate New API Key
- Copy your API key (starts with
kcp_)
Step 2: Set Environment Variable
Step 3: Configure Provider
Self-Hosted Control Plane Configuration
For self-hosted deployments, you need to specify both the API key and your custom base URL:Step 1: Obtain API Key
- Access your self-hosted control plane dashboard
- Navigate to Settings → API Keys
- Generate and copy your API key
Step 2: Configure Environment Variables
Step 3: Configure Provider
Common Self-Hosted Scenarios
Internal Network Deployment
On-Premise with Custom Port
Local Development
Authentication Methods
API Key Authentication
The provider uses API key authentication via theAuthorization header.
Format: Authorization: Bearer <api-key>
API keys should:
- Start with
kcp_prefix - Be kept secure and never committed to version control
- Have appropriate permissions for the resources you’re managing
- Be rotated regularly per your security policies
API Key Permissions
Ensure your API key has the necessary permissions:
Contact your Kubiya administrator to configure API key permissions.
Secrets Management
For production environments, use secrets management solutions instead of plain environment variables:HashiCorp Vault
AWS Secrets Manager
Azure Key Vault
Google Cloud Secret Manager
CI/CD Integration
GitHub Actions
GitLab CI
Jenkins
CircleCI
Terraform Cloud / Enterprise
Configure environment variables in your workspace:Workspace Variables
- Navigate to your workspace in Terraform Cloud
- Go to Variables
-
Add environment variables:
- Key:
KUBIYA_CONTROL_PLANE_API_KEY - Value: Your API key
- Sensitive: ✓ (mark as sensitive)
- Category: Environment variable
- Key:
-
For self-hosted, also add:
- Key:
KUBIYA_CONTROL_PLANE_BASE_URL - Value: Your control plane URL
- Category: Environment variable
- Key:
Variable Sets
For managing multiple workspaces, create a variable set:Multiple Environments
Manage different environments with different configurations:Using Workspaces
Using Separate Directories
Using Environment-Specific Files
Troubleshooting
Connection Issues
Problem: Cannot connect to control plane- Verify
KUBIYA_CONTROL_PLANE_BASE_URLis correct - Check network connectivity
- Verify firewall rules allow access
- For self-hosted, ensure the control plane is running
Authentication Issues
Problem: Authentication failed- Verify API key is correct
- Check API key hasn’t expired
- Ensure API key has required permissions
TLS/SSL Issues
Problem: SSL certificate verification failed- Use properly signed certificates in production
- For development, consult your control plane docs for TLS configuration options
Best Practices
Security
- Never commit secrets: Use
.gitignoreto exclude files with secrets - Rotate API keys: Regularly rotate your API keys
- Use least privilege: Grant API keys only necessary permissions
- Audit access: Monitor API key usage through control plane logs
- Use secrets managers: Store credentials in dedicated secrets management systems
Configuration Management
- Environment-specific configs: Separate configurations per environment
- Version control: Track all Terraform configurations in Git
- Remote state: Use remote state backends with encryption
- State locking: Enable state locking to prevent concurrent modifications
- Consistent naming: Use clear, consistent naming conventions
Provider Versions
Pin provider versions for reproducibility:Next Steps
- Resource Documentation - Learn about available resources
- Data Sources - Query existing resources
- Modules - Use pre-built modules for common patterns
- Examples - Complete end-to-end examples
- API Reference - Control Plane API documentation