CodeDeploy cannot find appspec.yml in deployment folder

I have placed my appspec.yml as opt/<MY_APP_NAME>/deployment/appspec.yml i-e in my project root directory but codedeploy is trying to find appspec.yml in opt/<MY_APP_NAME>deployment/<DEPLOYMENT_FOLDER>/<HASH_FOLDER>/deployment_archive>/.

How can I provide appspec.yml to codedeploy ? As the deployment_folder is being created dynamically. Thanks.

P.S
This is what codedeploy logs show.
codedeploy logs
I am using ec2 instance with CentOS.

Go to Source
Author: Danish Ahmad