Skip to content

cob16/aws_static_website

Repository files navigation

A static website

On a AWS free account this will cost around $0.60 per month (not including domain registration)

A cloudfront hosted website that uses a private s3 backend

                    +------+       +--------------+      +------+
                    |      |       |              |      |      |
                    | DNS  | +---> |  CloudFront  | +--> |  S3  |
                    |      |       |              |      |      |
                    +------+       +--------------+      +------+

And some monitoring

Cloudwatch billing and usage alerts to pager duty based of customisable thresholds

                    +------------+       +-------+      +-------------+
                    |            |       |       |      |             |
                    | Cloudwatch | +---> |  SNS  | +--> |  Pagerduty  |
                    |            |       |       |      |             |
                    +------------+       +-------+      +-------------+

And finally some overbilling protections

If actual or forecasted budget is exceeded an email is sent and the static website shutdown automatically

            +------------+       +-------+      +-------------+      +-------------+
            |            |       |       |      |             |      |             |
            |  Budgets   | +---> |  SNS  | +--> |   Lambda    | +--> |  CloudFront |
            |            |       |       |      |             |      |             |
            +------------+       +-------+      +-------------+      +-------------+

Prerequisites

  • Terraform (+v0.13)
  • An AWS account (free tier)
  • Pagerduty account (free tier)

Setup

  • Remove line 8 in main.tf backend.s3
  • copy the example tfvars file and edit
cp example.tfvars terraform.tfvars
  • edit terraform.tfvars to fit your needs

Note: The descriptions ofvariables.tf can give you hints

About

A cloudfront hosted website that uses a private s3 backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •