This repository was archived by the owner on Mar 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed
examples/couchbase-multi-datacenter-replication Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 44# ---------------------------------------------------------------------------------------------------------------------
55
66provider "aws" {
7- alias = " primary"
8- region = " ${ var . aws_region_primary } "
7+ alias = " primary"
8+
9+ # Region intentionally ommitted so this example will prompt the user for a region when run via Terraform Registry
10+ # instructions
911}
1012
1113provider "aws" {
12- alias = " replica"
13- region = " ${ var . aws_region_replica } "
14+ alias = " replica"
15+
16+ # Region intentionally ommitted so this example will prompt the user for a region when run via Terraform Registry
17+ # instructions
1418}
1519
1620terraform {
@@ -110,7 +114,7 @@ data "template_file" "user_data_primary" {
110114 cluster_port = " ${ module . couchbase_security_group_rules_primary . rest_port } "
111115
112116 replication_dest_cluster_name = " ${ var . cluster_name_replica } "
113- replication_dest_cluster_aws_region = " ${ var . aws_region_replica } "
117+ replication_dest_cluster_aws_region = " ${ data . aws_region . replica . name } "
114118 }
115119}
116120
@@ -433,3 +437,7 @@ data "aws_subnet_ids" "default_replica" {
433437
434438 provider = " aws.replica"
435439}
440+
441+ data "aws_region" "replica" {
442+ provider = " aws.replica"
443+ }
Original file line number Diff line number Diff line change @@ -26,21 +26,11 @@ variable "ami_id_replica" {
2626 default = " "
2727}
2828
29- variable "aws_region_primary" {
30- description = " The AWS region to deploy the primary Couchbase cluster into (e.g. us-east-1)."
31- default = " us-east-1"
32- }
33-
3429variable "cluster_name_primary" {
3530 description = " What to name the primary Couchbase cluster and all of its associated resources"
3631 default = " couchbase-server-primary"
3732}
3833
39- variable "aws_region_replica" {
40- description = " The AWS region to deploy the replica Couchbase cluster into (e.g. us-east-1)."
41- default = " us-west-1"
42- }
43-
4434variable "cluster_name_replica" {
4535 description = " What to name the replica Couchbase cluster and all of its associated resources"
4636 default = " couchbase-server-replica"
You can’t perform that action at this time.
0 commit comments