Skip to content

Commit daaad8e

Browse files
author
AWS
committed
Release: 1.10.1
1 parent 1c6194d commit daaad8e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.0
1+
1.10.1

modules/aft-backend/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ resource "aws_dynamodb_table" "lock-table" {
270270
name = "LockID"
271271
type = "S"
272272
}
273+
lifecycle { ignore_changes = [replica] }
273274

274275
tags = {
275276
"Name" = "aft-backend-${data.aws_caller_identity.current.account_id}"

sources/aft-lambda-layer/aft_common/organizations.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ def get_children_ous_from_parent_id(
163163

164164
def get_ou_ids_from_ou_names(self, target_ou_names: List[str]) -> List[str]:
165165
ous = self.get_all_org_ous()
166-
ou_map = {}
166+
org_ou_map = {}
167167

168-
# Convert list of OUs to name->id map for constant time lookups
168+
# Convert list of OUs to id->name map for constant time lookups
169169
for ou in ous:
170-
ou_map[ou["Name"]] = ou["Id"]
170+
org_ou_map[ou["Id"]] = ou["Name"]
171171

172172
# Search the map for every target exactly once
173173
matched_ou_ids = []
@@ -178,11 +178,15 @@ def get_ou_ids_from_ou_names(self, target_ou_names: List[str]) -> List[str]:
178178
)
179179
if nested_parsed is not None: # Nested OU pattern matched!
180180
target_name, target_id = nested_parsed
181-
if ou_map[target_name] == target_id:
182-
matched_ou_ids.append(ou_map[target_name])
181+
if target_id in org_ou_map.keys():
182+
if org_ou_map[target_id] == target_name:
183+
matched_ou_ids.append(target_id)
183184
else:
184-
if target_name in ou_map:
185-
matched_ou_ids.append(ou_map[target_name])
185+
if target_name in org_ou_map.values():
186+
target_id = [
187+
id for id, name in org_ou_map.items() if target_name == name
188+
][0]
189+
matched_ou_ids.append(target_id)
186190

187191
return matched_ou_ids
188192

0 commit comments

Comments
 (0)