Skip to content

Commit 54ae36c

Browse files
authored
Anomalies : Lambda Code change to Store full array of root causes (#265)
1 parent 739ef08 commit 54ae36c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

data-collection/deploy/module-cost-anomaly.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ Resources:
224224
'TotalImpact': get_value_by_path(record, 'Impact/TotalImpact'),
225225
'TotalImpactpercentage': float(get_value_by_path(record, 'Impact/TotalImpactPercentage', 0.0)),
226226
'MonitorArn': get_value_by_path(record, 'MonitorArn'),
227-
'LinkedAccount': get_value_by_path(record, 'RootCauses/0/LinkedAccount'),
228-
'LinkedAccountName': get_value_by_path(record, 'RootCauses/0/LinkedAccountName'),
229-
'Region': get_value_by_path(record, 'RootCauses/0/Region'),
230-
'Service': get_value_by_path(record, 'RootCauses/0/Service'),
231-
'UsageType': get_value_by_path(record, 'RootCauses/0/UsageType')
227+
'LinkedAccount': get_value_by_path(record, 'RootCauses/0/LinkedAccount'), # for backward compatibility
228+
'LinkedAccountName': get_value_by_path(record, 'RootCauses/0/LinkedAccountName'), # for backward compatibility
229+
'Region': get_value_by_path(record, 'RootCauses/0/Region'), # for backward compatibility
230+
'Service': get_value_by_path(record, 'RootCauses/0/Service'), # for backward compatibility
231+
'UsageType': get_value_by_path(record, 'RootCauses/0/UsageType'), # for backward compatibility
232+
'RootCauses': get_value_by_path(record, 'RootCauses', []), # Store full array of root causes
232233
}
233234
logger.debug("Processing record complete")
234235
return result

0 commit comments

Comments
 (0)