Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
refine syntax to minimize errors
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed Oct 27, 2020
1 parent cc6aeef commit 22ffbd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions terraform/multi-region-demo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ module "link_vpc" {
provider "consul" {
alias = "main"

address = "${element(module.cluster_main.consul_servers, 0)}:8500"
address = length(module.cluster_main.consul_servers) > 0 ? "${element(module.cluster_main.consul_servers, 0)}:8500" : null
datacenter = module.cluster_main.consul_dc
}

provider "consul" {
alias = "alt"

address = "${element(module.cluster_alt.consul_servers, 0)}:8500"
address = length(module.cluster_alt.consul_servers) > 0 ? "${element(module.cluster_alt.consul_servers, 0)}:8500" : null
datacenter = module.cluster_alt.consul_dc
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/single-region-demo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module "cluster_main" {

# Configure Prepared Query on Main Consul Cluster
provider "consul" {
address = "${element(module.cluster_main.consul_servers, 0)}:8500"
address = length(module.cluster_main.consul_servers) > 0 ? "${element(module.cluster_main.consul_servers, 0)}:8500" : null
datacenter = module.cluster_main.consul_dc
}

Expand Down

0 comments on commit 22ffbd1

Please sign in to comment.