Per the OpsWorks documentation with Chef v11 or earlier you could access a deploy key by doing:
include 'deploy'
key = node[:deploy]['appshortname'][:scm][:ssh_key]
However per OpsWorks with Chef 12 documentation:
To migrate your recipe code that accesses stack settings from Chef 11.10 and earlier versions for Linux to Chef 12 Linux, you must revise your code to:
- Access Chef data bags instead of Chef attributes.
- Use Chef search instead of the Chef node object.
- Use AWS OpsWorks data bag names such as aws_opsworks_app, instead of using AWS * OpsWorks attribute names such as opsworks and deploy.
My issue is that the documentation on how to access the ssh_key for deploy hasn't been updated to show where in the databags I can find the key.
Does anyone know of up-to-date documentation or can someone point me in the right direction for locating the ssh deploy key?