Chef syntax with "do" statement
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.