Skip to content

Commit

Permalink
Fix parameters call
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-amz committed Jul 31, 2024
1 parent 484bba8 commit 5a5a26c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ def process_cloudformation_event(event: CloudFormationCustomResourceEvent, conte
LOGGER.info(f"{request_type} Event")
LOGGER.debug(f"Lambda Context: {context}")

params = get_validated_parameters({"RequestType": event["RequestType"]})
params = get_validated_parameters({"RequestType": event["RequestType"], "ResourceProperties": event["ResourceProperties"]})
regions = common.get_enabled_regions(
params.get("ENABLED_REGIONS", ""),
(params.get("CONTROL_TOWER_REGIONS_ONLY", "false")).lower() in "true",
Expand Down Expand Up @@ -811,7 +811,7 @@ def process_cloudformation_delete_event(event: CloudFormationCustomResourceEvent
LOGGER.info(f"{request_type} Event")
LOGGER.debug(f"Lambda Context: {context}")

params = get_validated_parameters({"RequestType": event["RequestType"]})
params = get_validated_parameters({"RequestType": event["RequestType"], "ResourceProperties": event["ResourceProperties"]})
account_id = params["DELEGATED_ADMIN_ACCOUNT_ID"]

if params["action"] == "Remove":
Expand All @@ -828,7 +828,7 @@ def process_event(event: dict) -> None:
"""
event_info = {"Event": event}
LOGGER.info(event_info)
params = get_validated_parameters({"RequestType": "Update"})
params = get_validated_parameters({"RequestType": "Update", "ResourceProperties": os.environ})

regions = common.get_enabled_regions(params["ENABLED_REGIONS"], params["CONTROL_TOWER_REGIONS_ONLY"] == "true")

Expand Down

0 comments on commit 5a5a26c

Please sign in to comment.