EX — 6 Hosting a static website on Amazon S3
Hosting of static website on Amazon s3. The pre-requisites required for the following are
- An AWS account
- Static webpage that is previously created by you
- Navigate to s3 services in AWS console and create a new bucket providing the website name and make sure that you provide public access to the bucket during creation
2. Open the created bucket and enable website hosting under static website hosting options
3. In the fields of index and error document provide landing page file name and 404 page file name
4. Now its time to upload static website files so inside the bucket choose upload option and upload all the files required for hosting
5. Now navigate to permissions tab and enter bucket policy tab and type the following command but do not forget to change the resource field with you bucket ARN
{
"Version": "2012-10-17",
"Statement":[
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS":"*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::www.ps.com/*"
}
]
}
6. Now copy the the end point from s3 and paste in the URL bar to see the magic
Comments
Post a Comment