You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
In this example we create a static web site using AWS S3 and utilize AWS Cloudfront to distribute
46
48
the content globally.
47
49
@@ -131,6 +133,19 @@ error.html
131
133
* The web site URL format is`http://<bucket-name>.s3-website-<region-name>.amazonaws.com`
132
134
* E.g. this web site was created in`eu-west-1` region with name`my-static-website-jh34jsjmg` so it can be accessed via url`http://my-static-website-jh34jsjmg.s3-website-eu-west-1.amazonaws.com`
133
135
136
+
12. Create CloudFormation distribution for the web site.
137
+
138
+
* The syntax is described in[this reference](https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-distribution.html)
139
+
* E.g. the easiest way is to call`aws cloudfront create-distribution --origin-domain-name my-static-website-jh34jsjmg.s3.amazonaws.com --default-root-object index.html`
140
+
* There's also JSON syntax e.g.`--distribution-config file://dist-config.json` to pass distribution configuration arguments in file
141
+
* The output of the call will show you the exact distribution settings including the generated CloudFront domain name you can use for testing e.g.`d2k3xwnaqa8nqx.cloudfront.net`
142
+
* CloudFormation distribution deployment takes some time, but once it's completed your web site is served from data centers all around the globe!
143
+
144
+
13. That's it! You have implemented a static web site with content distribution network serving it lightning fast all around the world.
145
+
146
+
* To update the web site you need to update the objects in S3 bucket and invalidate the objects in the CloudFront distribution
147
+
* To do it from AWS CLI see[this reference](https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html)
148
+
* Some further development you might want to do is serve the content over https and add a domain name for your site