Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit 94810b2

Browse files
committed
Update xdcr example to work better with Terraform Registry
1 parent 028f695 commit 94810b2

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

examples/couchbase-multi-datacenter-replication/main.tf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
# ---------------------------------------------------------------------------------------------------------------------
55

66
provider "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

1113
provider "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

1620
terraform {
@@ -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+
}

examples/couchbase-multi-datacenter-replication/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff 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-
3429
variable "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-
4434
variable "cluster_name_replica" {
4535
description = "What to name the replica Couchbase cluster and all of its associated resources"
4636
default = "couchbase-server-replica"

0 commit comments

Comments
 (0)