---
title: Using Terraform with OCI
slug: how-to-guides/using-terraform-with-oci
docTags: 
createdAt: 2026-05-26T16:06:15.297Z
---

Terraform is a tool created by HashiCorp that lets you define, provision, and manage cloud infrastructure using code. Instead of writing manual deployment steps, you define the desired end state of your infrastructure, and Terraform determines how to build it.

Terraform with Oracle Cloud Infrastructure (OCI) means using Infrastructure as Code to create and manage Oracle Cloud resources like VCNs, subnets, compute instances, databases, IAM, load balancers, and OKE clusters.

While this guide focuses on OCI, you can apply the same approach to any cloud provider Terraform supports.

To learn more about Terraform, see HashiCorp's documentation: [Automate Infrastructure on Any Cloud](https://developer.hashicorp.com/terraform).

# Content

- Create a Terraform-enabled Broadcaster Cluster
- (Optional) Create a Broadcaster Placeholder
- Complete Prerequisites
- Create OCI Objects
- Customize Terraform Variables
- Run Terraform Script

# Create a Terraform-enabled Broadcaster Cluster

First, use ZEN Master to create a Zixi Broadcaster Cluster that is enabled for Terraform scripts. The Cluster ID and name will be passed in the Terraform script.

:::::WorkflowBlock
:::WorkflowBlockItem
In a web browser, navigate to **https\://&#x7B;youraccount}.zen.zixi.com**
:::

:::WorkflowBlockItem
When you sign in, you should see the Zixi ZEN Master dashboard.
:::

:::WorkflowBlockItem
In the left navigation, select **Broadcasters**.
:::

:::WorkflowBlockItem
Click **+Add** to create a new Broadcaster Cluster.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/30mN7l9l1n5MXZV9DE6Du_image.png)
:::

:::WorkflowBlockItem
In the **Create New Broadcaster Cluster** dialog, provide a Cluster **Name** and one or more **Tags**.
:::

:::WorkflowBlockItem
For **Management Type**, select **Manual**.
:::

:::WorkflowBlockItem
Select the checkbox for **Terraform Deployment Support**.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/vjWljUc8wcPGrryFXcFtE_image.png)
:::

::::WorkflowBlockItem
For **Broadcaster Version**, select the desired Broadcaster version that you would like to run on your cloud service machines.

:::hint{type="info"}
- Broadcaster versions available for your account can be viewed and modified on the Customer Portal.
- Select a Broadcaster version that supports the type of processing that will be done on this Cluster.
:::
::::

:::WorkflowBlockItem
For **Activation Key**, enter your Zixi Broadcaster license activation key.
:::

:::WorkflowBlockItem
For **SSH Key**, enter the SSH key pair used to establish a secure SSH tunnel and allow ZEN Master to access and manage the Broadcaster.
:::

:::WorkflowBlockItem
For **API User**, enter the username for ZEN Master to access the Broadcaster API.
:::

:::WorkflowBlockItem
For **API Password**, enter the password for ZEN Master to access the Broadcaster API.
:::

:::WorkflowBlockItem
Customize the other Cluster fields as needed. For details, see [Adding a Broadcaster Cluster – Manual](docId\:lUGqITvwdm0YIpL102_px).
:::
:::::

# (Optional) Create a Broadcaster Placeholder

When using Terraform, creating a Broadcaster in ZEN Master is optional. If you want to set the Broadcaster name and override some configuration fields, you can create a Broadcaster placeholder in ZEN Master that OCI will use.

When OCI creates Broadcasters, it creates system-generated Broadcaster names.

:::::WorkflowBlock
:::WorkflowBlockItem
Return to ZEN Master.
:::

:::WorkflowBlockItem
In the left navigation, select **Broadcasters**.
:::

:::WorkflowBlockItem
In the Broadcaster Cluster list, click on your Cluster name that is configured for Terraform Deployment Support.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/75zFTKjzvqo-GKXxwm9na_image.png)
:::

:::WorkflowBlockItem
In the Broadcaster Cluster details screen, click **+ Add Broadcaster**.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/p-6Tu7spSREJCaxKyfx9y_image.png)
:::

:::WorkflowBlockItem
In the **Create New Broadcaster** dialog, provide a **Name.**

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/LChEHvprNBioeBaHwYA96_image.png)
:::

:::WorkflowBlockItem
For **API User**, enter the username for ZEN Master to access the Broadcaster API.
:::

:::WorkflowBlockItem
For **API Password**, enter the password for ZEN Master to access the Broadcaster API.
:::

:::WorkflowBlockItem
For **SSH Key**, enter the SSH key pair used to establish a secure SSH tunnel and allow ZEN Master to access and manage the Broadcaster.
:::

:::WorkflowBlockItem
Customize the other Broadcaster fields as needed. For details, see [Adding a Broadcaster to a Manual Cluster](docId\:xYscySO498lY77ZjQr-51).
:::

::::WorkflowBlockItem
:::hint{type="info"}
- Values that you set when creating a Broadcaster placeholder will override the values from the Cluster.
- Creating a placeholder allows you to specify a custom Broadcaster name. Otherwise, the Terraform script creates system-generated Broadcaster names.
:::


::::
:::::

# Complete Prerequisites

Review the Zixi public repo for using Terraform with OCI and install the system requirements.

