Add env var

This commit is contained in:
Andrew Cravenho 2019-01-22 12:19:12 -05:00
parent 51f73ac618
commit 719893b48f
5 changed files with 66 additions and 4 deletions

View File

@ -177,6 +177,15 @@ chain_network_path = {
chain_network_icon = {
"mychain" = "_test_network_icon.html"
}
heart_beat_timeout = {
"mychain" = 30
}
heart_command = {
"mychain" = "systemctl restart explorer.service"
}
blockscout_version = {
"mychain" = "v1.3.0-beta"
}
```
This will ensure that those chains are used when provisioning the infrastructure.

View File

@ -23,6 +23,9 @@ module "stack" {
chain_subnetwork = "${var.chain_subnetwork}"
chain_network_path = "${var.chain_network_path}"
chain_network_icon = "${var.chain_network_icon}"
chain_heart_beat_timeout = "${var.chain_heart_beat_timeout}"
chain_heart_command = "${var.chain_heart_command}"
chain_blockscout_version = "${var.chain_blockscout_version}"
vpc_cidr = "${var.vpc_cidr}"
public_subnet_cidr = "${var.public_subnet_cidr}"

View File

@ -25,7 +25,7 @@ variable "dns_zone_name" {
variable "instance_type" {
description = "The EC2 instance type to use for app servers"
default = "m5.xlarge"
default = "m5.large"
}
variable "root_block_size" {
@ -41,21 +41,21 @@ variable "pool_size" {
variable "chains" {
description = "A map of chain names to urls"
default = {
"sokol" = "https://sokol-trace.poa.network"
"sokol" = "http://localhost:8545"
}
}
variable "chain_trace_endpoint" {
description = "A map of chain names to RPC tracing endpoint"
default = {
"sokol" = "https://sokol-trace.poa.network"
"sokol" = "http://localhost:8545"
}
}
variable "chain_ws_endpoint" {
description = "A map of chain names to Websocket RPC Endpoint"
default = {
"sokol" = "wss://sokol-ws.poa.network/ws"
"sokol" = "ws://localhost:8546"
}
}
@ -108,6 +108,25 @@ variable "chain_network_icon" {
}
}
variable "chain_heart_beat_timeout" {
description = "A map of the chain heart beat timeout number"
default = {
"sokol" = 30
}
}
variable "chain_heart_command" {
description = "A map of chain heart beat command"
default = {
"sokol" = "systemctl restart explorer.service"
}
}
variable "chain_blockscout_version" {
description = "A map of the blockscout version"
default = {
"sokol" = "v1.3.0-beta"
}
}
# RDS/Database configuration
variable "db_id" {
description = "The identifier for the RDS database"

View File

@ -94,6 +94,27 @@ resource "aws_ssm_parameter" "network_icon" {
type = "String"
}
resource "aws_ssm_parameter" "heart_beat_timeout" {
count = "${length(var.chains)}"
name = "/${var.prefix}/${element(keys(var.chains),count.index)}/heart_beat_timeout"
value = "${element(values(var.chain_heart_beat_timeout),count.index)}"
type = "String"
}
resource "aws_ssm_parameter" "heart_command" {
count = "${length(var.chains)}"
name = "/${var.prefix}/${element(keys(var.chains),count.index)}/heart_command"
value = "${element(values(var.chain_heart_command),count.index)}"
type = "String"
}
resource "aws_ssm_parameter" "blockscout_version" {
count = "${length(var.chains)}"
name = "/${var.prefix}/${element(keys(var.chains),count.index)}/blockscout_version"
value = "${element(values(var.chain_blockscout_version),count.index)}"
type = "String"
}
resource "aws_ssm_parameter" "exq_blocks_concurrency" {
count = "${length(var.chains)}"
name = "/${var.prefix}/${element(keys(var.chains),count.index)}/exq_blocks_concurrency"

View File

@ -40,6 +40,16 @@ variable "chain_network_icon" {
default = {}
}
variable "chain_heart_beat_timeout" {
default = {}
}
variable "chain_heart_command" {
default = {}
}
variable "chain_blockscout_version" {
default = {}
}
variable "db_id" {}
variable "db_name" {}
variable "db_username" {}