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
terraformif you haven't done so already following the instructions here.- Running
terraform --versionshould 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. cdinto 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-devto select the dev workspace forvalidators. You can also runterraform workspace listto see available workspaces. - Once you've selected the
indexer-devworkspace, feel free to runterraform planandterraform applyto 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
Runstab -
Identify or Trigger
Run:
- If you recently merged a PR to the
mainbranch, then you would see aRunalready triggered. Use the triggeredRunin this case. - Otherwise, trigger a new
Runby selectingActions > Start new run. Use the newly triggeredRunin 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
planoutput. Ensure that the resources being created, updated or destroyed are intended. -
Confirm & Apply via UI.
For datadog-specific instructions, follow the instructions here