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:
- 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.
- 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'] ...