This feature is in Beta development.
Introduction
Terraform is an infrastructure-as-code tool from Hashicorp that lets you define, create, and manage resources using a code-based approach. Mezmo has implemented a Terraform provider that gives you the ability to build and manage your telemetry data Pipelines with Terraform. This makes managing your pipelines easier and simpler by allowing you to:- Store your Pipelines as code
- Version your Pipelines in your source control
- Have multiple users collaborate on Pipelines outside of a user interface
- Quickly and easily replicate Pipelines
Getting Started
You will need:- A Pipeline Service Key. Create a new Pipeline Service Key by accessing Settings > API Keys > Pipeline Service Keys.
- A local Terraform installation for your system
auth_key = "<YOUR TOKEN>" configuration option in the provider configuration object as shown here:
Your First Terraform Pipeline
Now that you’ve installed the Mezmo Terraform provider, you can generate Pipelines directly within your account based on the generated Pipeline service key. In the public repository on github.com/mezmo, you will find examples of Pipelines and other resources you can use to get started. This is a simple placeholder example you can try out, which will then reflect in your environment.plan command does not execute the configuration changes, but computes how they would be enacted. Practically this means that Terraform will list the changes to apply. You should see an output similar to this example:
plan returns the expected changes. If this is your first Pipeline, it will list creation of all of the resources.
Once you’re ready to deploy your Terraform Pipeline, use the apply command. This command results in the execution of the computed changes between your Terraform file and your environment. You will have to confirm you want to make the changes to your environment.
You’ve just created your first Terraform pipeline! However, be aware the Pipeline is not deployed automatically. You will need to log into the Mezmo Web App to test and deploy your Pipeline.
State is an important concept in Terraform. Terraform assumes that you will only manage your resources via Terraform itself. This means if you edit your configuration anywhere else than Terraform, you risk getting out of sync with the state of your resources. If you try to edit your Pipelines in the Mezmo UI, a similar issue can occur, because your resources may become out of sync with your Terraform state. This can lead to unexpected behavior. For this reason, we’ve restricted editing Pipelines created by Terraform in the UI. This way you can view and reference the Pipelines in the UI, but limit the risk of having unexpected changes because of the Terraform state. .

