@@ -482,7 +482,7 @@ def deploy_state_table() -> None:
482482 DRY_RUN_DATA ["StateTableCreate" ] = f"DRY_RUN: Create the { STATE_TABLE } state table"
483483
484484
485- def add_state_table_record (aws_service : str , component_state : str , description : str , component_type : str , resource_arn : str , account_id : str , region : str , component_name : str , key_id : str = "" ) -> str :
485+ def add_state_table_record (aws_service : str , component_state : str , description : str , component_type : str , resource_arn : str , account_id : str | None , region : str , component_name : str , key_id : str = "" ) -> str :
486486 """Add a record to the state table
487487 Args:
488488 aws_service (str): aws service
@@ -499,6 +499,8 @@ def add_state_table_record(aws_service: str, component_state: str, description:
499499 None
500500 """
501501 LOGGER .info (f"Add a record to the state table for { component_name } " )
502+ if account_id == None :
503+ account_id = "Unknown"
502504 # TODO(liamschn): check to ensure we got a 200 back from the service API call before inserting the dynamodb records
503505 dynamodb .DYNAMODB_RESOURCE = sts .assume_role_resource (ssm_params .SRA_SECURITY_ACCT , sts .CONFIGURATION_ROLE , "dynamodb" , sts .HOME_REGION )
504506
@@ -534,7 +536,7 @@ def add_state_table_record(aws_service: str, component_state: str, description:
534536 return sra_resource_record_id
535537
536538
537- def remove_state_table_record (resource_arn : str ) -> dict :
539+ def remove_state_table_record (resource_arn : str ) -> Any :
538540 """Remove a record from the state table
539541
540542 Args:
@@ -946,7 +948,7 @@ def deploy_central_cloudwatch_observability(event: dict) -> None:
946948 cloudwatch .SINK_POLICY ["Statement" ][0 ]["Condition" ]["ForAnyValue:StringEquals" ]["aws:PrincipalOrgID" ] = ORGANIZATION_ID
947949 if search_oam_sink [0 ] is False and DRY_RUN is True :
948950 LOGGER .info ("DRY_RUN: CloudWatch observability access manager sink doesn't exist; skip search for sink policy..." )
949- search_oam_sink_policy = False , {}
951+ search_oam_sink_policy : tuple [ bool , dict ] = False , {}
950952 else :
951953 search_oam_sink_policy = cloudwatch .find_oam_sink_policy (oam_sink_arn )
952954 if search_oam_sink_policy [0 ] is False :
0 commit comments