Skip to main content

Deploy with Terraform

Ori allows you to use Terraform tool for deploying packages.

Using Terraform provider you can deploy a package to dired environments.

The following is the Deployment and Environment resource that needs to be added:

resource "ogc_deployment" "deployment" {
package_id = ogc_package.package.id
project_id = ogc_project.project.id
environment_id = ogc_environment.environment.id
}
resource "ogc_environment" env {
display_name = "Test Environment"
name = "test"
description = "A description"
project_id = ogc_project.project.id
}
note

This is an alternative to deploying packages via the OGC-UI platform, previously described.

Refer to the Terraform documentation: https://registry.terraform.io/providers/ori-edge/ogc/latest/docs

In order to use the OGC terraform provider, you first need to create an account in OGC and generate an API token under your organisation settings.

Then, set the OGC_ACCESS_TOKEN environment var with your access token:

export OGC_ACCESS_TOKEN='api|xxxxxxxxxx'

Follow our GitHub repo, where you can find further details about running Terraform. https://github.com/ori-edge/terraform-provider-ogc/tree/main/examples/use_case/wordpress