Skip to content

Commit 5f96992

Browse files
committed
updated default values, removed redundant code, formatting
Signed-off-by: Ali Mukadam <[email protected]>
1 parent 4f86f4e commit 5f96992

22 files changed

+84
-122
lines changed

docs/terraformoptions.adoc

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,19 @@ Configuration Terraform Options:
170170
[source]
171171
----
172172
newbits = {
173-
"bastion" = 13
174-
"lb" = 11
175-
"workers" = 2
173+
"bastion" = 13
174+
"lb" = 11
175+
"workers" = 2
176176
}
177177
----
178178
|
179179
[source]
180180
----
181-
"bastion" = 13
182-
"lb" = 11
183-
"workers" = 2
181+
newbits = {
182+
"bastion" = 13
183+
"lb" = 11
184+
"workers" = 2
185+
}
184186
----
185187

186188
|subnets
@@ -189,31 +191,21 @@ newbits = {
189191
[source]
190192
----
191193
subnets = {
192-
"bastion" = 32
193-
"int_lb_ad1" = 16
194-
"int_lb_ad2" = 17
195-
"int_lb_ad3" = 18
196-
"pub_lb_ad1" = 19
197-
"pub_lb_ad2" = 20
198-
"pub_lb_ad3" = 21
199-
"workers_ad1" = 1
200-
"workers_ad2" = 2
201-
"workers_ad3" = 3
194+
"bastion" = 32
195+
"int_lb" = 16
196+
"pub_lb" = 17
197+
"workers" = 1
202198
}
203199
----
204200
|
205201
[source]
206202
----
207-
"bastion" = 32
208-
"int_lb_ad1" = 16
209-
"int_lb_ad2" = 17
210-
"int_lb_ad3" = 18
211-
"pub_lb_ad1" = 19
212-
"pub_lb_ad2" = 20
213-
"pub_lb_ad3" = 21
214-
"workers_ad1" = 1
215-
"workers_ad2" = 2
216-
"workers_ad3" = 3
203+
subnets = {
204+
"bastion" = 32
205+
"int_lb" = 16
206+
"pub_lb" = 17
207+
"workers" = 1
208+
}
217209
----
218210

219211

@@ -256,7 +248,7 @@ subnets = {
256248
|image_operating_system_version
257249
|The version of the selected Operating System to be used to provision the bastion host. Matching versions of available operating systems can be found {uri-oci-images}[here].
258250
|
259-
|7.6
251+
|7.7
260252

261253
|availability_domains
262254
|The Availability Domain where to provision non-OKE resources e.g. bastion host. This is specified in the form of a map.
@@ -395,19 +387,6 @@ Refer to {uri-topology}[topology] for more thorough examples.
395387
|both, internal, public
396388
|public
397389
398-
|preferred_lb_ads
399-
|The preferred Availability Domains where to provision the Load Balancers, specified in the form of a list of 2 elements.
400-
|
401-
[source]
402-
----
403-
preferred_lb_ads = ["ad1", "ad2"]
404-
----
405-
|
406-
[source]
407-
----
408-
["ad1", "ad2"]
409-
----
410-
411390
|preferred_lb_subnets
412391
|The preferred load balancer subnets that OKE will automatically choose when creating load balancers. If 'public' is chosen, the value for lb_subnet_type must be either 'public' or 'both'. If 'private' is chosen, the value for lb_subnet_type must be either 'internal' or 'both'.
413392

locals.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ locals {
104104
}
105105

106106
node_pools = {
107-
node_pools = var.node_pools
108-
node_pool_name_prefix = var.node_pool_name_prefix
109-
node_pool_image_id = var.node_pool_image_id
110-
node_pool_os = var.node_pool_os
111-
node_pool_os_version = var.node_pool_os_version
107+
node_pools = var.node_pools
108+
node_pool_name_prefix = var.node_pool_name_prefix
109+
node_pool_image_id = var.node_pool_image_id
110+
node_pool_os = var.node_pool_os
111+
node_pool_os_version = var.node_pool_os_version
112112
}
113113

114114
lbs = {

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module "auth" {
2828
source = "./modules/auth"
2929

3030
# ocir parameters
31-
ocir = local.ocir
31+
ocir = local.ocir
3232
}
3333

3434
# additional networking for oke

modules/base/bastion/iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ resource "oci_identity_policy" "instance_principal" {
3838
name = "${var.oci_bastion_general.label_prefix}-instance_principal"
3939
statements = ["Allow dynamic-group ${oci_identity_dynamic_group.instance_principal[0].name} to manage all-resources in compartment ${data.oci_identity_compartments.compartments_name.compartments.0.name}"]
4040
count = var.oci_bastion.enable_instance_principal == true ? 1 : 0
41-
}
41+
}

modules/base/bastion/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
output "bastion_public_ip" {
55
value = join(",", data.oci_core_vnic.bastion_vnic.*.public_ip_address)
6-
}
6+
}

modules/base/datasources.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ data "oci_identity_regions" "home_region" {
2020
name = "key"
2121
values = [data.oci_identity_tenancy.tenancy.home_region_key]
2222
}
23-
}
23+
}

modules/base/vcn/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
locals {
55
anywhere = "0.0.0.0/0"
6-
}
6+
}

modules/base/vcn/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ variable "oci_base_vcn" {
1313
vcn_dns_name = string
1414
vcn_name = string
1515
})
16-
}
16+
}

modules/base/vcn/vcn.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "oci_core_route_table" "ig_route" {
2424
}
2525

2626
dynamic "route_rules" {
27-
for_each = (var.oci_base_vcn.create_service_gateway == true && var.oci_base_vcn.create_nat_gateway == false) ? list(1) : []
27+
for_each = (var.oci_base_vcn.create_service_gateway == true && var.oci_base_vcn.create_nat_gateway == false) ? list(1) : []
2828

2929
content {
3030
destination = lookup(data.oci_core_services.all_oci_services[0].services[0], "cidr_block")
@@ -34,4 +34,4 @@ resource "oci_core_route_table" "ig_route" {
3434
}
3535

3636
vcn_id = oci_core_vcn.vcn.id
37-
}
37+
}

modules/oke/activeworker.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ data "template_file" "check_worker_node_status" {
1010
region = var.oke_general.region
1111
}
1212

13-
count = var.oke_bastion.create_bastion == true && var.oke_bastion.enable_instance_principal == true ? 1 : 0
13+
count = var.oke_bastion.create_bastion == true && var.oke_bastion.enable_instance_principal == true ? 1 : 0
1414
}
1515

1616
resource null_resource "is_worker_active" {
@@ -19,7 +19,7 @@ resource null_resource "is_worker_active" {
1919
private_key = file(var.oke_ssh_keys.ssh_private_key_path)
2020
timeout = "40m"
2121
type = "ssh"
22-
user = var.oke_bastion.image_operating_system == "Canonical Ubuntu" ? "ubuntu" : "opc"
22+
user = var.oke_bastion.image_operating_system == "Canonical Ubuntu" ? "ubuntu" : "opc"
2323
}
2424

2525
depends_on = ["oci_containerengine_cluster.k8s_cluster"]
@@ -36,5 +36,5 @@ resource null_resource "is_worker_active" {
3636
]
3737
}
3838

39-
count = var.oke_bastion.create_bastion == true && var.oke_bastion.enable_instance_principal == true ? 1 : 0
39+
count = var.oke_bastion.create_bastion == true && var.oke_bastion.enable_instance_principal == true ? 1 : 0
4040
}

0 commit comments

Comments
 (0)