Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@

This project declares the infrastructure currently used by Subspace Network.

We use **Terraform** and **DigitalOcean**. Any **project**, **droplet**, **volume**, **attachment** must be defined in this repository to be reviewed and deployed using IAC.
We use **Terraform** and **AWS**. Any **project**, **instances**, **volume**, **attachment** must be defined in this repository to be reviewed and deployed using IAC.

Terraform projects folder structure:

```
└── resources
└── aries-dev/
└── aries-test-a/
└── aries-test-b/
└── polkadot-archive/
└── status-page/
└── telemetry/
└── common.tf
resources
├── README.md
├── devnet
├── gemini-3h
├── leaseweb
├── mainnet
├── packer
├── taurus
└── telemetry
```

- `common.tf` is located on the resources folder, it contains all the definitions to be used for each project.
- To re use common definitions a `symlink` is created using `/resources/common.tf` as the source.
- If you need to **create a new project**:
- go to the **resources** folder,
- create a **new folder-project**
- link common definitions running `ln -s ../common.tf common.tf`.
- Then you are ready to follow instructions to **init** terraform, **add resources**, **plan** the resource deployment and **apply** the resource deployments in **DigitalOcean**
- create a **new folder-project**
- use the terraform.tfvars.example from another project to populate the input variables
- Then you are ready to follow instructions to **init** terraform, **add resources**, **plan** the resource deployment and **apply** the resource deployments in **AWS**

_To apply any updates or new definitions_ you must always work in a separate branch and create a _Pull Request to the main branch_.

Expand All @@ -36,11 +35,11 @@ Install Terraform cli:

## Getting started.

Start by defining your personal DigitalOcean access token as an env variable, so you won’t have to set your token each time you run Terraform.
You can find your API token in your [DigitalOcean](https://cloud.digitalocean.com/account/api/tokens) account.
Start by defining your personal AWS access and secret keys as an env variable, so you won’t have to set your token each time you run Terraform.

```
export DO_TOKEN=9999999999999999aaaaaaaaaaaaaaa
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
```

Go to **resources/PROJECT_NAME** directory and run the following commands to init terraform:
Expand All @@ -59,8 +58,7 @@ In the **resources/PROJECT_NAME** directory, run the following commands:
1. Run the **plan** command with the variable values passed in to see Terraform's steps to deploy your project resources.

```SH
terraform plan -var "do_token=${DO_TOKEN}" -out current-plan.tfplan
# DO NOT FORGET TO EXPORT DO_TOKEN before running this command.
terraform plan -var-file terraform.tfvars -out current-plan.tfplan
```

2. Run the **apply** command with the generated **current-plan.tfplan**.
Expand Down