-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5458cdf
commit 316ff1f
Showing
6 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
cloud { | ||
organization = "subspace-sre" | ||
|
||
workspaces { | ||
name = "subql-mainnet-aws" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
module "subql" { | ||
source = "../../../../templates/terraform/subql/base/" | ||
path_to_scripts = "../../../../templates/terraform/subql/base/scripts" | ||
path_to_configs = "../../../../templates/terraform/subql/base/config" | ||
network_name = var.network_name | ||
|
||
blue-subql-node-config = { | ||
deployment-color = "blue" | ||
network-name = "${var.network_name}" | ||
domain-prefix = "subql.blue" | ||
docker-tag = "mainnet-2024-nov-05" | ||
instance-type = var.instance_type | ||
deployment-version = 0 | ||
regions = var.aws_region | ||
instance-count-blue = var.instance_count_blue | ||
disk-volume-size = var.disk_volume_size | ||
disk-volume-type = var.disk_volume_type | ||
environment = "production" | ||
} | ||
|
||
green-subql-node-config = { | ||
deployment-color = "green" | ||
network-name = "${var.network_name}" | ||
domain-prefix = "subql.green" | ||
docker-tag = "mainnet-2024-nov-05" | ||
instance-type = var.instance_type | ||
deployment-version = 0 | ||
regions = var.aws_region | ||
instance-count-green = var.instance_count_green | ||
disk-volume-size = var.disk_volume_size | ||
disk-volume-type = var.disk_volume_type | ||
environment = "staging" | ||
} | ||
|
||
nova-blue-subql-node-config = { | ||
deployment-color = "blue" | ||
network-name = "${var.network_name}" | ||
domain-prefix = "nova.subql.blue" | ||
docker-tag = "mainnet-2024-nov-05" | ||
instance-type = var.instance_type | ||
deployment-version = 0 | ||
regions = var.aws_region | ||
instance-count-blue = 0 #var.instance_count_blue | ||
disk-volume-size = var.disk_volume_size | ||
disk-volume-type = var.disk_volume_type | ||
environment = "production" | ||
} | ||
|
||
nova-green-subql-node-config = { | ||
deployment-color = "green" | ||
network-name = "${var.network_name}" | ||
domain-prefix = "nova.subql.green" | ||
docker-tag = "mainnet-2024-nov-05" | ||
instance-type = var.instance_type | ||
deployment-version = 0 | ||
regions = var.aws_region | ||
instance-count-green = 0 #var.instance_count_green | ||
disk-volume-size = var.disk_volume_size | ||
disk-volume-type = var.disk_volume_type | ||
environment = "staging" | ||
} | ||
|
||
cloudflare_api_token = var.cloudflare_api_token | ||
cloudflare_email = var.cloudflare_email | ||
aws_key_name = var.aws_key_name | ||
nr_api_key = var.nr_api_key | ||
access_key = var.access_key | ||
secret_key = var.secret_key | ||
vpc_id = var.vpc_id | ||
vpc_cidr_block = var.vpc_cidr_block | ||
public_subnet_cidrs = var.public_subnet_cidrs | ||
postgres_password = var.postgres_password | ||
hasura_graphql_admin_secret = var.hasura_graphql_admin_secret | ||
hasura_graphql_jwt_secret = var.hasura_graphql_jwt_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
output "subql-node-blue-ipv4-addresses" { | ||
value = module.subql.subql_blue_node_public_ip | ||
description = "subql blue node IPv4 Addresses" | ||
} | ||
|
||
output "subql-node-green-ipv4-addresses" { | ||
value = module.subql.subql_green_node_public_ip | ||
description = "subql green node IPv4 Addresses" | ||
} | ||
|
||
output "nova-subql-node-blue-ipv4-addresses" { | ||
value = module.subql.nova_subql_blue_node_public_ip | ||
description = "Nova subql blue node IPv4 Addresses" | ||
} | ||
|
||
output "nova-subql-node-green-ipv4-addresses" { | ||
value = module.subql.nova_subql_green_node_public_ip | ||
description = "Nova subql green node IPv4 Addresses" | ||
} | ||
|
||
output "dns-records" { | ||
value = module.subql.dns-records | ||
description = "DNS records" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# AWS access key used to create infrastructure | ||
access_key = "" | ||
# AWS secret key used to create AWS infrastructure | ||
secret_key = "" | ||
aws_key_name = "explorer-deployer" | ||
ssh_user = "ubuntu" | ||
vpc_id = "explorer-mainnet-vpc" | ||
vpc_cidr_block = "172.36.0.0/16" | ||
public_subnet_cidrs = ["172.34.1.0/24"] | ||
network_name = "mainnet" | ||
instance_type = "m6a.2xlarge" | ||
instance_count_blue = 1 | ||
instance_count_green = 1 | ||
disk_volume_size = 200 | ||
private_key_path = "" | ||
cloudflare_email = "" | ||
cloudflare_api_token = "" | ||
nr_api_key = "" | ||
postgres_password = "" | ||
hasura_graphql_admin_secret = "" | ||
hasura_graphql_jwt_secret= "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
variable "node_tag" { | ||
type = string | ||
} | ||
|
||
variable "nr_api_key" { | ||
description = "New relic API Key" | ||
type = string | ||
} | ||
|
||
variable "cloudflare_email" { | ||
type = string | ||
description = "cloudflare email address" | ||
} | ||
|
||
variable "cloudflare_api_token" { | ||
type = string | ||
description = "cloudflare api token" | ||
} | ||
|
||
variable "network_name" { | ||
description = "Network name" | ||
type = string | ||
default = "mainnet" | ||
} | ||
|
||
variable "instance_type" { | ||
type = string | ||
} | ||
|
||
variable "vpc_id" { | ||
default = "explorer-mainnet-vpc" | ||
type = string | ||
} | ||
|
||
variable "vpc_cidr_block" { | ||
type = string | ||
} | ||
|
||
variable "azs" { | ||
type = list(string) | ||
description = "Availability Zones" | ||
default = ["us-east-2b"] | ||
} | ||
|
||
variable "instance_count_blue" { | ||
type = number | ||
} | ||
|
||
variable "instance_count_green" { | ||
type = number | ||
} | ||
|
||
variable "aws_region" { | ||
description = "aws region" | ||
type = list(string) | ||
default = ["us-east-2"] | ||
} | ||
|
||
variable "public_subnet_cidrs" { | ||
type = list(string) | ||
description = "Public Subnet CIDR values" | ||
} | ||
|
||
variable "secret_key" { | ||
type = string | ||
sensitive = true | ||
} | ||
|
||
variable "access_key" { | ||
type = string | ||
sensitive = true | ||
} | ||
|
||
variable "aws_key_name" { | ||
default = "explorer-deployer" | ||
type = string | ||
} | ||
|
||
variable "ssh_user" { | ||
default = "ubuntu" | ||
type = string | ||
} | ||
|
||
variable "private_key_path" { | ||
type = string | ||
default = "~/.ssh/explorer-deployer.pem" | ||
} | ||
|
||
variable "disk_volume_size" { | ||
type = number | ||
default = 200 | ||
} | ||
|
||
variable "disk_volume_type" { | ||
type = string | ||
default = "gp3" | ||
} | ||
|
||
variable "postgres_password" { | ||
sensitive = true | ||
type = string | ||
} | ||
|
||
variable "hasura_graphql_admin_secret" { | ||
sensitive = true | ||
type = string | ||
} | ||
|
||
variable "hasura_graphql_jwt_secret" { | ||
sensitive = true | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters