2

This is the user data used:

#!/bin/bash
yum install httpd -y
yum update -y
aws s3 cp s3://YOURBUCKETNAMEHERE/index.html /var/www/html/
service httpd start
chkconfig httpd on

NAT gateway is configured for the private EC2 instance and also s3fullaccess permissions are given.

Please help me troubleshoot!

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
unknown29
  • 47
  • 5

1 Answers1

0

You can add some code to the start of your user-data script to redirect the output to logs.

exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1

Then you can use those logs to troubleshoot from the AWS Console. Select the instance, then Actions menu -> Instance settings -> Get system log. Here is more documentation on what to add to your bash script, as well as a video that shows where to find the logs.

bwest
  • 9,182
  • 3
  • 28
  • 58