This repo contains a Terraform plan for deploying relayer
on GCP
Relays are like the backend servers for Nostr. They allow Nostr clients to send them messages, and they may (or may not) store those messages and broadcast those messages to all other connected clients. The world of relays is changing fast so expect many changes here in the future.
In order for Terraform to run operations on your behalf, you must install and configure the gcloud CLI tool. To install the gcloud CLI, follow the installation guide for your system.
After the installation perform the steps outlined below. This will authorize the SDK to access GCP using your user account credentials and add the SDK to your PATH. It requires you to login and select the project you want to work in. Then add your account to the Application Default Credentials (ADC). This will allow Terraform to access these credentials to provision resources on GCP.
gcloud auth application-default login
Name | Version |
---|---|
terraform | >=1.3.2 |
gcp | >=4.47.0 |
Name | Version |
---|---|
gcp | >=4.47.0 |
Name | Type |
---|---|
google_service_account |
Resource |
google_project_iam_member |
Resource |
google_compute_firewall |
Resource |
google_compute_address |
Resource |
google_compute_instance |
Resource |
Name | Type | Required |
---|---|---|
project_id |
string | yes |
machine_type |
string | yes |
region |
string | yes |
public_keypath |
string | yes |
private_keypath |
string | yes |
make
automates the process of manually running the terraform command chains
You may run below command to template out a terraform.tfvars
file.
make setup-gcp
Once your variables are in place, the terraform plan is set and ready to be applied
make create-gcp
make destroy-gcp
Name | Description |
---|---|
nostr_relayer_ip | The public IP address of the relayer instance. |