Skip to main content


Showing posts with the label userdata and cloudformation

AWS Security Specialty Exam Practice Test

Installing Ansible with CloudFormation and Userdata

AWS game-changing feature of supporting YAML in Cloudformation is a blessing for people who would love to see things in a "proper" format with comments :). Also it reduces the number of lines when compared to JSON. Thanks to Graham  for his basic tutorial on YAML and CloudFormation, borrowed much of his code and added ansible install. I haven't used cfn-init in the below snippet. Will try to enhance the code in future and make it more sophisticated. Please note: I have hard-coded values of my key-pair etc, feel free to remove them. Please do leave a comment if you are running into any issues. I have used RHEL image for this tutorial. AWSTemplateFormatVersion: "2010-09-09" Description: A sample template Parameters: FilePath: Description: The path of the file. Type: String Default: /home/ec2-user/userdata Resources: MyEC2Instance: Type: "AWS::EC2::Instance" # 1 Quotes are unnecessary here - will they always be? Pr