If you've ever tried to setup Chef Server on AWS with CloudFormation (CF) using the official template (found here), you'll understand when I say it isn't a stroll in the park.
I hope to make it a little easier to setup Chef Server on EC2 by creating a CF template that works and is (somewhat) easy to read and follow.
The secret weapon here is an up-to-date version of the Chef Server Cookbook
.
Using the template to setup a Chef Server should be pretty straight-forward.
Here's an example using awscli
command line tool:
aws cloudformation create-stack --stack-name "chef-server" --template-body file:///path/to/aws-cf-chef-server.json --capabilities ... --parameters ...
######Note:
AWS Resources: This will create an EC2 instance (m1.small) and S3 bucket.
Parameters: The the template expects four parameters: ChefServerCookbookVersion
, InstanceType
, KeyName
, ChefServerFQDN
and SSHLocation
. These are self-explanatory. KeyName
and ChefServerFQDN
are required.
Access Keys: The .pem keys needed by knife
to access the chef server from your workstation will be copied to the S3 bucket. You can download the keys from there.
If you want to have a play without racking up a few cents/pennies, you can setup chef server on a Vagrant
VM.
All you need to do is vagrant up --provision
.
Note: You need to have vagrant-librarian-chef
plugin installed.