Skip to content

Commit 8425eb3

Browse files
authored
fix: updated logic which was using deprecated lookup function<br>* fixed bug where wait_till variable was not being used (#648)
1 parent 2d50005 commit 8425eb3

File tree

12 files changed

+27
-3259
lines changed

12 files changed

+27
-3259
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-10-14T15:23:43Z",
6+
"generated_at": "2023-12-11T18:26:42Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -88,7 +88,7 @@
8888
}
8989
]
9090
},
91-
"version": "0.13.1+ibm.61.dss",
91+
"version": "0.13.1+ibm.62.dss",
9292
"word_list": {
9393
"file": null,
9494
"hash": null

bastion_host.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module "bastion_host" {
6565
]
6666
ssh_key_ids = [
6767
for ssh_key in each.value.ssh_keys :
68-
lookup(module.ssh_keys.ssh_key_map, ssh_key).id
68+
module.ssh_keys.ssh_key_map[ssh_key].id
6969
]
7070
machine_type = each.value.machine_type
7171
security_group = each.value.security_group

commitlint.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

f5_vsi.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module "f5_vsi" {
136136
interface_name = group.interface_name
137137
}
138138
]
139-
image_id = lookup(local.public_image_map[each.value.f5_image_name], var.region)
139+
image_id = local.public_image_map[each.value.f5_image_name][var.region]
140140
user_data = module.dynamic_values.f5_template_map[each.key].user_data
141141
machine_type = each.value.machine_type
142142
vsi_per_subnet = 1
@@ -155,7 +155,7 @@ module "f5_vsi" {
155155
# Get ssh keys
156156
ssh_key_ids = [
157157
for ssh_key in each.value.ssh_keys :
158-
lookup(module.ssh_keys.ssh_key_map, ssh_key).id
158+
module.ssh_keys.ssh_key_map[ssh_key].id
159159
]
160160
# Get block storage volumes
161161
block_storage_volumes = each.value.block_storage_volumes == null ? [] : [

kms/dynamic_values.unit_tests.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ locals {
2222
# tflint-ignore: terraform_unused_declarations
2323
assert_use_kms_resource_returns_correct_crn = regex("resource", module.unit_test_kms_resource.crn)
2424
# tflint-ignore: terraform_unused_declarations
25-
assert_key_exists_in_map = lookup(module.unit_test_hs_crypto.keys, "test_key")
25+
assert_key_exists_in_map = module.unit_test_hs_crypto.keys["test_key"]
2626
# tflint-ignore: terraform_unused_declarations
2727
assert_key_ring_exists_in_map = regex("test-ring", module.unit_test_hs_crypto.key_rings[0])
2828
# tflint-ignore: terraform_unused_declarations
2929
assert_no_duplicate_key_rings = regex("1", tostring(length(module.unit_test_hs_crypto.key_rings)))
3030
# tflint-ignore: terraform_unused_declarations
31-
assert_key_management_policy_exists = lookup(module.unit_test_hs_crypto.policies, "test_key")
31+
assert_key_management_policy_exists = module.unit_test_hs_crypto.policies["test_key"]
3232
}
3333

3434
##############################################################################

module-metadata.json

Lines changed: 0 additions & 3210 deletions
This file was deleted.

patterns/mixed/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ locals {
302302
key_management = lookup(local.override[local.override_type], "key_management", local.config.key_management)
303303
atracker = lookup(local.override[local.override_type], "atracker", local.config.atracker)
304304
clusters = lookup(local.override[local.override_type], "clusters", local.config.clusters)
305-
wait_till = lookup(local.override[local.override_type], "wait_till", "IngressReady")
305+
wait_till = lookup(local.override[local.override_type], "wait_till", var.wait_till)
306306
iam_account_settings = lookup(local.override[local.override_type], "iam_account_settings", local.config.iam_account_settings)
307307
access_groups = lookup(local.override[local.override_type], "access_groups", local.config.access_groups)
308308
appid = lookup(local.override[local.override_type], "appid", local.config.appid)

patterns/roks/module/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ locals {
282282
key_management = lookup(local.override[local.override_type], "key_management", local.config.key_management)
283283
atracker = lookup(local.override[local.override_type], "atracker", local.config.atracker)
284284
clusters = lookup(local.override[local.override_type], "clusters", local.config.clusters)
285-
wait_till = lookup(local.override[local.override_type], "wait_till", "IngressReady")
285+
wait_till = lookup(local.override[local.override_type], "wait_till", var.wait_till)
286286
iam_account_settings = lookup(local.override[local.override_type], "iam_account_settings", local.config.iam_account_settings)
287287
access_groups = lookup(local.override[local.override_type], "access_groups", local.config.access_groups)
288288
appid = lookup(local.override[local.override_type], "appid", local.config.appid)

security_groups.tf

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,12 @@ resource "ibm_is_security_group_rule" "security_group_rules" {
5353
# Conditianally add content if sg has icmp
5454
content {
5555
type = lookup(
56-
lookup(
57-
each.value,
58-
"icmp"
59-
),
56+
each.value["icmp"],
6057
"type",
6158
null
6259
)
6360
code = lookup(
64-
lookup(
65-
each.value,
66-
"icmp"
67-
),
61+
each.value["icmp"],
6862
"code",
6963
null
7064
)
@@ -92,19 +86,13 @@ resource "ibm_is_security_group_rule" "security_group_rules" {
9286
# Conditionally adds content if sg has tcp
9387
content {
9488
port_min = lookup(
95-
lookup(
96-
each.value,
97-
"tcp"
98-
),
89+
each.value["tcp"],
9990
"port_min",
10091
null
10192
)
10293

10394
port_max = lookup(
104-
lookup(
105-
each.value,
106-
"tcp"
107-
),
95+
each.value["tcp"],
10896
"port_max",
10997
null
11098
)
@@ -132,18 +120,12 @@ resource "ibm_is_security_group_rule" "security_group_rules" {
132120
# Conditionally adds content if sg has tcp
133121
content {
134122
port_min = lookup(
135-
lookup(
136-
each.value,
137-
"udp"
138-
),
123+
each.value["udp"],
139124
"port_min",
140125
null
141126
)
142127
port_max = lookup(
143-
lookup(
144-
each.value,
145-
"udp"
146-
),
128+
each.value["udp"],
147129
"port_max",
148130
null
149131
)

0 commit comments

Comments
 (0)