1
- # #
1
+
2
+ #
2
3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
# SPDX-License-Identifier: MIT-0
4
5
#
19
20
#
20
21
21
22
import boto3
22
- import cfnresource
23
+ import cfnresponse
23
24
import os
24
25
import logging
25
26
import ast
@@ -69,7 +70,7 @@ def lambda_handler(event, context):
69
70
override_config_recorder (excluded_accounts , sqs_url , '' , 'Create' )
70
71
response = {}
71
72
## 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" )
73
74
elif ('LogicalResourceId' in event ) and (event ['RequestType' ] == 'Update' ):
74
75
logging .info ('Update Update' )
75
76
logging .info (
@@ -79,15 +80,15 @@ def lambda_handler(event, context):
79
80
update_excluded_accounts (excluded_accounts ,sqs_url )
80
81
81
82
## 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" )
83
84
elif ('LogicalResourceId' in event ) and (event ['RequestType' ] == 'Delete' ):
84
85
logging .info ('DELETE DELETE' )
85
86
logging .info (
86
87
'overriding config recorder for ALL accounts because of first run after function deployment from CloudFormation' )
87
88
override_config_recorder (excluded_accounts , sqs_url , '' , 'Delete' )
88
89
response = {}
89
90
## 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" )
91
92
else :
92
93
logging .info ("No matching event found" )
93
94
0 commit comments