Skip to content

Commit 36bfe11

Browse files
authored
switch back to string value for region, added a home_region variable (#382)
Signed-off-by: Ali Mukadam <[email protected]>
1 parent 33d5db8 commit 36bfe11

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

docs/configuration.adoc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,22 @@ The 3 OCI parameters here mainly concern:
106106

107107
* `compartment_id`: is the compartment where all the resources will be created in
108108
* `label_prefix`: this will prepend a string to the name of every resource created
109-
* `regions`: this allows you to select the region where you want the OKE cluster deployed
109+
* `region`: this allows you to select the region where you want the OKE cluster deployed
110110

111111

112112
e.g.
113113

114114
----
115115
compartment_id = "compartment_id = "ocid1.compartment...."
116116
label_prefix = "dev"
117-
regions = {
118-
home = "us-phoenix-1"
119-
oke = "ap-sydney-1"
120-
}
117+
home_region = "us-phoenix-1"
118+
region = "ap-sydney-1"
121119
----
122120

123121
Regions must have exactly 2 entries as above:
124122

125-
* home: is the tenancy's home region
126-
* oke: is the region where the oke cluster will be created
123+
* home_region: is the tenancy's home region. This may be different from the region where you want to create OKE.
124+
* region: is the actual region where you want to create the OKE cluster.
127125

128126
The list of regions can be found {uri-oci-region}[here].
129127

docs/quickstart.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ You need to create 2 providers:
5858
provider "oci" {
5959
fingerprint = var.api_fingerprint
6060
private_key_path = var.api_private_key_path
61-
region = var.regions["oke"]
61+
region = var.region
6262
tenancy_ocid = var.tenancy_id
6363
user_ocid = var.user_id
6464
}
6565
6666
provider "oci" {
6767
fingerprint = var.api_fingerprint
6868
private_key_path = var.api_private_key_path
69-
region = var.regions["home"]
69+
region = var.home_region
7070
tenancy_ocid = var.tenancy_id
7171
user_ocid = var.user_id
7272
alias = "home"

docs/terraformoptions.adoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ EOT
6161
|
6262
|none
6363

64-
|regions
65-
|A map of OCI regions where resources will be created. The map must have 2 keys: 1) oke is where OKE will be created 2) home is the tenancy's home region.. {uri-oci-region}[List of regions]. *Required*
64+
|home_region
65+
|The tenancy's home region. Required to perform identity operations. *Required*
6666
|
67-
regions = {
68-
home = "us-phoenix-1"
69-
oke = "ap-sydney-1"
70-
}
67+
region = "us-ashburn-1"
68+
|
69+
70+
|region
71+
|The OCI region where OKE resources will be created. Please select from {uri-oci-region}[list of regions]. *Required*
72+
|
73+
region = "ap-sydney-1"
7174
|
7275

7376
|tenancy_id

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ module "extensions" {
251251
label_prefix = var.label_prefix
252252

253253
# region parameters
254-
region = var.regions["oke"]
254+
region = var.region
255255

256256
# ssh keys
257257
ssh_private_key = var.ssh_private_key

terraform.tfvars.example

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ api_fingerprint = ""
88

99
api_private_key_path = ""
1010

11-
regions = {
12-
home = "us-phoenix-1"
13-
oke = "ap-sydney-1"
14-
}
11+
home_region = "us-ashburn-1"
12+
region = "us-phoenix-1"
1513

1614
tenancy_id = ""
1715
user_id = ""

variables.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ variable "api_private_key_path" {
2828
type = string
2929
}
3030

31-
variable "regions" {
31+
variable "home_region" {
3232
# List of regions: https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm#ServiceAvailabilityAcrossRegions
33-
description = "A map of OCI regions where resources will be created. The map must have 2 keys: 1) oke is where OKE will be created 2) home is the tenancy's home region."
34-
type = map(string)
33+
description = "The tenancy's home region. Required to perform identity operations."
34+
type = string
35+
}
36+
37+
variable "region" {
38+
# List of regions: https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm#ServiceAvailabilityAcrossRegions
39+
description = "The OCI region where OKE resources will be created."
40+
type = string
3541
}
3642

3743
variable "tenancy_id" {

0 commit comments

Comments
 (0)