Skip to content

Instantly share code, notes, and snippets.

@AHaydar
Created November 14, 2020 08:52
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 AHaydar/c10ac5a90f5df8e431dd1cd979ce750e to your computer and use it in GitHub Desktop.
Save AHaydar/c10ac5a90f5df8e431dd1cd979ce750e to your computer and use it in GitHub Desktop.
CloudFormation
Resources:
Ec2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-0947d2ba12ee1ff75 # Amazon Linux AMI in us-east-1
KeyName: ec2-instances
Tags:
- Key: Name
Value: My EC2 Instance
- Key: Owner
Value: Ali
UserData:
Fn::Base64: !Sub |
#!/bin/bash
yum update -y # update existing packages
yum install -y httpd # install apache web server
systemctl start httpd
systemctl enable httpd
echo "Hello World" > /var/www/html/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment