This directory contains Terraform configs to deploy a self-contained Aptos testnet with multiple validators. It uses the Helm chart, AWS Terraform and vault-init Terraform to create an environment which is very similar to production and able to test most of the production configs.
This README contains documentation on how to connect to an existing testnet and also how to create an entirely new one.
Note: the testnet Terraform accepts various variables to configure testnet
resources. These will need to be provided on each invocation of
terraform apply/plan/destroy
. In the following examples, we will use the
placeholder: -var-file testnet.tfvars
. A similar placeholder will
be used for the Terraform backend configuration.
-
Install dependencies:
- Terraform 1.0.0: https://www.terraform.io/downloads.html
- kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
-
Setup cloud access if necessary.
-
Initialize Terraform, providing your S3 backend details (see example backend.tfvars file):
$ terraform init -backend-config backend.tfvars
-
Switch to the existing workspace:
$ terraform workspace select dev
-
Apply the Terraform, targeting the Kubernetes cluster and Vault server (see example testnet.tfvars file):
$ terraform apply -var-file testnet.tfvars -target module.validator
-
Configure
kubectl
with the Kubernetes cluster:$ aws eks update-kubeconfig --name aptos-<workspace>
-
Install dependencies:
- Terraform 1.1.0: https://www.terraform.io/downloads.html
- kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
- Vault: https://www.vaultproject.io/downloads
-
Setup cloud access if necessary.
-
Initialize Terraform, providing your S3 backend details (example backend.tfvars file):
$ terraform init -backend-config backend.tfvars
-
If using an existing workspace, switch to it:
$ terraform workspace select dev
Or create a new workspace for a new deployment:
$ terraform workspace new $USER
-
Apply the Terraform, targeting the Kubernetes cluster and Vault server (see example testnet.tfvars file):
$ terraform apply -var-file testnet.tfvars -target module.validator
-
Apply the Terraform, targeting the Vault initialization:
$ terraform apply -var-file testnet.tfvars -target null_resource.vault-init
-
Apply the entire configuration, providing your variable customizations:
$ terraform apply -var-file testnet.tfvars
-
Configure
kubectl
with the Kubernetes cluster:$ aws eks update-kubeconfig --name aptos-<workspace>