diff --git a/packages/aws-library/src/aws_library/ssm/_client.py b/packages/aws-library/src/aws_library/ssm/_client.py index 90e71fa1048..2b51a93b82a 100644 --- a/packages/aws-library/src/aws_library/ssm/_client.py +++ b/packages/aws-library/src/aws_library/ssm/_client.py @@ -118,8 +118,16 @@ async def get_command(self, instance_id: str, *, command_id: str) -> SSMCommand: instance_ids=[response["InstanceId"]], status=response["Status"] if response["Status"] != "Delayed" else "Pending", message=response["StatusDetails"], - start_time=arrow.get(response["ExecutionStartDateTime"]).datetime, - finish_time=arrow.get(response["ExecutionEndDateTime"]).datetime, + start_time=( + arrow.get(response["ExecutionStartDateTime"]).datetime + if response.get("ExecutionStartDateTime") + else None + ), + finish_time=( + arrow.get(response["ExecutionEndDateTime"]).datetime + if response.get("ExecutionEndDateTime") + else None + ), ) @log_decorator(_logger, logging.DEBUG)