@aniket5003 NiFi can be added to ambari using one of the HDF Management packs. Depending on your relationship with Cloudera, you may need to use your account to get after the NiFi 1.12.1 management pack. I do know other versions are out on the open internet (1.9 and below), but newest versions will require a cloudera username and password to access repos and artifacts. Once you have a management pack added to ambari, you should be able to install nifi and other HDF components in an HDP cluster.
Additionally you can get 1.12.1 from nifi.apache.org and install outside of ambari interface if you need something quick.
If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.