Prerequisites
Before you begin, ensure you have:- Terraform installed (version 1.0 or later)
- A Streamkap account with access to a Service
- API credentials (Client ID and Secret) from Streamkap
Step 1: Create API Credentials
1
Navigate to API Tokens
Log in to your Streamkap account and go to the Services page.
2
Open API Tokens
For your Service, click the menu (three dots) and select API Tokens.
3
Create a new token
Click Create API Token, enter a description (e.g., “Terraform automation”), select the appropriate role(s), and click Create Token.
4
Save credentials securely
Copy the Client ID and Token immediately. The token is only shown once.
Step 2: Configure Credentials
Set your credentials as environment variables. This is the recommended approach for security.- macOS / Linux
- Windows (PowerShell)
- Windows (CMD)
~/.bashrc, ~/.zshrc, or equivalent shell configuration file.Step 3: Create Your Terraform Configuration
Create a new directory for your Terraform project and add the followingmain.tf file:
The provider automatically reads credentials from the
STREAMKAP_CLIENT_ID and STREAMKAP_SECRET environment variables. You can also set them directly in the provider block, but this is not recommended for security reasons.Step 4: Initialize and Apply
Run the following commands in your project directory:Provider Configuration Reference
The Streamkap provider supports the following configuration options:| Parameter | Environment Variable | Default | Description |
|---|---|---|---|
client_id | STREAMKAP_CLIENT_ID | - | Your Streamkap API client ID |
secret | STREAMKAP_SECRET | - | Your Streamkap API token/secret |
host | STREAMKAP_HOST | https://api.streamkap.com | API endpoint URL |
Example: Creating a PostgreSQL Source
Here’s an example of defining a PostgreSQL source connector:Use Terraform variables for sensitive values like passwords. See Terraform Input Variables for more information.
Project Structure Recommendation
For larger projects, organize your Terraform files like this:.gitignore file you case use to exclude sensitive files:
Next Steps
- Browse the Streamkap Terraform Provider on the HashiCorp Registry for all available resources and data sources
- Learn about Terraform state management for team workflows
- See API Tokens for more details on managing Streamkap credentials