Hi Neha,
If the EC2 has been granted a role which permits access to Rekognition, then you should be able to access the Rekognition APIs through CLI or SDK inside the EC2 without needing the access keys. CLI/SDK implementation can be easily done using relevant code stages. For the REST API implementation however you will need to pass the Access Keys in the call.