Skip to content

Commit 1e4cc4b

Browse files
committed
subql changes make module reusable
- remove gemini references - make resources more generic
1 parent a8bfe12 commit 1e4cc4b

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

explorer/terraform/aws/taurus/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "subql" {
4040
instance-type = var.instance_type
4141
deployment-version = 0
4242
regions = var.aws_region
43-
instance-count-blue = var.instance_count_blue
43+
instance-count-blue = 0 #var.instance_count_blue
4444
disk-volume-size = var.disk_volume_size
4545
disk-volume-type = var.disk_volume_type
4646
environment = "production"
@@ -54,7 +54,7 @@ module "subql" {
5454
instance-type = var.instance_type
5555
deployment-version = 0
5656
regions = var.aws_region
57-
instance-count-green = var.instance_count_green
57+
instance-count-green = 0 #var.instance_count_green
5858
disk-volume-size = var.disk_volume_size
5959
disk-volume-type = var.disk_volume_type
6060
environment = "staging"

templates/terraform/subql/base/instances.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resource "aws_instance" "subql_blue_node" {
55
subnet_id = element(aws_subnet.public_subnets.*.id, 0)
66
availability_zone = element(var.azs, 0)
77
# Security Group
8-
vpc_security_group_ids = ["${aws_security_group.gemini-subql-sg.id}"]
8+
vpc_security_group_ids = ["${aws_security_group.subql-sg.id}"]
99
# the Public SSH key
1010
key_name = var.aws_key_name
1111
associate_public_ip_address = true
@@ -73,7 +73,7 @@ resource "aws_instance" "subql_green_node" {
7373
subnet_id = element(aws_subnet.public_subnets.*.id, count.index)
7474
availability_zone = element(var.azs, count.index)
7575
# Security Group
76-
vpc_security_group_ids = ["${aws_security_group.gemini-subql-sg.id}"]
76+
vpc_security_group_ids = ["${aws_security_group.subql-sg.id}"]
7777
# the Public SSH key
7878
key_name = var.aws_key_name
7979
associate_public_ip_address = true
@@ -140,7 +140,7 @@ resource "aws_instance" "nova_subql_blue_node" {
140140
subnet_id = element(aws_subnet.public_subnets.*.id, count.index)
141141
availability_zone = element(var.azs, count.index)
142142
# Security Group
143-
vpc_security_group_ids = ["${aws_security_group.gemini-subql-sg.id}"]
143+
vpc_security_group_ids = ["${aws_security_group.subql-sg.id}"]
144144
# the Public SSH key
145145
key_name = var.aws_key_name
146146
associate_public_ip_address = true
@@ -207,7 +207,7 @@ resource "aws_instance" "nova_subql_green_node" {
207207
subnet_id = element(aws_subnet.public_subnets.*.id, count.index)
208208
availability_zone = element(var.azs, count.index)
209209
# Security Group
210-
vpc_security_group_ids = ["${aws_security_group.gemini-subql-sg.id}"]
210+
vpc_security_group_ids = ["${aws_security_group.subql-sg.id}"]
211211
# the Public SSH key
212212
key_name = var.aws_key_name
213213
associate_public_ip_address = true

templates/terraform/subql/base/network.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resource "aws_vpc" "gemini-subql-vpc" {
1+
resource "aws_vpc" "subql-vpc" {
22
cidr_block = var.vpc_cidr_block
33
enable_dns_support = true
44
enable_dns_hostnames = true
@@ -12,7 +12,7 @@ resource "aws_vpc" "gemini-subql-vpc" {
1212

1313
resource "aws_subnet" "public_subnets" {
1414
count = length(var.public_subnet_cidrs)
15-
vpc_id = aws_vpc.gemini-subql-vpc.id
15+
vpc_id = aws_vpc.subql-vpc.id
1616
cidr_block = element(var.public_subnet_cidrs, count.index)
1717
availability_zone = element(var.azs, count.index)
1818
map_public_ip_on_launch = "true"
@@ -25,7 +25,7 @@ resource "aws_subnet" "public_subnets" {
2525

2626
resource "aws_internet_gateway" "subql-gw" {
2727
count = length(var.public_subnet_cidrs)
28-
vpc_id = aws_vpc.gemini-subql-vpc.id
28+
vpc_id = aws_vpc.subql-vpc.id
2929

3030
tags = {
3131
Name = "${var.network_name}-subql-gw-public-subnet-${count.index}"
@@ -39,7 +39,7 @@ resource "aws_internet_gateway" "subql-gw" {
3939

4040
resource "aws_route_table" "public_route_table" {
4141
count = length(var.public_subnet_cidrs)
42-
vpc_id = aws_vpc.gemini-subql-vpc.id
42+
vpc_id = aws_vpc.subql-vpc.id
4343

4444
route {
4545
cidr_block = "0.0.0.0/0"
@@ -66,10 +66,10 @@ resource "aws_route_table_association" "public_route_table_subnets_association"
6666
route_table_id = element(aws_route_table.public_route_table.*.id, count.index)
6767
}
6868

69-
resource "aws_security_group" "gemini-subql-sg" {
69+
resource "aws_security_group" "subql-sg" {
7070
name = "${var.network_name}-subql-sg"
7171
description = "Allow HTTP and HTTPS inbound traffic"
72-
vpc_id = aws_vpc.gemini-subql-vpc.id
72+
vpc_id = aws_vpc.subql-vpc.id
7373

7474
ingress {
7575
description = "HTTPS for VPC"
@@ -108,6 +108,6 @@ resource "aws_security_group" "gemini-subql-sg" {
108108
}
109109

110110
depends_on = [
111-
aws_vpc.gemini-subql-vpc
111+
aws_vpc.subql-vpc
112112
]
113113
}

templates/terraform/subql/base/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Output Variables
22

33
output "ingress_rules" {
4-
value = aws_security_group.gemini-subql-sg.*.ingress
4+
value = aws_security_group.subql-sg.*.ingress
55
}
66

77
output "subql_blue_node_server_id" {

templates/terraform/subql/base/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ variable "aws_key_name" {
8282
variable "network_name" {
8383
description = "Network name"
8484
type = string
85-
default = "gemini-3h"
85+
default = "taurus"
8686
}
8787

8888
variable "path_to_scripts" {

0 commit comments

Comments
 (0)