::::WorkflowBlock
:::WorkflowBlockItem
In a browser, navigate to the Zixi Customer Portal ([https://portal.zixi.com) ](https://portal.zixi.com)and log in with your credentials.
:::

:::WorkflowBlockItem
In the left navigation, select **Documentation**.
:::

:::WorkflowBlockItem
Select **BY TYPE** and then **ZEN Master**.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/vHDqCqTgv5vFFVrfGCkSN_image.png)
:::

:::WorkflowBlockItem
Download the **TerraformOCIRepo.zip** file and unzip it.
:::

:::WorkflowBlockItem
In the **OCI-Broadcast-Cluster-TF** repo, open the **README.md** file.
:::

:::WorkflowBlockItem
Review the **Prerequisites** section and follow the steps:

- Install Terraform CLI on your computer.
- Create an OCI API Key.
- Upload the public key file (public.pem) to the OCI console.
- Copy the fingerprint shown after you upload the public key file.
:::
::::

# Create OCI Objects

Before running the Terraform script, the following OCI resources must exist.

::::WorkflowBlock
:::WorkflowBlockItem
Return to the **README.md** file in the **OCI-Broadcast-Cluster-TF** repo.
:::

:::WorkflowBlockItem
Review the **OCI Prerequisites** section to create OCI objects.
:::

:::WorkflowBlockItem
In a browser, navigate to and log in to the Oracle dashboard.
:::

:::WorkflowBlockItem
Using the Oracle dashboard, create the following objects:

- **Compartment** - A fundamental logical container within Oracle Cloud Infrastructure used to organize, isolate, and secure cloud resources.
- **VCN** - A Virtual Cloud Network (VCN) with a public subnet and an Internet Gateway (IGW) is the standard baseline setup for running public-facing cloud infrastructure.
- **NSG** - Network Security Groups (NSGs) allow you to apply granular firewall rules directly to specific virtual network cards (VNICs).
- **Vault** - Used to securely store your ZM API key (or any other media orchestration credentials) in OCI.
- **Master Encryption Key** - Before you can save a secret, OCI requires a master key to encrypt the secret's contents.
- **Secret** - Now that the vault structure and encryption framework are ready, you can create the actual secret.
- **Dynamic Group** - This allows your compute instances to securely access cloud resources—like pulling that ZM API key from the OCI Vault you just created—without hardcoding user credentials on the server.
- **IAM Policy** - Because you want this policy to apply to the tenancy level rather than just a single sub-compartment, the policy file itself must be attached to your Root compartment.
:::
::::



# Customize Terraform Variables

Review and customize the Terraform variables used by the script.

:::::WorkflowBlock
:::WorkflowBlockItem
Return to the **OCI-Broadcast-Cluster-TF** repo.
:::

::::WorkflowBlockItem
Open the **CUSTOMER\_INPUTS.md** file. Use this as a reference that defines all the variables you will configure. You will NOT update this file.

:::hint{type="info"}
What you will edit:

- terraform.tfvars - Variable values

What you will NOT edit:

- Terraform resource structure
- Cloud-init bootstrap logic
:::
::::

:::WorkflowBlockItem
Duplicate the **terraform.tfvars.example** file and rename it **terraform.tfvars**
:::

:::WorkflowBlockItem
Open the newly created **terraform.tfvars** file. This is the **only file** you will edit. Customize this file with your variable values.

![](https://api.archbee.com/api/optimize/mzxtTQEvCNIdUNgF2kuwJ/0eKmKJMCi2QfOnjIrdlaL_image.png)
:::
:::::



# Run Terraform Script

Running a Terraform script with OCI follows the standard "Init, Plan, Apply" workflow.  Under the hood, it instructs Oracle's cloud API to build, modify, or destroy Oracle-specific resources.

::::WorkflowBlock
:::WorkflowBlockItem
In a terminal window on your computer, navigate to the **OCI-Broadcast-Cluster-TF** repo folder.
:::

:::WorkflowBlockItem
First, run the **init** command (Setup):

This prepares your working directory and downloads plugins.

- It reads your code, determines the cloud provider, and downloads the plugins needed to talk to those APIs.
- It sets up the backend with your state file.

```bash
terraform init
```
:::

:::WorkflowBlockItem
Next, run the **plan** command (Preview):

This lets you see what Terraform intends to do before making any changes to your cloud environment.

- It checks the current state of your cloud infrastructure.
- It generates a list of what will be created, modified, or destroyed.

```bash
terraform plan
```
:::

:::WorkflowBlockItem
Then, run the **apply** command (Execute):

This takes your configuration and updates your cloud infrastructure.

- It makes the API calls to your cloud provider to build, update, or delete resources.
- Once the resources are built, Terraform records their IDs and metadata into your state file.

```bash
terraform apply
```
:::

:::WorkflowBlockItem
For more details about working with OCI, see Terraform's document: [Get Started - OCI](https://developer.hashicorp.com/terraform/tutorials/oci-get-started)
:::
::::

:::hint{type="info"}
Notes:

- The script sets up an OCI vault and secret to securely store the ZEN Master API Key. No credentials are stored on the instances.
- The cloud-init script makes calls to the ZEN Master API.
- Cluster and Broadcaster management is still done within ZEN Master.
- If you want another instance, modify the template, redeploy, and Terraform takes care of it.
- If you want custom images (AMIs), add them to the script.
:::

