Can I use Puppet to create an Elastic Beanstalk?
The short answer is No.
How do I use Elastic Beanstalk?
You don't actually manage your infrastructure (or the underlying application technology) with Elastic Beanstalk, you just upload your application (e.g use git to push your code) and Beanstalk with deploy it for you.
https://aws.amazon.com/elasticbeanstalk/details/
AWS Elastic Beanstalk is an easy-to-use application management service
for building web apps and web services with popular application
containers such as Java, PHP, Python, Ruby and .NET. Customers upload
their code and Elastic Beanstalk automatically does the rest.
Can I use CloudFormation and Beanstalk together?
Yes. CF Can help you manage a long list of AWS resources including Beanstalk.
The CF documentation is a great place to start http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
Here are the resources that CF can manage:
- AWS::ElasticBeanstalk::Application
- AWS::ElasticBeanstalk::ApplicationVersion
- AWS::ElasticBeanstalk::ConfigurationTemplate
- AWS::ElasticBeanstalk::Environment
Other Options
If you're after more control you may want to look at OpsWorks https://aws.amazon.com/opsworks/ which lets you control the Operating System config via Chef (a CM tool similar to Puppet).
If you want even MORE control you could use CloudFormation directly, this way you could manage every aspect of your infrastructure (and you'll then have full control of the EC2s to manage however you see fit, e.g with a CM tool like Puppet, Chef or Ansible).
Differences
https://aws.amazon.com/opsworks/faqs/
OpsWorks & Beanstalk are application management services.
AWS OpsWorks and AWS CloudFormation are both application management
services that support application modeling, deployment, configuration,
management, and related activities. Both support a wide variety of
architectural patterns, from simple web applications to highly complex
applications. AWS OpsWorks and AWS CloudFormation differ in
abstraction level and areas of focus.
CF allows you to manage almost any AWS Resource
AWS CloudFormation is a building block service that enables customers
to provision and manage almost any AWS resource via a JSON-based
domain specific language.
OpsWorks allows you to do more than Beanstalk
AWS OpsWorks supports a wider variety of architectural patterns than
Elastic Beanstalk. Whereas AWS Elastic Beanstalk is specifically
optimized for the most common web application and web service patterns
and application middleware, AWS OpsWorks supports a wide variety of
architectural patterns, from simple web applications to highly complex
applications.
Review of Options
I like to view these options as a scale (left to right), with the left being easier to use, and the right giving you more control (but requiring more effort to maintain):
Beanstalk -> OpsWorks -> CloudFormation.