Chef syntax with "do" statement While reviewing a chef.io whitepaper, I encountered the following syntax: 

# Load your AWS credentials databag
include_recipe ‘aws’
aws = data_bag_item(‘aws’, ‘main’)
aws_elastic_lb ‘elb_qa’ do
  aws_access_key aws[‘aws_access_key_id’]
  aws_secret_access_key aws[‘aws_secret_access_key’]
  name ‘elb_qa’
  action :register
end


Can you explain or refer to documentation about the "do" statement? 

The common example for the Ruby "do" statement is using "each", which cannot be found in the example above. What does the syntax mean? what here is a parameter, variable, assignment, function, etc.. ?
what you're looking at is a resource declaration, mostly a class taking a block as parameter.

In ruby the do code end syntax is the prefered way over the curly braces syntax { code } which is prefered for inline code.

So mostly, what you have is the same as:

aws_elastic_lb('elb_qa'){ aws_access_key aws[‘aws_access_key_id’]; aws_secret_access_key aws[‘aws_secret_access_key’]; name ‘elb_qa’; action :register }


In recent version of chef (14.X) the name attribute should be the name of the block (what is just after the resource type (aws_elastic_lb)

More details in this SO quastion about ruby syntax.

Concerning Chef itself I highly suggest you follow the tutorials at https://learn.chef.io for a better overview of what is what in cookbooks.