blockstream-satellite-api/terraform/modules/blc/data.tf

46 lines
1.6 KiB
Terraform
Raw Normal View History

2019-01-16 10:22:44 -08:00
data "google_compute_network" "blc" {
name = "default"
}
data "google_compute_image" "blc" {
family = "satapi-data-${var.env}"
project = "${var.project}"
2019-01-18 14:57:15 -08:00
count = "${var.create_resources}"
2019-01-16 10:22:44 -08:00
}
data "template_file" "blc" {
template = "${file("${path.module}/cloud-init/blc.yaml")}"
2019-01-18 14:57:15 -08:00
count = "${var.create_resources}"
2019-01-16 10:22:44 -08:00
vars {
rpcuser = "${var.rpcuser}"
rpcpass = "${var.rpcpass}"
rpcport = "${var.net == "testnet" ? "18332" : "8332"}"
bitcoin_cmd = "bitcoind ${var.net == "testnet" ? "-testnet" : ""} -printtoconsole"
lightning_cmd = "lightningd ${var.net == "testnet" ? "--testnet" : "--mainnet"} --conf=/root/.lightning/lightning.conf --plugin-dir=/usr/local/bin/plugins"
2019-01-29 11:28:40 -08:00
charge_cmd = "charged -d /data/charge.db -l /root/.lightning"
2019-01-16 10:22:44 -08:00
announce_addr = "${google_compute_address.blc.address}"
lightning_port = 9735
bitcoin_docker = "${var.bitcoin_docker}"
lightning_docker = "${var.lightning_docker}"
charge_docker = "${var.charge_docker}"
redis_port = 6379
ionosphere_docker = "${var.ionosphere_docker}"
ionosphere_sse_docker = "${var.ionosphere_sse_docker}"
node_exporter_docker = "${var.node_exporter_docker}"
opsgenie_key = "${var.opsgenie_key}"
2019-02-26 14:03:37 -08:00
host = ["${var.host}"]
2019-01-16 10:22:44 -08:00
}
}
data "template_cloudinit_config" "blc" {
gzip = false
base64_encode = false
2019-01-18 14:57:15 -08:00
count = "${var.create_resources}"
2019-01-16 10:22:44 -08:00
part {
content_type = "text/cloud-config"
content = "${data.template_file.blc.rendered}"
}
}