O'Reilly logo

Puppet 5 Cookbook - Fourth Edition by Thomas Uphill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

We'll create a simple instance in this example. To create an instance, we need a minimum environment. We need a VPC (a Virtual Private Cloud). Our VPC will need a network, a security group, and a default route:

  1. Create a new module to hold the code. You can use PDK, puppet module generate, or just make the directories. I'm using the name cookbook_aws.
  2. Create an init.pp file to contain the cookbook_aws class:
# AWS classclass cookbook_aws (  String $availability_zone = 'us-west-2a',  String $region = 'us-west-2',  String $vpc = 'cookbook_aws',) {  include cookbook_aws::instance  include cookbook_aws::network  include cookbook_aws::securitygroup  include cookbook_aws::vpc  Class['cookbook_aws::vpc'] -> Class['cookbook_aws::securitygroup'] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required