Skip to content

Commit bbf7b41

Browse files
authored
Added support for periodic recording
1 parent 7bc65aa commit bbf7b41

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ct_configrecorder_override_producer.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# #
1+
2+
#
23
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
34
# SPDX-License-Identifier: MIT-0
45
#
@@ -19,7 +20,7 @@
1920
#
2021

2122
import boto3
22-
import cfnresource
23+
import cfnresponse
2324
import os
2425
import logging
2526
import ast
@@ -69,7 +70,7 @@ def lambda_handler(event, context):
6970
override_config_recorder(excluded_accounts, sqs_url, '', 'Create')
7071
response = {}
7172
## Send signal back to CloudFormation after the first run
72-
cfnresource.send(event, context, cfnresource.SUCCESS, response, "CustomResourcePhysicalID")
73+
cfnresponse.send(event, context, cfnresponse.SUCCESS, response, "CustomResourcePhysicalID")
7374
elif ('LogicalResourceId' in event) and (event['RequestType'] == 'Update'):
7475
logging.info('Update Update')
7576
logging.info(
@@ -79,15 +80,15 @@ def lambda_handler(event, context):
7980
update_excluded_accounts(excluded_accounts,sqs_url)
8081

8182
## Send signal back to CloudFormation after the first run
82-
cfnresource.send(event, context, cfnresource.SUCCESS, response, "CustomResourcePhysicalID")
83+
cfnresponse.send(event, context, cfnresponse.SUCCESS, response, "CustomResourcePhysicalID")
8384
elif ('LogicalResourceId' in event) and (event['RequestType'] == 'Delete'):
8485
logging.info('DELETE DELETE')
8586
logging.info(
8687
'overriding config recorder for ALL accounts because of first run after function deployment from CloudFormation')
8788
override_config_recorder(excluded_accounts, sqs_url, '', 'Delete')
8889
response = {}
8990
## Send signal back to CloudFormation after the final run
90-
cfnresource.send(event, context, cfnresource.SUCCESS, response, "CustomResourcePhysicalID")
91+
cfnresponse.send(event, context, cfnresponse.SUCCESS, response, "CustomResourcePhysicalID")
9192
else:
9293
logging.info("No matching event found")
9394

0 commit comments

Comments
 (0)