Unknown repository type s3 when creating snapshot in 2.x

I also got this error, initially I installed aws-cloud plugin only on one node and restated then I got this error.
After that installed aws-cloud on all nodes then restated all plugins then it worked.