Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active May 17, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanpedala/8fd9e2732c046a95f027712ea36ff759 to your computer and use it in GitHub Desktop.
Save mohanpedala/8fd9e2732c046a95f027712ea36ff759 to your computer and use it in GitHub Desktop.
Userdata for chef-workstation on AWS EC2

Userdata for chef-workstation on AWS EC2

Copy paste the below userdata into userdata section when creating a new EC2 instance on AWS EC2. Userdata section is available in Advanced Options Section.

#!/bin/bash
echo BEGIN
sudo yum update -y
sudo yum install -y wget git
wget https://packages.chef.io/files/stable/chefdk/1.4.3/el/7/chefdk-1.4.3-1.el7.x86_64.rpm
sudo rpm -ivh chefdk-1.4.3-1.el7.x86_64.rpm
echo "export PS1='chef-workstation $'" >> /home/ec2-user/.bashrc
echo END

This job takes 15min to execute based on the instance you have selected. Please click here for the procedure to monitor logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment