I'm attempting to use s3_file from chef-cookbooks/aws (https://github.com/chef-cookbooks/aws). I've tried several variations of the following, all of which fail:
include_recipe 'aws'
include_recipe 's3_file'
aws_s3_file '/usr/local/file.tar.gz' do
bucket 'my-bucket'
remote_path 'file.tar.gz'
owner 'user'
group 'user'
aws_access_key_id 'secret'
aws_secret_access_key 'secret'
end
This is my error:
NameError
---------
uninitialized constant Aws
I've been watching two related issues for a couple of weeks:
[1] https://github.com/chef-cookbooks/aws/pull/183#issuecomment-159456234
[2] https://github.com/chef-cookbooks/aws/issues/181#issuecomment-159687243
Issue #183 references the following from the aws cookbook:
https://github.com/chef-cookbooks/aws#defaultrb
The default recipe installs the aws-sdk Ruby Gem, which this cookbook requires
in order to work with the EC2 API. Make sure that the aws recipe is in the
node or role run_list before any resources from this cookbook are used.
"run_list": [
"recipe[aws]"
]
I do see that the required gems are being installed. I also see that the aws and s3_file cookbooks are installed on the instance in berkshelf-cookbooks.
I do not understand how to add the aws recipe to the run_list in OpsWorks. I've tried executing aws::default directly with no luck. Can someone please provide me with an example or a lead on how to add a recipe to a run_list in OpsWorks?
I suspect my problem is newb related. I'm likely experiencing confusion between the cheesy culinary based terminology (pun intended) and the abstraction provided by OpsWorks. If I've failed to include any details then please let me know.
For what it's worth, this is an ongoing issue for new releases of the aws Chef Cookbook. There was further confirmation of this by a very recent bug report:
https://github.com/chef-cookbooks/aws/issues/181#issuecomment-159687243
Downgrading to v2.5.0 resolved all of my issues.