How rizwanislam62/static_website_with_terraform works
Main Components
• Terraform Configuration: This includes files like main.tf and .terraform.lock.hcl, which define the infrastructure (e.g., creation of an S3 bucket and setting its bucket policy) and manage Terraform dependencies, respectively.
• Static Website Files: index.html and style.css, which make up the content served as the website.
• AWS S3 Bucket: Not directly visible in the file tree but implied by the Terraform setup. This is where the static website content will reside.
• Terraform State Files: terraform.tfstate and terraform.tfstate.backup which keep track of the deployed infrastructure status.
Relationships and Interactions
• Terraform runs (using the configuration files) to create and manage the AWS S3 bucket. The main.tf script will set up the bucket and apply its policy.
• The static website files (HTML and CSS) are uploaded to the S3 bucket, forming the website content.
• The Terraform state files capture the current state of the infrastructure, allowing for future updates and management while ensuring consistency.
Architectural Patterns and Design Principles
• Infrastructure-as-Code (IaC): Fully automated management of the AWS resources through Terraform scripts.
• Separation of Concerns: Distinct roles for infrastructure configuration (Terraform) and website content (static files).
• Declarative Resource Management: Terraform’s configuration follows a declarative approach ensuring the defined state is achieved on AWS.
Relevant Technologies
• Terraform – for defining and provisioning the infrastructure.
• AWS S3 – serving as the static website hosting service.
• Standard web assets – HTML and CSS files forming the website’s frontend.