Open manishawsdevops opened 1 year ago
UserData:
#!/bin/bash yum install httpd -y systemctl start httpd systemctl enable httpd systemctl status httpd instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id) echo "<h1>$instanceId</h1>" > /var/www/html/index.html
Simple HTML File
<!DOCTYPE html> <html> <head> <title>Hello, World!</title> </head> <body> <h1>Hello, World!</h1> </body> </html>
Bucket Policy for granting S3 bucket webhosting access.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::Bucket-Name/*" ] } ] }
UserData:
Simple HTML File
Bucket Policy for granting S3 bucket webhosting access.