Without additional information, I will not talk about why installing executable scripts fixed your problem, but the accepted answer should not have solved anything except the log statement that you saw.
Take a closer look at the magazine:
2015-10-13 16:36:23 WARN [codedeploy-agent(9918)]: InstanceAgent::Plugins::CodeDeployPlugin::HookExecutor: Script at specified location: codedeploy-scripts/validate-service is not executable. Trying to make it executable.
This is only a warning, not a mistake. The Code Deployment agent noticed that your validate_service.sh script was not executable, and that was " Trying to make it executable." If we look at the appropriate code for the code for deploying the code , you will see that the agent will be chmod +x the script itself.
When you install the scripts in an executable file, you just turned off this warning, and this should not have affected anything else. Looking back at the Deploy agent code in L106, if the agent could not execute your scripts, you would see an error in your logs.
To answer your permission question, you have an incorrectly configured appspec.yml file. When you speak:
permissions: - object: /var/www/html/codedeploy-scripts owner: root mode: 777 type: - directory
You tell Code Deploy that all files of the directory type in /var/www/html/codedeploy-scripts have 777 permissions.
All your scripts under codedeploy-scripts are "file" types (not "folders"), so their permissions have not been set, and permissions apply only to the files in the directory you specify, therefore permissions in the codedeploy-scripts directory codedeploy-scripts not been set.
Here's a description of the appspec.yml type option from AWS docs :
type - Optional. Types of objects to which the specified permissions apply. This can be installed in a file or directory. If a file is specified, permissions will be applied only to files that are immediately contained in the object after the copy operation (and not for the object itself). If a directory is specified, permissions will be recursively applied to all directories / folders that are located somewhere inside the object after the copy operation (but not for the object itself).