split terraform resources into separate files

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-02-04 22:31:53 +01:00
parent 56518e03ec
commit 44666e7a7c
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 44 additions and 50 deletions

27
dns.tf Normal file
View File

@ -0,0 +1,27 @@
/* DNS Entries for faucet APIs */
resource "cloudflare_record" "main-ropsten" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-ropsten"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}
resource "cloudflare_record" "main-rinkeby" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-rinkeby"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}
resource "cloudflare_record" "main-goerli" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-goerli"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}

17
hosts.tf Normal file
View File

@ -0,0 +1,17 @@
module "main" {
source = "github.com/status-im/infra-tf-google-cloud"
name = "master"
env = "faucet"
group = "faucet-master"
type = "n1-standard-2"
host_count = 1
root_vol_size = 30
data_vol_size = 50
domain = var.domain
open_tcp_ports = [
"80", /* HTTP */
"443", /* HTTPS */
"30303", /* GETH */
]
}

50
main.tf
View File

@ -37,53 +37,3 @@ data "cloudflare_zones" "active" {
status = "active"
}
}
/* RESOURCES ------------------------------------*/
module "main" {
source = "github.com/status-im/infra-tf-google-cloud"
name = "master"
env = "faucet"
group = "faucet-master"
type = "n1-standard-2"
host_count = 1
root_vol_size = 30
data_vol_size = 50
domain = var.domain
open_tcp_ports = [
"80", /* HTTP */
"443", /* HTTPS */
"30303", /* GETH */
]
}
/* DNS Entries for faucet APIs */
resource "cloudflare_record" "main-ropsten" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-ropsten"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}
resource "cloudflare_record" "main-rinkeby" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-rinkeby"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}
resource "cloudflare_record" "main-goerli" {
zone_id = data.cloudflare_zones.active.zones[0].id
name = "faucet-goerli"
type = "A"
proxied = true
value = module.main.public_ips[count.index]
count = length(module.main.public_ips)
}