Provisioning AWS instances in a master-agent setup
I am interested in using the puppetlabs-aws module to define all of our EC2/RDS/etc instances. From the puppetlabs-aws examples, it looks like I just need to define a series of resources like this:
ec2_instance { 'my_web_server':
...
}
rds_instance { 'my_db_server':
...
}
But there is one fundamental concept I don't understand: In all of the examples I can find, they write a simple manifest like above and then manually apply them:
puppet apply create.pp --test
But how would this work in a master-agent setup? Do I need to put all of these AWS resource definitions inside of some node which is responsible for actually creating the AWS instances, and then have separate node definitions for configuring each AWS instance, like this?
node 'my_aws_controller' {
ec2_instance { 'my_web_server':
...
}
rds_instance { 'my_db_server':
...
}
}
node 'my_web_server': {
class { 'nginx': }
...
}
Or is there some better way to do this?