How aws-containers/ecsworkshop works
Main Components
• Content Source: The “content” directory holds all the Markdown files that represent the workshop’s lessons and documentation (e.g., advanced scheduling, blue/green deployments, microservices, networking). This is the primary data source for the website.
• Static Site Generator: Hugo is the core engine (configured via “config.toml” and deployed using “npm run server”) that processes Markdown content using layouts and templates (found in “layouts” and “themes”) into a static website.
• Frontend Assets: The “static” directory comprises CSS, JavaScript, and images used by the site. These assets are part of the final rendered pages.
• Build & Deployment Pipeline:
• Build Scripts: Files like “buildspec.yml” and “codebuild-deploy.sh” define the build and deploy process.
• CI/CD Pipeline: Auto-deployment is configured to trigger on commits to the main branch. The build server (AWS CodeBuild) picks up changes using the provided buildspec commands.
• Infrastructure as Code: The “terraform” folder holds .tf files that configure and provision AWS resources (such as CloudFront, S3, Route53, IAM roles, and even CodeBuild settings) necessary for hosting and serving the static site.
• Version Control: The git repository (with .gitignore, .gitmodules) manages the source code – including the site content, Hugo configuration, themes, node dependencies (package.json/package-lock.json), and infrastructure code.
Relationships and Data Flow
• Local Development: Developers clone the repository, initialize Hugo (and the submodule for themes), and install node packages. This is the starting point for making changes.
• Static Site Generation: Hugo processes content (Markdown files) using layouts and themes to produce HTML/CSS/JS files. The transformation process is an essential pipeline component.
• Continuous Integration and Delivery: Commits to the main branch trigger the CI/CD pipeline (as defined in buildspec.yml and executed via CodeBuild). This pipeline builds the static site, possibly runs tests (via “npm run test”), and then deploys the generated site.
• Deployment on AWS: Terraform scripts provision and configure AWS resources such as S3 (for hosting static assets), CloudFront (for content delivery and caching), and Route53 (for DNS). This ensures robust hosting and global distribution.
Architectural Patterns and Technologies
• Static Site Architecture: Emphasize the separation between content (Markdown) and presentation (layouts/themes). The build process translates sources into a production-ready website.
• CI/CD Pipeline: Clearly show the automated build and deployment triggered on code repos, highlighting AWS CodeBuild integration.
• Infrastructure as Code: Use Terraform to manage the resource provisioning on AWS. This includes the use of modules or multiple .tf files to separate concerns (e.g., networking, IAM, CloudFront configurations).
• Tools and Technologies: Include Hugo, NodeJS (npm scripts), AWS services (S3, CloudFront, Route53, CodeBuild), Terraform, and Git for version control and collaboration.