back to docs

Terraform Provider

ChatBotKit Terraform Provider allows you to manage your AI chatbot infrastructure as code. Learn how to install, configure, and use the provider to deploy bots, datasets, skillsets, and integrations.

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:

FeatureDescription
Infrastructure as CodeManage ChatBotKit resources declaratively
Full Resource CoverageSupport for bots, datasets, skillsets, integrations, and more
Data SourcesRead existing resources for reference in configurations
Import SupportBring existing resources under Terraform management
State ManagementTrack resource changes and drift detection
CI/CD IntegrationAutomate 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

ResourceDescription
chatbotkit_botAI chatbot agents with configurable models and behaviors
chatbotkit_datasetKnowledge bases for retrieval-augmented generation
chatbotkit_skillsetCollections of abilities (tools) for bots
chatbotkit_skillset_abilityIndividual abilities within a skillset
chatbotkit_blueprintReusable templates for bot configurations
chatbotkit_secretSecure credential storage
chatbotkit_fileFile uploads for datasets and other uses
chatbotkit_portalCustomer-facing portal configurations

Integrations

ResourceDescription
chatbotkit_slack_integrationSlack workspace integration
chatbotkit_discord_integrationDiscord bot deployment
chatbotkit_telegram_integrationTelegram bot deployment
chatbotkit_whatsapp_integrationWhatsApp Business integration
chatbotkit_messenger_integrationFacebook Messenger integration
chatbotkit_email_integrationEmail-based interactions
chatbotkit_twilio_integrationTwilio SMS/voice integration
chatbotkit_widget_integrationEmbeddable chat widget
chatbotkit_notion_integrationNotion workspace sync
chatbotkit_sitemap_integrationWebsite 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

  1. Use Variables: Parameterize your configurations for reusability across environments
  2. Remote State: Use remote backends (S3, Terraform Cloud) for team collaboration
  3. Workspaces: Manage multiple environments (dev, staging, prod) with workspaces
  4. Lifecycle Rules: Use prevent_destroy for critical production resources
  5. Metadata: Tag resources with meta for organization and filtering

Additional Resources