diff --git a/.gitignore b/.gitignore index fee5623c..3abe4652 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store .hugo_build.lock +.venv public/ resources/_gen diff --git a/README.md b/README.md index 1ba089de..f77aef11 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,21 @@ To work locally: `hugo server -D` To build: `hugo --minify` + +## Diagrams + +- [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/downloads/) are a prerequisite to install some packages +- [GraphViz](https://graphviz.org/download/) is required for diagrams + +```sh +python -m venv .venv +source ./.venv/Scripts/activate +pip install -r requirements.txt +``` + +Compilation: + +```sh +cd ./content/docs/devops/blueprints/ +python aws-static-webapp.py +``` diff --git a/content/docs/devops/blueprints/aws-static-webapp.md b/content/docs/devops/blueprints/aws-static-webapp.md new file mode 100644 index 00000000..deec068e --- /dev/null +++ b/content/docs/devops/blueprints/aws-static-webapp.md @@ -0,0 +1,17 @@ +# AWS static web application + +![AWS static web application](https://raw.githubusercontent.com/dpurge/dpurge.github.io/gh-pages/docs/devops/blueprints/aws-static-webapp.png) + +Components: + +- *AWS Shield Standard* - free protection against common DDoS attacks, + applied automatically to CloudFront and Route 53. +- *Route 53* - Domain Name System web service, performs domain registration, + DNS routing and health checking. +- *Hosted Zone* - container for records specifying how to route traffic for a + specific domain. +- *CloudFront* - content delivery network for distributing static content from + edge locations. +- *S3 bucket* - cloud storage for web content +- *Argo Workflows* - pipelines producing web content and publishing it to the + cloud storage \ No newline at end of file diff --git a/content/docs/devops/blueprints/aws-static-webapp.png b/content/docs/devops/blueprints/aws-static-webapp.png new file mode 100644 index 00000000..4d04f1e7 Binary files /dev/null and b/content/docs/devops/blueprints/aws-static-webapp.png differ diff --git a/content/docs/devops/blueprints/aws-static-webapp.py b/content/docs/devops/blueprints/aws-static-webapp.py new file mode 100644 index 00000000..2469cf11 --- /dev/null +++ b/content/docs/devops/blueprints/aws-static-webapp.py @@ -0,0 +1,32 @@ +from diagrams import Diagram, Cluster, Edge + +from diagrams.aws.general import Users +from diagrams.aws.network import Route53 +from diagrams.aws.network import Route53HostedZone +from diagrams.aws.security import Shield +from diagrams.aws.network import CloudFront +from diagrams.aws.storage import SimpleStorageServiceS3 + +from diagrams.onprem.gitops import ArgoCD + +with Diagram("AWS static WebApp", filename="aws-static-webapp", show=False, direction="LR"): + + users = Users("Users") + + with Cluster("AWS Cloud"): + shield = Shield() + dns = Route53("DNS") + hosted_zone = Route53HostedZone("Hosted Zone") + cdn = CloudFront("CDN") + storage = SimpleStorageServiceS3("Storage") + + with Cluster("On-prem"): + workflow = ArgoCD("Workflow") + + users >> Edge(forward=True, reverse=True) >> dns + dns >> Edge(forward=True, reverse=True) >> hosted_zone + + hosted_zone >> Edge(forward=True, reverse=True) >> cdn + cdn >> Edge(style="dashed", forward=True, reverse=True) >> storage + + storage << workflow \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..9fbb134f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +diagrams