https://github.com/rafaumeu/primeiro-projeto-iac
A modern infrastructure as code project using Terraform 🌍 to manage AWS S3 buckets ☁️. It supports multi-environment configurations 🛠️, automated S3 bucket creation 📦, and Terraform state management 🔧 for seamless infrastructure management on AWS.
https://github.com/rafaumeu/primeiro-projeto-iac
automation aws aws-management cloud-infrastructure devops infra-terraform infrastructure infrastructure-as-code s3-bucket tech-stack terraform
Last synced: about 1 month ago
JSON representation
A modern infrastructure as code project using Terraform 🌍 to manage AWS S3 buckets ☁️. It supports multi-environment configurations 🛠️, automated S3 bucket creation 📦, and Terraform state management 🔧 for seamless infrastructure management on AWS.
- Host: GitHub
- URL: https://github.com/rafaumeu/primeiro-projeto-iac
- Owner: rafaumeu
- Created: 2025-02-04T23:52:16.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T10:05:33.000Z (4 months ago)
- Last Synced: 2025-02-17T23:59:42.556Z (4 months ago)
- Topics: automation, aws, aws-management, cloud-infrastructure, devops, infra-terraform, infrastructure, infrastructure-as-code, s3-bucket, tech-stack, terraform
- Language: HCL
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚀 Terraform AWS Infrastructure
A modern infrastructure as code project for AWS S3 and CloudFront integration using Terraform.
[](https://www.terraform.io/)
[](https://aws.amazon.com/)
[](LICENSE)---
## 📖 Table of Contents
| [Tech Stack](#-tech-stack) | [Features](#-features) | [Prerequisites](#-prerequisites) |
|---------------------------|------------------------|----------------------------------|
| [Setup](#️-setup) | [Project Structure](#️-project-structure) | [Environment Variables](#-environment-variables) |---
### ⚡ Tech Stack

---
## 🚀 Features
- **Multi-Environment Support**:
- Dynamic S3 bucket naming based on workspace
- Environment-specific configurations
- Context tagging for resource identification- **AWS S3 Configuration**:
- Automated bucket creation
- Static website hosting
- Custom error/index documents
- Resource tagging
- Environment-based isolation- **CloudFront Integration**:
- CDN distribution setup
- HTTPS redirection
- Custom origin configuration
- Global content delivery
- Price class management- **Infrastructure Management**:
- Terraform state management
- AWS provider configuration
- Data source integration
- Module-based architecture## 📦 Prerequisites
- Terraform 1.0+
- AWS CLI configured
- AWS account with appropriate permissions
- Basic understanding of S3 and CloudFront concepts## 🛠️ Setup
1. Clone the repository:
```bash
git clone https://github.com/yourusername/terraform-aws-infra.git
cd terraform-aws-infra
```2. Initialize Terraform:
```bash
terraform init
```3. Select workspace (environment):
```bash
terraform workspace select dev # or prod
```4. Plan the infrastructure:
```bash
terraform plan
```5. Apply the configuration:
```bash
terraform apply
```## 📝 Contributing
### Commit Convention
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. Every commit message must follow this pattern:
```bash
():[optional body]
[optional footer(s)]
```#### Types
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `style`: Changes that do not affect the meaning of the code
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests
- `chore`: Changes to the build process or auxiliary tools#### Scopes
- `infra`: Changes to infrastructure configuration
- `s3`: Changes related to S3 module
- `cdn`: Changes related to CloudFront module
- `docs`: Changes to documentation
- `ci`: Changes to CI/CD pipeline#### Examples
```bash
# Feature example
feat(s3): add website hosting configuration- Add index.html configuration
- Configure error document
- Enable static website hosting
``````bash
# Fix example
fix(cdn): correct origin protocol policy- Update protocol policy to http-only
- Fix SSL protocols configuration
``````bash
# Documentation example
docs(readme): update project documentation- Add commit convention section
- Update prerequisites
- Include contribution guidelines
```### Pull Request Process
1. Update the README.md with details of changes if needed
2. Update the version numbers in files following [SemVer](http://semver.org/)
3. Create your PR with a clear title and description
4. Wait for review and approval from maintainers## 🏗️ Project Structure
```
terraform-aws-infra/
├── main.tf # Main configuration file
├── providers.tf # AWS provider configuration
├── output.tf # Output definitions
├── modules/
│ ├── s3/ # S3 bucket module
│ │ ├── main.tf # S3 bucket configuration
│ │ ├── variables.tf # Module variables
│ │ ├── outputs.tf # Module outputs
│ │ └── datasources.tf # S3 data sources
│ └── cloudfront/ # CloudFront module
│ ├── main.tf # CloudFront configuration
│ ├── variables.tf # Module variables
│ ├── outputs.tf # Module outputs
│ └── datasources.tf # CloudFront data sources
└── .gitignore # Git ignore rules
```## 🔧 Environment Variables
```env
# AWS Configuration
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
AWS_REGION="your-region"
```## 📤 Outputs
After applying the infrastructure, you'll get:
- S3 bucket domain name
- CloudFront distribution domain name
- CloudFront distribution ID---
Made with ❤️ by Rafael Dias Zendron![]()
[](https://www.linkedin.com/in/rafael-dias-zendron-528290132/)
[](https://github.com/rafaumeu)