Engineers & Developers

Terraform and CDP: Manage your data infra as code

Segment Terraform is now Generally Available.

Apr 9, 2024

By Kurt Lu, Dean Huynh


Data & Marketing teams increasingly treat their Customer Data Platforms (CDPs) as mission critical systems. As business requirements evolve, a CDP deployment needs to evolve with it – but doing so can require advanced configuration and careful management to ensure data continuity. Modern engineering teams have learned that the best way to manage critical systems is infrastructure-as-code (IaC), a pattern in which configuration is expressed as files rather than UIs or scripts. 

Today, we're enabling every team to manage their CDP-as-code, with Segment Terraform. With Segment Terraform, setting up and managing Segment is easier and more scalable than ever. 

Segment launched our Terraform provider in 2023 to provide organizations with a powerful solution to manage versioning and state for Segment's data collection and distribution capabilities.  By leveraging Terraform's declarative syntax and state management features, organizations can automate configuration and maintenance of Segment resources.

We initially launched the feature in Pilot, and we've seen the way it's transformed teams’ ability to manage their CDP at scale.  We are announcing Generally Availability.

image1

Why Terraform?

Terraform is an open source solution to provision and manage infrastructure and can serve the same use cases for platforms.  In fact, Twilio’s Terraform provider serves as an inspiration for Segment to invest in this for our customers.

Key features include:

  • Declarative Syntax: Infrastructure resources are defined using a simple and human-readable configuration language.

  • Multi-Cloud Support: Terraform supports multiple cloud providers, including AWS, Azure, Google Cloud, and more, allowing organizations to maintain a multi-cloud strategy.

  • State Management: Terraform keeps track of the state of deployed infrastructure, enabling changes to be applied incrementally and predictably.

  • Modularity: Infrastructure configurations can be organized into reusable modules, promoting consistency and scalability.

Most importantly, we heard from our customers who view Terraform as their centralized means for IAC.  With Terraform, Segment customers can manage the state of their Workspace, handle drift, and perform mutations programmatically.

Value for Customers

Since our initial launch, we’ve had 200,000 total API requests run from Terraform.  While the majority of resource utilization is for destinations and sources, the core foundation for Segment, customers are also managing Tracking Plans, Functions, IAM, and Reverse ETL models.

image1

Use cases for managing Segment:

  • Refresh or revert the state of a Workspace

  • Update sources and destinations as you provision infrastructure resources

  • Centrally manage IAM between production and sandbox environments

What is supported with Segment’s Terraform Provider?

Our goal is to maintain parity with Segment Public API while also relying on our growing community.  We initially launched the Pilot with a few resources, and we now support additional resources that are available with Public API:

  • Connections, including Destination Filters

  • Tracking Plans

  • Functions

  • Transformations

  • Profiles Sync and Reverse ETL

  • IAM and Labels

Resources and Tips

Check out the Terraform Registry with an overview of our resources:  https://registry.terraform.io/providers/segmentio/segment/latest 

Our GitHub repository provides information about changes and learnings from our developer community: https://github.com/segmentio/terraform-provider-segment 

We can’t wait to see what you build!

Test drive Segment CDP today

It’s free to connect your data sources and destinations to the Segment CDP. Use one API to collect analytics data across any platform.

Get started
TS-CTA-Developer-Focus

Test drive Segment CDP today

It’s free to connect your data sources and destinations to the Segment CDP. Use one API to collect analytics data across any platform.

Get started
TS-CTA-Developer-Focus

Share article

Want to keep updated on Segment launches, events, and updates?

We’ll share a copy of this guide and send you content and updates about Twilio Segment’s products as we continue to build the world’s leading CDP. We use your information according to our privacy policy. You can update your preferences at any time.