So I am writing a ruby script that will help with our deployments and as part of that I am leveraging the Chef REST API which is great but with some of that information I want to be able to pass that over to knife to do deletes. An example code is the following:
delete_ec2 = Chef::Ec2ServerDelete.new()
delete_ec2.name_args = node.ec2.instance_id
This works but I get the following error:
ERROR: You did not provided a valid ‘AWS Access Key Id’ value.
ERROR: You did not provided a valid ‘AWS Secret Access Key’ value.
But both are set and work correctly from the command line. Also If I do this using the knife exec command it works. I assume I am missing something in my ruby but I am just pulling a blank and can’t seem to find any hints from looking at the chef/knife source code. Any pointers would be great.