Things to Note:
Assign new instance to an IAM Role required for codedeploy to work on that instance while creating the instance, you can’t assign an instance to a new role once it has been initiated
While using Jenkins Aws Codedeploy plugin for Jenkins, the symbolic links are not preserved when the files in the workspace directory are zipped so there may be some error.
To preserver symlinks what I did was
tar the required files and then allow Jenkins aws codedeploy to zip that tar file and deploy it on AWS, then on appspec.yaml file I ran a post install script to untar the tar archive.