Description
I encountered a runtime error in the Producer Lambda function (ct_configrecorder_override_producer.py) after deploying the solution.
The Lambda function failed to find the StackSet because it seems to be looking for an exact string match for AWSControlTowerBP-BASELINE-CONFIG.
In my environment (Control Tower 3.3), the actual StackSet name was created with a prefix and suffix, rather than the exact fixed name.
- Expected (Hardcoded):
AWSControlTowerBP-BASELINE-CONFIG
- Actual (My Environment):
StackSet-AWSControlTowerBP-BASELINE-CONFIG-f1219aba-9ea0-457c-bf9a-3a8ca78f79d5
Error Log
StackSetNotFoundException: An error occurred (StackSetNotFoundException) when calling the ListStackInstances operation: StackSet AWSControlTowerBP-BASELINE-CONFIG not found
Root Cause
The StackSet name appears to be hardcoded in ct_configrecorder_override_producer.py:
# ct_configrecorder_override_producer.py
def override_config_recorder(...):
# ...
if account == '':
page_iterator = paginator.paginate(StackSetName='AWSControlTowerBP-BASELINE-CONFIG')
else:
page_iterator = paginator.paginate(StackSetName='AWSControlTowerBP-BASELINE-CONFIG', StackInstanceAccount=account)
Suggested Fix
It would be great if the code could handle dynamic StackSet names (e.g., by searching for a StackSet that contains AWSControlTowerBP-BASELINE-CONFIG instead of an exact match), as the name may vary depending on the deployment environment.
Description
I encountered a runtime error in the Producer Lambda function (
ct_configrecorder_override_producer.py) after deploying the solution.The Lambda function failed to find the StackSet because it seems to be looking for an exact string match for
AWSControlTowerBP-BASELINE-CONFIG.In my environment (Control Tower 3.3), the actual StackSet name was created with a prefix and suffix, rather than the exact fixed name.
AWSControlTowerBP-BASELINE-CONFIGStackSet-AWSControlTowerBP-BASELINE-CONFIG-f1219aba-9ea0-457c-bf9a-3a8ca78f79d5Error Log
Root Cause
The StackSet name appears to be hardcoded in
ct_configrecorder_override_producer.py:Suggested Fix
It would be great if the code could handle dynamic StackSet names (e.g., by searching for a StackSet that contains
AWSControlTowerBP-BASELINE-CONFIGinstead of an exact match), as the name may vary depending on the deployment environment.