Hello,
I’m trying to create a new aws_route53_record resource from aws cookbook (https://github.com/chef-cookbooks/aws) in ruby_block and run it immediately. Is something like that possible/supported?
The reason I need to do this is that I will know the hostname only in the middle of my ruby_block. I tried to use lazy evaluation, but it doesn’t seem to work, because apparently I can’t set name attribute lazily. This:
route53_record “create a record” do
name lazy { node.run_state[:record_name] + ‘.foo.bar.com’ }
value lazy { node.run_state[:ips] }
type "A"
zone_id "ID VALUE"
overwrite true
fail_on_error false
action :create
end
fails on “undefined method `+’ for nil:NilClass”.