Hello Andrii,
I think it's possible to apply the same approach by taking the AWS SDK clients out of the handler and mocking them. In the case of Lambda functions used as backend of CloudFormation Custom resources you should also mock the HTTP request (passing an additional mocked HTTP client to the "customLogic" function) that is executed to change the status of the resource. This is in case you want to run the entire handler from start to finish and then evaluate the methods call using "expect(sendRequestSpy).toHaveBeenCalledWith(payload)" (https://vitest.dev/api/expect.html#tohavebeencalledwith).
You could instead avoid this mock by letting the request execute in the main handler and expect the payload that will be sent in the HTTP request as the return value of the "customLogic" function and simply test the functioning of this part of the processing.