The error is correct: you can't use a symbol as an array index.
By the output of you last line, since it starts with a [
, it is an array.
Most likely you are trying to index the dictionary on the second position of the array with the symbol :private_ip
. In this case, the correct line is
node[:opsworks][:layers][:admin][:instances].first[1][:private_ip]
You need to go step by step in your mind. If node[:opsworks][:layers][:admin][:instances].first
returns
["admin1", {"elastic_ip"=>"54.221.245....}]
Then node[:opsworks][:layers][:admin][:instances].first[1]
will return
{"elastic_ip"=>"54.221.245....}