This repository contains Terraform related configs for dYdX
chain used for testing purposes.
We use Terraform Cloud to deploy and manage infrastructure resources. Terraform Cloud helps with Terraform state management as well as automating the deployment pipeline (i.e. deploying infra changes made in this Github repo).
Install the terraform cli using tfenv. We currently use version 1.3.2 of terraform.
Terraform Cloud account for dYdX v4: link
This workspace is configured using The CLI-driven Run Workflow.
- Install
terraform
if you haven't done so already following the instructions here.- Running
terraform --version
should output a version>= v1.3.2
.
- Running
- Login to Terraform Cloud via
terraform login
. You will be asked to create a token and provide it to the CLI. cd
into the relevant folder, for example/indexer
,/metrics_ingestor
, or/indexer_dashboards
.- Initialize terraform if you haven't done so already with
terraform init
. - Run
terraform workspace select indexer-dev
to select the dev workspace forvalidators
. You can also runterraform workspace list
to see available workspaces. - Once you've selected the
indexer-dev
workspace, feel free to runterraform plan
andterraform apply
to trigger your runs. Note that these runs will still take place remotely in Terraform Cloud, but the output will be streamed to your machine.
-
Go to the corresponding Terraform Cloud workspace (i.e. https://app.terraform.io/app/dydxprotocol/workspaces/validators-staging)
-
Go to
Runs
tab -
Identify or Trigger
Run
:
- If you recently merged a PR to the
main
branch, then you would see aRun
already triggered. Use the triggeredRun
in this case. - Otherwise, trigger a new
Run
by selectingActions > Start new run
. Use the newly triggeredRun
in this case.
Note: in some cases, if previous runs have not been applied, you will see a list of runs that are queued. In this case, one way to resolve this is to cancel all previous runs and then triggering a new fresh run via UI.
-
Review the
plan
output. Ensure that the resources being created, updated or destroyed are intended. -
Confirm & Apply via UI.
For datadog-specific instructions, follow the instructions here