From 5a5a26c2980cd193f3522bd5fbf7f815c09b5f93 Mon Sep 17 00:00:00 2001 From: Miclain Keffeler Date: Wed, 31 Jul 2024 06:26:22 -0500 Subject: [PATCH] Fix parameters call --- .../solutions/patch_mgmt/patch_mgmt_org/lambda/src/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws_sra_examples/solutions/patch_mgmt/patch_mgmt_org/lambda/src/app.py b/aws_sra_examples/solutions/patch_mgmt/patch_mgmt_org/lambda/src/app.py index 8dac0fa4..330bff1a 100644 --- a/aws_sra_examples/solutions/patch_mgmt/patch_mgmt_org/lambda/src/app.py +++ b/aws_sra_examples/solutions/patch_mgmt/patch_mgmt_org/lambda/src/app.py @@ -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", @@ -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": @@ -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")