Terraform Provider
The ChatBotKit Terraform Provider enables you to manage your AI chatbot infrastructure using Terraform. Define bots, datasets, skillsets, integrations, and more through declarative configuration files, enabling version control, automated deployments, and infrastructure consistency across environments.
Features
The ChatBotKit Terraform Provider offers several powerful features for infrastructure management:
| Feature | Description |
|---|---|
| Infrastructure as Code | Manage ChatBotKit resources declaratively |
| Full Resource Coverage | Support for bots, datasets, skillsets, integrations, and more |
| Data Sources | Read existing resources for reference in configurations |
| Import Support | Bring existing resources under Terraform management |
| State Management | Track resource changes and drift detection |
| CI/CD Integration | Automate deployments through pipelines |
Installation
Add the provider to your Terraform configuration:
Then initialize Terraform:
Requirements
To use the ChatBotKit Terraform Provider, you need:
- Terraform 1.0 or higher
- A ChatBotKit API key from the Dashboard
Authentication
Configure authentication using either method:
Environment Variable (Recommended):
Provider Configuration:
When both are set, the provider configuration takes precedence over the environment variable.
Quick Start
Here's a complete example that creates a knowledge-based support bot:
Deploy with:
Resources
The provider supports the following resources:
Core Resources
| Resource | Description |
|---|---|
chatbotkit_bot | AI chatbot agents with configurable models and behaviors |
chatbotkit_dataset | Knowledge bases for retrieval-augmented generation |
chatbotkit_skillset | Collections of abilities (tools) for bots |
chatbotkit_skillset_ability | Individual abilities within a skillset |
chatbotkit_blueprint | Reusable templates for bot configurations |
chatbotkit_secret | Secure credential storage |
chatbotkit_file | File uploads for datasets and other uses |
chatbotkit_portal | Customer-facing portal configurations |
Integrations
| Resource | Description |
|---|---|
chatbotkit_slack_integration | Slack workspace integration |
chatbotkit_discord_integration | Discord bot deployment |
chatbotkit_telegram_integration | Telegram bot deployment |
chatbotkit_whatsapp_integration | WhatsApp Business integration |
chatbotkit_messenger_integration | Facebook Messenger integration |
chatbotkit_email_integration | Email-based interactions |
chatbotkit_twilio_integration | Twilio SMS/voice integration |
chatbotkit_widget_integration | Embeddable chat widget |
chatbotkit_notion_integration | Notion workspace sync |
chatbotkit_sitemap_integration | Website content ingestion |
Data Sources
Read existing resources without managing them:
Available data sources: chatbotkit_bot, chatbotkit_dataset, chatbotkit_blueprint, chatbotkit_skillset.
Bot Resource Example
Importing Resources
Bring existing resources under Terraform management:
CI/CD Integration
Example GitHub Actions workflow for automated deployments:
Best Practices
- Use Variables: Parameterize your configurations for reusability across environments
- Remote State: Use remote backends (S3, Terraform Cloud) for team collaboration
- Workspaces: Manage multiple environments (dev, staging, prod) with workspaces
- Lifecycle Rules: Use
prevent_destroyfor critical production resources - Metadata: Tag resources with
metafor organization and filtering
Additional Resources
- Terraform Provider Manual - Comprehensive technical documentation
- Terraform Registry - Official provider page
- GitHub Repository - Source code and issues
- API Documentation - ChatBotKit API reference