From 91b6727a0e6eea0ac19a2fc4847d9e63bd4b1e30 Mon Sep 17 00:00:00 2001 From: Kristian Lesko Date: Wed, 21 Feb 2024 15:56:06 +0100 Subject: [PATCH] Apply per-region Config frequency properly --- resources/config_recorder.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/config_recorder.py b/resources/config_recorder.py index 3c240037..7314c37e 100644 --- a/resources/config_recorder.py +++ b/resources/config_recorder.py @@ -35,11 +35,14 @@ and continuous_regions and region not in continuous_regions ): - frequency = "DAILY" - - if recordingMode.get("recordingFrequency") != frequency: - print(f"Setting {region} Config recorder frequency to {frequency}") - recordingMode["recordingFrequency"] = frequency + expectedFrequency = "DAILY" + else: + expectedFrequency = frequency + print(frequency, expectedFrequency, continuous_regions, region) + + if recordingMode.get("recordingFrequency") != expectedFrequency: + print(f"Setting {region} Config recorder frequency to {expectedFrequency}") + recordingMode["recordingFrequency"] = expectedFrequency recorder["recordingMode"] = recordingMode config.put_configuration_recorder(ConfigurationRecorder=recorder)