C3 AI Documentation Home

Download and Apply C3 AI Terraform Modules

C3 AI uses Terraform for C3 AI Agentic AI Platform installation. This topic provides guidance on how to download and run the C3 AI Terraform modules. Complete this as part of the infrastructure requirements for your platform deployment.

Prerequisites

If you are installing and deploying the platform for your organization, see the following documentation before you download and run the platform Terraform modules:

Required inputs

This process requires the following values:

  • <module_version>: Terraform module version for your cloud provider. See C3 AI Platform Install and Upgrade Requirements.

  • <c3crds_version>, <c3aiops_version>, <c3server_version>: Helm chart versions for your platform version. See C3 AI Platform Install and Upgrade Requirements.

  • <registry_username>, <registry_password>: C3 AI JFrog registry credentials. C3 AI provides you a registry username and password to download the Terraform modules from a JFrog registry.

  • <cluster_id>: Cluster name. The cluster name must:

    • Not include a hyphen
    • Start with a letter
    • Only use lowercase letters and numbers, no special characters or accented letters
    • Have less than 15 characters total

    Refer to the C3 AI Installation Guides for information on rules that your cluster name must follow and example cluster names.

Run the following commands in the host machine's command line to download and apply the standard C3 AI Terraform modules.

Download and run Terraform modules

Complete the following steps:

  1. Create directory structure
  2. Download modules
  3. Prepare modules
  4. Run modules
  5. Update Postgres password

1. Create directory structure

Create the directories for the Terraform modules:

Command Line
mkdir -p \
  <cluster_id>/tf/bootstrap \
  <cluster_id>/tf/c3cluster \
  <cluster_id>/tf/modules/<module_version>

2. Download modules

  1. Authenticate to the Docker C3 AI registry with your provided registry credentials:

    Command Line
    docker login registry.c3.ai --username <registry_username> --password <registry_password>
  2. Download the required Terraform modules from the C3 AI JFrog registry:

    Command Line
    wget https://jfrog.c3.ai/artifactory/tf-registry/c3/<cloud_provider>/c3/<terraform_version>.zip \
    -O <cluster_id>/tf/modules/<terraform_version>.zip \

    Replace <cluster_id> with your cluster name, <cloud_provider> with your cloud provider, and <terraform_version> with the Terraform module version from the "Cloud access requirements section" in the installation guides at https://c3.ai/legal/.

  3. Extract and navigate to the Terraform modules:

    Command Line
    unzip <cluster_id>/tf/modules/<terraform_version>.zip -d <cluster_id>/tf/modules/<terraform_version>

3. Prepare modules

  1. Copy the example bootstrap and c3cluster main.tf files from the module:

    Command Line
    cp \
        <cluster_id>/tf/modules/<terraform_version>/examples/standard/bootstrap/main.tf \
        <cluster_id>/tf/bootstrap/main.tf
    cp \
        <cluster_id>/tf/modules/<terraform_version>/examples/standard/c3cluster/main.tf \
        <cluster_id>/tf/c3cluster/main.tf
  2. Note that the bootstrap and c3cluster main.tf files do not specify the Terraform module version. Update the files to reference the locally extracted modules and specify the <terraform_version>.

    Update the following sections in bootstrap/main.tf and c3cluster/main.tf:

    Text
    # bootstrap/main.tf
    module "bootstrap" {
        source  = "jfrog.c3.ai/tf-registry__c3/azure/c3//modules/bootstrap"
        version = ">=1.0, < 1.1"
        # ...
        }
    # c3cluster/main.tf
    module "c3cluster" {
        source  = "jfrog.c3.ai/tf-registry__c3/azure/c3"
        version = ">=1.0, < 1.1"
        # ...
        }

    Here are examples of bootstrap/main.tf and c3cluster/main.tf that specify a <terraform_version>:

    Text
    # bootstrap/main.tf
        module "bootstrap" {
        source = "../../modules/<terraform_version>/modules/bootstrap"
        # ...
        }
    # c3cluster/main.tf
        module "c3cluster" {
        source = "../../modules/<terraform_version>"
        # ...
        }

    Refer to the C3 AI Installation Guides for more information about the main.tf file.

4. Run modules

Run the Terraform modules:

Command Line
cd ./bootstrap/
terraform init
terraform plan -out tfplan
terraform apply tfplan

cd ./c3cluster/
terraform init
terraform plan -out tfplan
terraform apply tfplan

5. Update Postgres password

Terraform creates a Postgres instance and you must update its password after you apply the Terraform modules. Here is an example command to update the password for Azure. Adjust accordingly for your cloud provider.

Command Line
az postgres flexible-server update --name <server_name> --resource-group <resource_group> --admin-password <pg_password>

You will use this password in a later step at C3 AI Helm Chart Overview and Installation.

Next step

After you download, upload, and run the C3 AI Terraform modules, ensure your organization meets the rest of the requirements in Non-Standard Deployment Requirements.

Was this page helpful?