> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Manage your Streamkap resources as infrastructure-as-code using Terraform.

The Streamkap Terraform Provider lets you manage data integration infrastructure using Terraform's declarative configuration language. Define sources, destinations, pipelines, and transforms **as code** for version control, reproducibility, and automation.

<Snippet file="terraform-beta-warning.mdx" />

## What is Terraform?

[Terraform](https://www.terraform.io/) is an infrastructure-as-code (IaC) tool that allows you to define and provision infrastructure using a declarative configuration language. Instead of manually configuring resources through a UI, you write configuration files that describe your desired state, and Terraform handles creating, updating, and deleting resources to match.

## Why Use Terraform with Streamkap?

<CardGroup cols={2}>
  <Card title="Version Control" icon="code-branch">
    Track changes to your data infrastructure in Git alongside your application code.
  </Card>

  <Card title="Reproducibility" icon="copy">
    Easily replicate your Streamkap setup across development, staging, and production environments.
  </Card>

  <Card title="Automation" icon="robot">
    Integrate with CI/CD pipelines for automated infrastructure deployment and updates.
  </Card>

  <Card title="Documentation" icon="file-lines">
    Your Terraform configuration serves as living documentation of your data infrastructure.
  </Card>
</CardGroup>

## Available Resources

The provider supports all Streamkap connector types — sources, destinations, transforms, pipelines, topics, and data sources. The beta version exposes significantly more connectors and transform resources than the stable version. See the [Resource Reference](/terraform-resources) for the full list with registry links, or browse the [HashiCorp Registry](https://registry.terraform.io/providers/streamkap-com/streamkap/latest/docs) for complete attribute documentation and examples.

## Quick Example

```hcl theme={null}
terraform {
  required_providers {
    streamkap = {
      source  = "streamkap-com/streamkap"
      version = "3.0.0-beta.6"
    }
  }
}

provider "streamkap" {}

# Define a PostgreSQL source
resource "streamkap_source_postgresql" "orders_db" {
  name              = "orders-database"
  database_hostname = "db.example.com"
  database_port     = 5432
  database_dbname   = "orders"
  database_user     = var.db_username
  database_password = var.db_password
  database_sslmode  = "require"

  schema_include_list = "public"
  table_include_list  = "public.orders,public.customers"
  
  snapshot_read_only  = "No"
  signal_data_collection_schema_or_database    = "streamkap.streamkap_signal"
  heartbeat_enabled                            = true
  heartbeat_data_collection_schema_or_database = "streamkap"

  slot_name        = "streamkap_slot"
  publication_name = "streamkap_pub"
}

# Define a Snowflake destination
resource "streamkap_destination_snowflake" "warehouse" {
  name                    = "analytics-warehouse"
  snowflake_url_name      = var.snowflake_url
  snowflake_user_name     = var.snowflake_user
  snowflake_private_key   = var.snowflake_private_key
  snowflake_database_name = "ANALYTICS"
  snowflake_schema_name   = "PUBLIC"
  snowflake_role_name     = "STREAMKAP_ROLE"
  sfwarehouse             = "COMPUTE_WH"
}

# Create a pipeline connecting them
resource "streamkap_pipeline" "orders_to_snowflake" {
  name                = "orders-pipeline"
  snapshot_new_tables = true

  source = {
    id        = streamkap_source_postgresql.orders_db.id
    name      = streamkap_source_postgresql.orders_db.name
    connector = streamkap_source_postgresql.orders_db.connector
    topics    = ["public.orders", "public.customers"]
  }

  destination = {
    id        = streamkap_destination_snowflake.warehouse.id
    name      = streamkap_destination_snowflake.warehouse.name
    connector = streamkap_destination_snowflake.warehouse.connector
  }
}
```

## Next Steps

<CardGroup cols={3}>
  <Card title="Install Terraform" icon="download" href="/terraform-installation">
    Install Terraform CLI on macOS, Windows, or Linux
  </Card>

  <Card title="Configuration" icon="gear" href="/terraform-configuration">
    Set up credentials and create your first configuration
  </Card>

  <Card title="Resource Reference" icon="book" href="/terraform-resources">
    Browse all available resources with examples
  </Card>
</CardGroup>

## Additional Resources

* [Streamkap Provider on HashiCorp Registry](https://registry.terraform.io/providers/streamkap-com/streamkap/latest/docs) - Full attribute documentation
* [Provider Source Code on GitHub](https://github.com/streamkap-com/terraform-provider-streamkap) - Report issues and contribute
* [Terraform Documentation](https://developer.hashicorp.com/terraform/docs) - Learn Terraform fundamentals
* [API Tokens](/api-tokens) - Create credentials for the provider
* [Agents](/agents) - Use Terraform with AI agents via [Terraform MCP servers](https://developer.hashicorp.com/terraform/mcp-server)
