From ebca5c79bf5b61f100843204ead9de9319843363 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 11:44:36 +0100 Subject: [PATCH 1/7] work in progress --- README.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22f5204..78ac310 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,90 @@ +--- +marp: true +theme: default +paginate: true +--- # aws-static-website-cloudformation Deploy a static Website in AWS S3 as Proof of Concept, using CloudFormation. Eventually implent dynamic features like CI/CD or serverless guestbook/contact form. -This can serve as pay-per-use template for your static Websites hostet on AWS. \ No newline at end of file +This can serve as pay-per-use template for your static Websites hostet on AWS. + +--- + +## purpose + +A minimalistic CloudFormation template, following Amazons [Guide][guide] for **hosting static websites**, without their overwhelming [500+ lines template][template]. + +- Minimalistic CloudFormation example for +- provisioning static webspace using +- aws s3 bucket + - unblocked access + - attached Read Policies + - configured as website serving index.html by default + +--- + +## target audience + +- AWS Cloud Practitioners seeking hands-on AWS experience +- AWS CloudFormation learners or starters +- Webmasters looking for static pay-as-you-go webspace that later can be highly extended and scaled. + +--- + +## AWS services used + +- AWS CloudFormation Stacks + - provision s3 storage + - attach Policy + - drift detection (optional) +- AWS S3 - Simple Storage Service + - s3 can be used for backup, backend storage, versioned repositories, and even DataLakes. + - it also serves as webspace for CloudFront and CDNs + - it can also be configured as standlone-webspace, which is our scope +- AWS SDK (cli) (optional) +- AWS CloudShell (optional) + +--- + + +## provisioning and deployment + +All you need is an aws account, that could be free tier or even a KodeKloud AWS playground. +- login to aws +- head to CloudFormation Stacks + +--- + +## programmatic deployment + +--- + +## cost calculation + +--- + +## limitations + +- no https transport encryption without CloudFront +- no custom sub/domain without CloudFront # TODO +- no dynamic content (3rd party could be utilized) +- no content limitation to verified/registered users +- + +--- + +## disclaimer and known risks + +This template comes "as it is" with out any warranty for completeness. +You also must be aware, that a serverless pay-as-you-go service like s3 - especially when configured as public space - because of is elasticity - can generate high costs if your website is downloaded often. +This might be intended by high-scale companies but could generate existential risks for individuals. +Use aws budget notifications, free tier without payment details, and other tools to protect yourself whilst testing. + +--- + +## links + +[guide]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html "AWS Guide for hosting static websites on s3" +[Template]: https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/S3/compliant-static-website.yaml "complete compliant-static-website.yaml" From 0bbd9db3904c9080a2857bb157ed9384e96665a7 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 14:00:04 +0100 Subject: [PATCH 2/7] work in progress TODO: cost, diagram, code explaination --- README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78ac310..51d9ad1 100644 --- a/README.md +++ b/README.md @@ -48,20 +48,40 @@ A minimalistic CloudFormation template, following Amazons [Guide][guide] for **h --- - ## provisioning and deployment -All you need is an aws account, that could be free tier or even a KodeKloud AWS playground. +You need an aws account, could also be free tier. - login to aws - head to CloudFormation Stacks +- Upload [s3.cf.yml](./cloudformation/s3.cf.yml) +- choose an AppName (the Bucket name will be created from it): +`BucketName: !Sub "${AppName}-${AWS::Region}-${AWS::AccountId}"` +- deploy the Stack in the desired Region +- wait for the blue Stack State to turn green CREATION_COMPLETED +- see the Stack Output for information + - S3 bucket name - you can upload your website here + - SiteUrl - feel free to test from a browser that is NOT logged in to aws --- ## programmatic deployment +- install aws cli and git +- login `aws login` + - orw create an API on the MMC key using CloudShell: + `aws iam create-access-key` copy and paste into your ~/.aws/credentials +- clone [repo][repolink]: `git clone https://github.com/Codingschule/aws-static-website-cloudformation.git` +- cd into the dictionary +`cd aws-static-website-cloudformation` +- upload the Stack (change region) +`aws cloudformation deploy --template-body 'file://cloudformation/s3.cf.yml' --region=us-east-1 --stack-name RandomStackName` +instead **deploy** you can use **create-stack** or **update-stack** to be more specific. + --- -## cost calculation +## cost calculation example + +Since inbound traffic is usually free and you only use an S3 bucket (default tarrif) --- @@ -88,3 +108,4 @@ Use aws budget notifications, free tier without payment details, and other tools [guide]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html "AWS Guide for hosting static websites on s3" [Template]: https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/S3/compliant-static-website.yaml "complete compliant-static-website.yaml" +[repolink]: https://github.com/Codingschule/aws-static-website-cloudformation "Internal link to this repository" From e8d431fa16fcae364a8739c83646d7efaae8f7e9 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 14:50:55 +0100 Subject: [PATCH 3/7] done: cost. todo: fazit --- README.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51d9ad1..d6bdfa7 100644 --- a/README.md +++ b/README.md @@ -79,17 +79,92 @@ instead **deploy** you can use **create-stack** or **update-stack** to be more s --- -## cost calculation example +## cost calculation examples -Since inbound traffic is usually free and you only use an S3 bucket (default tarrif) +Since inbound traffic is usually free and you only use an S3 bucket (default tarrif), the estimated costs depend on the size and frequency of the website. + +- uploading / updating the website: usually low cost compared to outbound +- storage: storage actually used +- outbound traffic: + - number of requests + - data transfered out + +The following examples were calculated for us-east-1 on Jan 27th 2026 and are mere examples. +They give you an idea how cost changes with file size but also number of files. + + +--- + +### Cost for 1kB Website (1 file), called 1mio times, updated daily + +| Category | Description | Calculation | Cost (USD) | +| ----------------------------------- | ------------------------------ | ------------------------- | ------------ | +| **S3 Std – storage** | Tiered price | 0,000001 GB × 0,023 USD | 0,00 | +| **S3 Std – PUT** | 30 PUT Requests | 30 × 0,000005 USD | 0,0001 | +| **S3 Std – GET** | 1.000.000 GET Requests | 1.000.000 × 0,0000004 USD | 0,40 | +| **S3 Select – transfer** | Datenrücksendung | 1 GB × 0,0007 USD | 0,0007 | +| **monthly cost** | Storage + Requests + S3 Select | 0,40 + 0,0001 + 0,0007 | **0,40** | + + +--- + +### Cost for 10 MB Website (1 file), completely called 1mio times, updated daily + +| Category | Description | Calculation | Cost (USD) | +| ------------------------------------------ | -------------------------------- | ------------------------------ | ---------- | +| **S3 Std – Storage** | Tiered price | 0.01 GB × 0.023 USD | 0.00 | +| **S3 Std – Storage (tier)** | Total tier cost | – | 0.0002 | +| **S3 Std – PUT** | 30 PUT requests | 30 × 0.000005 USD | 0.0001 | +| **S3 Std – GET** | 1,000,000 GET | 1,000,000 × 0.0000004 USD | 0.40 | +| **S3 Select – Data Returned** | Data return | **10,240 GB × 0.0007** USD | 7.168 | +| **Total (Storage + Requests + S3 Select)** | Combined monthly cost | 0.0002 + 0.40 + 0.0001 + 7.168 | **7.57** | +| **Monthly Cost (S3 Std)** | Total monthly cost | – | **7.57** | + + +--- + +### Cost 10 MB Site, but 100 files, completely called 1mio times + +| Category | Description | Calculation | Cost (USD) | +| ------------------------------------------ | ---------------------------------- | ------------------------------ | ---------- | +| **S3 Std – Storage** | Tiered price | 0.01 GB × 0.023 USD | 0.00 | +| **S3 Std – Storage** | Total tier cost | – | 0.0002 | +| **S3 Std – PUT** | 3,000 PUT requests | 3,000 × 0.000005 USD | 0.015 | +| **S3 Std – GET** | 100 Mio GET | **100 mio × 0.0000004** USD | **40.00** | +| **S3 Select – Data** | Data return | 10,240 GB × 0.0007 USD | 7.168 | +| **Total** | Combined | 0.0002 + 40.00 + 0.015 + 7.168 | **47.18** | + + +See [calculate.aws][calc] for detailed calculations + +--- + +## chances and risks of using AWS for website hosting + +```mermaid +quadrantChart + title Opportunities vs Risks + x-axis Low Impact --> High Impact + y-axis Low Probability --> High Probability + + quadrant-1 High Chance / High Risk + quadrant-2 High Chance / Low Risk + quadrant-3 Low Chance / Low Risk + quadrant-4 Low Chance / High Risk + + Cloud Cost Optimization: [0.7, 0.8] + S3 Select Usage: [0.6, 0.4] + Cache Layer: [0.3, 0.2] + Over-Engineering: [0.8, 0.6] +``` --- -## limitations +## limitations and outlook -- no https transport encryption without CloudFront +- add CloudFront for HTTPS transport encryption - no custom sub/domain without CloudFront # TODO -- no dynamic content (3rd party could be utilized) +- dynamic content requires compute services and/or databases - no content limitation to verified/registered users - @@ -109,3 +184,4 @@ Use aws budget notifications, free tier without payment details, and other tools [guide]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html "AWS Guide for hosting static websites on s3" [Template]: https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/S3/compliant-static-website.yaml "complete compliant-static-website.yaml" [repolink]: https://github.com/Codingschule/aws-static-website-cloudformation "Internal link to this repository" +[calc]: https://calculator.aws/ "AWS cost calculator" \ No newline at end of file From c0adb21f2a6da1b3cdbe565cc030b3d07c4c4a6c Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 15:13:50 +0100 Subject: [PATCH 4/7] doc smostly finished --- README.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d6bdfa7..7aa7db0 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,6 @@ Since inbound traffic is usually free and you only use an S3 bucket (default tar The following examples were calculated for us-east-1 on Jan 27th 2026 and are mere examples. They give you an idea how cost changes with file size but also number of files. - --- ### Cost for 1kB Website (1 file), called 1mio times, updated daily @@ -143,19 +142,21 @@ See [calculate.aws][calc] for detailed calculations ```mermaid quadrantChart - title Opportunities vs Risks - x-axis Low Impact --> High Impact - y-axis Low Probability --> High Probability - - quadrant-1 High Chance / High Risk - quadrant-2 High Chance / Low Risk - quadrant-3 Low Chance / Low Risk - quadrant-4 Low Chance / High Risk - - Cloud Cost Optimization: [0.7, 0.8] - S3 Select Usage: [0.6, 0.4] - Cache Layer: [0.3, 0.2] - Over-Engineering: [0.8, 0.6] + title AWS Static Website Hosting – Opportunities vs Risks + x-axis Low Traffic --> Unexpected High Traffic + y-axis Low Impact --> High Impact + + quadrant-1 High Opportunity / High Risk + quadrant-2 High Opportunity / Low Risk + quadrant-3 Low Opportunity / Low Risk + quadrant-4 Low Opportunity / High Risk + + Low Cost Hosting: [0.2, 0.2] + Simple Architecture: [0.3, 0.3] + Automatic Scalability: [0.7, 0.4] + High GET Request Costs: [0.8, 0.8] + CDN Mitigation (CloudFront): [0.6, 0.5] + Traffic Spike Risk: [0.9, 0.7] ``` --- @@ -184,4 +185,6 @@ Use aws budget notifications, free tier without payment details, and other tools [guide]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html "AWS Guide for hosting static websites on s3" [Template]: https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/S3/compliant-static-website.yaml "complete compliant-static-website.yaml" [repolink]: https://github.com/Codingschule/aws-static-website-cloudformation "Internal link to this repository" -[calc]: https://calculator.aws/ "AWS cost calculator" \ No newline at end of file +[calc]: https://calculator.aws/ "AWS cost calculator" +[matt]: https://github.com/yasuoiwakura "Matthias Block" +[sam]: https://github.com/hackbraten68 "Sam Dillenburg" \ No newline at end of file From 2ec72aaef785d9622b4f721b90ebe58daca22448 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:11:00 +0100 Subject: [PATCH 5/7] finish docs --- README.md | 63 +++++++++++++++++++------------------------------------ 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 7aa7db0..96ac6d6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ ---- + # aws-static-website-cloudformation Deploy a static Website in AWS S3 as Proof of Concept, using CloudFormation. @@ -10,8 +10,6 @@ Eventually implent dynamic features like CI/CD or serverless guestbook/contact f This can serve as pay-per-use template for your static Websites hostet on AWS. ---- - ## purpose A minimalistic CloudFormation template, following Amazons [Guide][guide] for **hosting static websites**, without their overwhelming [500+ lines template][template]. @@ -23,16 +21,12 @@ A minimalistic CloudFormation template, following Amazons [Guide][guide] for **h - attached Read Policies - configured as website serving index.html by default ---- - ## target audience - AWS Cloud Practitioners seeking hands-on AWS experience - AWS CloudFormation learners or starters - Webmasters looking for static pay-as-you-go webspace that later can be highly extended and scaled. ---- - ## AWS services used - AWS CloudFormation Stacks @@ -46,8 +40,6 @@ A minimalistic CloudFormation template, following Amazons [Guide][guide] for **h - AWS SDK (cli) (optional) - AWS CloudShell (optional) ---- - ## provisioning and deployment You need an aws account, could also be free tier. @@ -62,8 +54,6 @@ You need an aws account, could also be free tier. - S3 bucket name - you can upload your website here - SiteUrl - feel free to test from a browser that is NOT logged in to aws ---- - ## programmatic deployment - install aws cli and git @@ -77,7 +67,10 @@ You need an aws account, could also be free tier. `aws cloudformation deploy --template-body 'file://cloudformation/s3.cf.yml' --region=us-east-1 --stack-name RandomStackName` instead **deploy** you can use **create-stack** or **update-stack** to be more specific. ---- +## website url + +If your AppName is `cs-itpro``and you deploy on us-east-1 using account 313333333337 your URL would be +http://cs-itpro-s3web-us-east-1-313333333337.s3-website-us-east-1.amazonaws.com/ ## cost calculation examples @@ -92,8 +85,6 @@ Since inbound traffic is usually free and you only use an S3 bucket (default tar The following examples were calculated for us-east-1 on Jan 27th 2026 and are mere examples. They give you an idea how cost changes with file size but also number of files. ---- - ### Cost for 1kB Website (1 file), called 1mio times, updated daily | Category | Description | Calculation | Cost (USD) | @@ -107,7 +98,7 @@ They give you an idea how cost changes with file size but also number of files. --- -### Cost for 10 MB Website (1 file), completely called 1mio times, updated daily +### Cost for 10 MB Website (stored as 1 file), completely requested 1mio times | Category | Description | Calculation | Cost (USD) | | ------------------------------------------ | -------------------------------- | ------------------------------ | ---------- | @@ -119,10 +110,9 @@ They give you an idea how cost changes with file size but also number of files. | **Total (Storage + Requests + S3 Select)** | Combined monthly cost | 0.0002 + 0.40 + 0.0001 + 7.168 | **7.57** | | **Monthly Cost (S3 Std)** | Total monthly cost | – | **7.57** | - --- -### Cost 10 MB Site, but 100 files, completely called 1mio times +### Cost of 10 MB Site (100 files x 0.1 MB), each requested 1mio times | Category | Description | Calculation | Cost (USD) | | ------------------------------------------ | ---------------------------------- | ------------------------------ | ---------- | @@ -138,28 +128,17 @@ See [calculate.aws][calc] for detailed calculations --- -## chances and risks of using AWS for website hosting - -```mermaid -quadrantChart - title AWS Static Website Hosting – Opportunities vs Risks - x-axis Low Traffic --> Unexpected High Traffic - y-axis Low Impact --> High Impact +## Business opportunities and risks using AWS for website hosting - quadrant-1 High Opportunity / High Risk - quadrant-2 High Opportunity / Low Risk - quadrant-3 Low Opportunity / Low Risk - quadrant-4 Low Opportunity / High Risk +AWS S3 storage starts cheap and scales with cost. - Low Cost Hosting: [0.2, 0.2] - Simple Architecture: [0.3, 0.3] - Automatic Scalability: [0.7, 0.4] - High GET Request Costs: [0.8, 0.8] - CDN Mitigation (CloudFront): [0.6, 0.5] - Traffic Spike Risk: [0.9, 0.7] -``` +- Low Traffic + - You pay only storage - no visitors, no traffic, almost no cost +- Unexpected High Traffic + - High costs + - No fear of outtage and reputation loss + - Eventually more Customers generating revenue ---- ## limitations and outlook @@ -167,9 +146,6 @@ quadrantChart - no custom sub/domain without CloudFront # TODO - dynamic content requires compute services and/or databases - no content limitation to verified/registered users -- - ---- ## disclaimer and known risks @@ -180,11 +156,14 @@ Use aws budget notifications, free tier without payment details, and other tools --- -## links +## Autor +- [Matthias Block][matt]: Content +- [Sam Dillenburg][sam]: Mentoring +- Your favourite LLM: Confusion [guide]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html "AWS Guide for hosting static websites on s3" [Template]: https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/S3/compliant-static-website.yaml "complete compliant-static-website.yaml" [repolink]: https://github.com/Codingschule/aws-static-website-cloudformation "Internal link to this repository" [calc]: https://calculator.aws/ "AWS cost calculator" [matt]: https://github.com/yasuoiwakura "Matthias Block" -[sam]: https://github.com/hackbraten68 "Sam Dillenburg" \ No newline at end of file +[sam]: https://github.com/hackbraten68 "Sam Dillenburg" From 90e25fddc5654504dea003d1a2361b4f4bf57252 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:13:30 +0100 Subject: [PATCH 6/7] fix docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96ac6d6..12ff8df 100644 --- a/README.md +++ b/README.md @@ -74,16 +74,16 @@ http://cs-itpro-s3web-us-east-1-313333333337.s3-website-us-east-1.amazonaws.com/ ## cost calculation examples -Since inbound traffic is usually free and you only use an S3 bucket (default tarrif), the estimated costs depend on the size and frequency of the website. +Since inbound traffic is usually free and you only use an S3 bucket (default tarrif), the estimated costs depend on the size of the website, the number of files involed, and frequency of the website be requested. - uploading / updating the website: usually low cost compared to outbound - storage: storage actually used - outbound traffic: - number of requests - - data transfered out + - data transfered out of aws The following examples were calculated for us-east-1 on Jan 27th 2026 and are mere examples. -They give you an idea how cost changes with file size but also number of files. +They give you an idea how cost changes with file **size** but also **number** of files. ### Cost for 1kB Website (1 file), called 1mio times, updated daily From 401a36976db3f7ddabf6d269f93d85dc23751175 Mon Sep 17 00:00:00 2001 From: Matt <8234100+yasuoiwakura@users.noreply.github.com> Date: Wed, 28 Jan 2026 08:46:55 +0100 Subject: [PATCH 7/7] doc smaller fixes --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 12ff8df..9d883e4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Eventually implent dynamic features like CI/CD or serverless guestbook/contact f This can serve as pay-per-use template for your static Websites hostet on AWS. -## purpose +## Purpose A minimalistic CloudFormation template, following Amazons [Guide][guide] for **hosting static websites**, without their overwhelming [500+ lines template][template]. @@ -21,7 +21,7 @@ A minimalistic CloudFormation template, following Amazons [Guide][guide] for **h - attached Read Policies - configured as website serving index.html by default -## target audience +## Target audience - AWS Cloud Practitioners seeking hands-on AWS experience - AWS CloudFormation learners or starters @@ -40,7 +40,7 @@ A minimalistic CloudFormation template, following Amazons [Guide][guide] for **h - AWS SDK (cli) (optional) - AWS CloudShell (optional) -## provisioning and deployment +## Provision and deploy You need an aws account, could also be free tier. - login to aws @@ -54,7 +54,7 @@ You need an aws account, could also be free tier. - S3 bucket name - you can upload your website here - SiteUrl - feel free to test from a browser that is NOT logged in to aws -## programmatic deployment +## Programmatic deployment - install aws cli and git - login `aws login` @@ -67,12 +67,12 @@ You need an aws account, could also be free tier. `aws cloudformation deploy --template-body 'file://cloudformation/s3.cf.yml' --region=us-east-1 --stack-name RandomStackName` instead **deploy** you can use **create-stack** or **update-stack** to be more specific. -## website url +## Website url If your AppName is `cs-itpro``and you deploy on us-east-1 using account 313333333337 your URL would be http://cs-itpro-s3web-us-east-1-313333333337.s3-website-us-east-1.amazonaws.com/ -## cost calculation examples +## Cost calculation examples Since inbound traffic is usually free and you only use an S3 bucket (default tarrif), the estimated costs depend on the size of the website, the number of files involed, and frequency of the website be requested. @@ -140,14 +140,14 @@ AWS S3 storage starts cheap and scales with cost. - Eventually more Customers generating revenue -## limitations and outlook +## Limitations and outlook - add CloudFront for HTTPS transport encryption - no custom sub/domain without CloudFront # TODO - dynamic content requires compute services and/or databases - no content limitation to verified/registered users -## disclaimer and known risks +## Disclaimer and known risks This template comes "as it is" with out any warranty for completeness. You also must be aware, that a serverless pay-as-you-go service like s3 - especially when configured as public space - because of is elasticity - can generate high costs if your website is downloaded often. @@ -156,7 +156,7 @@ Use aws budget notifications, free tier without payment details, and other tools --- -## Autor +## Autors - [Matthias Block][matt]: Content - [Sam Dillenburg][sam]: Mentoring - Your favourite LLM: Confusion