forked from tangle-network/tangle-network-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
126 lines (105 loc) · 3.29 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
variable "region" {
type = string
description = "AWS region"
default = "us-east-1"
}
variable "config_bucket_name" {
description = "Name of S3 bucket that stores config files"
type = string
}
variable "az" {
type = string
description = "AWS availability zone"
default = "us-east-1a"
}
variable "az_secondary" {
type = string
description = "AWS availability zone"
default = "us-east-1c"
}
variable "dkg_private_subnet_cidr" {
type = string
default = "10.0.1.0/24"
}
variable "dkg_public_subnet_cidr" {
type = string
default = "10.0.2.0/24"
}
variable "dkg_public_secondary_subnet_cidr" {
type = string
default = "10.0.3.0/24"
}
variable "node_root_disk_size" {
type = number
description = "Disk size to allocate for nodes' root disk in GiB"
default = 512 # GB
}
variable "authority_node_instance_type" {
type = string
description = "Instance ID (AMI) to use for dkg nodes"
default = "m6g.large" # TODO: Choose best default instance type
}
variable "tenancy" {
type = string
description = "Tenacy: default, dedicated or host"
default = "default"
}
variable "admin_public_key" {
type = string
}
variable "base_instance_ami" {
type = string
description = "AWS ami image to use for core instances"
default = "ami-02207126df36eb80c" # From https://cloud-images.ubuntu.com/locator/ec2/
}
variable "bastion_instance_type" {
type = string
description = "Instance type for bastion node"
default = "t4g.micro"
}
variable "full_node_instance_type" {
type = string
description = "Instance type for full nodes"
default = "t4g.medium"
}
variable "full_node_count" {
type = number
description = "Count of full nodes"
default = 1
}
variable "full_node_secondary_count" {
type = number
description = "Count of full nodes in secondary availability zone"
default = 1
}
module "tf" {
source = "./tf"
region = var.region
config_bucket_name = var.config_bucket_name
az = var.az
az_secondary = var.az_secondary
dkg_private_subnet_cidr = var.dkg_private_subnet_cidr
dkg_public_subnet_cidr = var.dkg_public_subnet_cidr
dkg_public_secondary_subnet_cidr = var.dkg_public_secondary_subnet_cidr
authority_node_instance_type = var.authority_node_instance_type
node_root_disk_size = var.node_root_disk_size
tenancy = var.tenancy
admin_public_key = var.admin_public_key
base_instance_ami = var.base_instance_ami
bastion_instance_type = var.bastion_instance_type
full_node_instance_type = var.full_node_instance_type
full_node_count = var.full_node_count
full_node_secondary_count = var.full_node_secondary_count
}
output "bastion_ip_address" {
value = module.tf.bastion_ip_address
}
output "authority_node_ip_address" {
value = module.tf.authority_node_ip_address
}
output "full_node_ip_address" {
value = module.tf.full_node_ip_address
}
output "full_node_secondary_ip_address" {
value = module.tf.full_node_secondary_ip_address
}