Since Amazon began offering OpsWorks earlier this year, I’ve been looking forward to giving it a go and picking up some Chef know-how in the process. I have come upon a rather painful issue where a single cookbook in my git repository’s root continuously threw Chef’s CookbookNotFound exception. After hours of futile trial and error and a heap of Googling I finally happened upon this thread in the AWS forums.

The important takeaways are:

  • OpsWorks doesn’t currently handle single-cookbook repositories correctly.
  • Putting your cookbook in a subdirectory of the git repository should work.

I suppose this explains why all of Amazon’s example cookbooks are parented under the same repository! To avoid this insanity in the future, you may as well just create the cookbook in a subdirectory of a git repository to begin with.

mkdir my_app_cookbook
cd my_app_cookbook
git init
knife cookbook create my_app -o ./