Created
March 23, 2020 06:46
-
-
Save Bitatlas/f6a77de3c40b1cbd6ac1aaf148c50f1c to your computer and use it in GitHub Desktop.
EC2 User Data with EC2 Availability Zone echo
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
#!/bin/bash | |
# Use this for your user data (script without newlines) | |
# install httpd (Linux 2 version) | |
yum update -y | |
yum install -y httpd.x86_64 | |
systemctl start httpd.service | |
systemctl enable httpd.service | |
EC2_AVAIL_ZONE=(curl -s http://169.254.169.254/latest/meta-data/placements/availability-zone) | |
echo "<h1> Hello World, this is Henrique Centieiro from $(hostname -f) in AZ SEC2_AVAIL_ZONE </h1> " > /var/www/html/index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment