I do this rarely and so when I do have to override a template, I forget simple things that leave me scratching my head for hours, so I'm sharing them with you in hopes of drilling them into my head (and because i'm just a good-guy-greg):
First of all, to override a template, you have to enable custom cookbooks for your stack. Next, you have to mirror the directory structure of the AWS opsworks recipe in your own custom cookbooks repo. For example, let's say I wanted to override the default haproxy template. Starting with the top level directory of the repo itself, the path to the haproxy config template is:
opsworks-cookbooks / haproxy / templates / default / haproxy.cfg.erb
...so in my custom cookbook repo, I have to reflect the same structure:
your-custom-cookbook / haproxy / templates / default / haproxy.cfg.erb
If you are just overriding a template, do not copy anything else from the AWS repo, especially recipe *.rb files. This will cause errors. The only other thing you need, is a metadata.rb file in the root level directory of the cookbook folder you are mirroring, e.g. in the above example, in the "haproxy" directory level:
This is how the the AWS opsworks chef workflow recognizes that the directory contains Chef cookbook code ("I am a cookbook!").
One more detail, which is important if you are using a Berksfile, which I am:
Update your berksfile to indicate the new cookbook should be included:
cookbook 'haproxy', path: './haproxy'
The AWS docs don't mention this Berksfile stuff - probably because they assume you know what you're doing, but if you basically just improvise everything like me, then maybe this will help you ^_^