================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/base/recipes/aws_monitor_tag.rb
================================================================================
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/base/recipes/aws_monitor_tag.rb:8:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/base/recipes/aws_monitor_tag.rb:
1: include_recipe "aws"
2: data_bag("my_data_bag")
3: db = data_bag_item("my_data_bag", "my")
4: aws = db[ node.chef_environment]['aws']
5: AWS_ACCESS_KEY_ID = aws['AWS_ACCESS_KEY_ID']
6: AWS_SECRET_ACCESS_KEY = aws['AWS_SECRET_ACCESS_KEY']
7:
8>> aws_resource_tag node['ec2']['instance_id'] do
9: aws_access_key aws['AWS_ACCESS_KEY_ID']
10: aws_secret_access_key aws['AWS_SECRET_ACCESS_KEY']
11: tags({"Name" => "Monitor",
12: "node_name" => "#{
node.name}",
13: "environment" => node.chef_environment})
14: action :update
15: end 16:
[2013-07-25T23:32:48+00:00] ERROR: Running exception handlers
[2013-07-25T23:32:48+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2013-07-25T23:32:48+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2013-07-25T23:32:49+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-07-25T23:32:49+00:00] FATAL: NoMethodError: undefined method `[]' for nil:NilClass