Essentially it helps to create two different files (i.e. one for the general config related information and the second for the credentials related information).
For me the issue was the service was starting the root user so it was not able to find the AWS config file. I fixed it by making the service start from non root user sot hat AWS config could be found.