Created
November 14, 2020 08:52
-
-
Save AHaydar/c10ac5a90f5df8e431dd1cd979ce750e to your computer and use it in GitHub Desktop.
CloudFormation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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