Thank you for your interest in contributing to this learning project! This document provides guidelines to help you contribute effectively.
- Code of Conduct
- Getting Started
- Development Workflow
- Code Style and Standards
- Commit Message Guidelines
- Testing Requirements
- Documentation Standards
- Pull Request Process
- Issue Reporting
This project is a learning resource. Please be respectful, constructive, and helpful in all interactions.
Before contributing, ensure you have:
- AWS Account with appropriate IAM permissions
- Terraform 1.0+ installed
- Pre-commit framework installed
- TFLint, Trivy, terraform-docs, detect-secrets installed
- Node.js and pnpm for application development
- kubectl and helm (for EKS contributions)
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/terraform-course-dummy-nestjs-app.git cd terraform-course-dummy-nestjs-app -
Install pre-commit hooks:
pre-commit install # To allow running hooks that exec before each commit pre-commit install --hook-type pre-push # To allow running hooks that exec before pushing code
-
Install dependencies (for NestJS app):
pnpm install
-
Verify your setup:
# Test pre-commit hooks pre-commit run --all-files # Test Terraform formatting terraform fmt -recursive infra-ecs/ terraform fmt -recursive infra-eks/
-
Create a feature branch from
main:git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Make your changes following the code style guidelines
-
Test your changes thoroughly (see Testing Requirements)
-
Format and validate before committing:
# Format Terraform files terraform fmt -recursive infra-ecs/ terraform fmt -recursive infra-eks/ # Run pre-commit hooks manually pre-commit run --all-files
-
Commit your changes using conventional commit format
-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
- Format all files: Run
terraform fmt -recursivebefore committing - Use consistent naming: Follow existing patterns (
project_name-environment-resource) - Add comments: Explain complex logic or non-obvious design decisions
- Validate syntax: Ensure
terraform validatepasses in all modules - Use variables: Avoid hardcoded values; use variables with clear descriptions
- Output important values: Add outputs for values that other modules may need
- Tag all resources: Include standard tags (Project, Environment, etc.)
- Follow existing patterns: Match the style of existing code
- Use TypeScript strict mode: No
anytypes without justification - Format with Prettier: Run
pnpm formatbefore committing - Lint with ESLint: Run
pnpm lintand fix all warnings - Add JSDoc comments: Document public methods and complex logic
- Use GitHub-flavored Markdown
- Keep lines under 120 characters for readability
- Use proper heading hierarchy (don't skip levels)
- Include code examples with proper syntax highlighting
- Add links to related documentation sections
- Keep table of contents updated when adding/removing sections
This project follows Conventional Commits specification.
<type>(<scope>): <subject>
<body>
<footer>
- feat: New feature
- fix: Bug fix
- docs: Documentation only changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code change that neither fixes a bug nor adds a feature
- perf: Performance improvement
- test: Adding or updating tests
- chore: Changes to build process, dependencies, or auxiliary tools
ecs: ECS-related changeseks: EKS-related changesapp: NestJS application changesdocs: Documentation changesci: CI/CD workflow changesinfra: General infrastructure changes
feat(ecs): add support for Fargate capacity provider
fix(eks): correct node group IAM policy attachments
docs(readme): update quick start guide with domain setup
chore(deps): upgrade Terraform AWS provider to v5.0- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- First line should be 50 characters or less
- Body should wrap at 72 characters
- Reference issues and PRs in footer (e.g., "Fixes #123")
-
Run pre-commit hooks:
pre-commit run --all-files
-
Run Terraform module tests:
# For ECS modules cd infra-ecs/ ./run-tests.sh # For EKS modules cd infra-eks/ ./run-tests.sh
Note: These tests also run automatically via pre-push hooks when you push changes to Terraform files.
-
Terraform validation (if not using test script):
# Validate all modules cd infra-ecs/modules/<module-name> terraform init terraform validate # Run terraform test if tests exist terraform test
-
NestJS tests (if applicable):
# Unit tests pnpm test # E2E tests pnpm test:e2e # Test coverage pnpm test:cov
-
Security scanning:
# Trivy should run via pre-commit, but you can run manually: trivy infra-ecs/ trivy infra-eks/ -
Documentation generation:
# terraform-docs should run via pre-commit, but verify: terraform-docs markdown table --output-file README.md infra-ecs/modules/<module-name>
If your changes affect infrastructure:
- Test in a clean environment
- Verify
terraform planoutput is as expected - Test
terraform applyin a non-production environment - Verify resources are created correctly in AWS Console
- Test
terraform destroyto ensure clean teardown - Document any manual steps required (e.g., DNS propagation)
Update documentation when you:
- Add new infrastructure modules or resources
- Change existing module inputs/outputs
- Modify deployment procedures
- Add new features to the NestJS application
- Change CI/CD workflows
- Add new prerequisites or dependencies
Depending on your changes, update:
README.md(root): High-level project overviewinfra-ecs/README.md: ECS-specific documentationinfra-eks/README.md: EKS-specific documentation- Module
README.md: Auto-generated via terraform-docs (update inputs/outputs) CLAUDE.md: Project instructions for AI assistance (if adding new patterns)
- Updated relevant README files
- Added/updated code comments for complex logic
- Regenerated terraform-docs for modified modules
- Updated table of contents if section structure changed
- Verified all links work correctly
- Added examples for new features
- Updated architecture diagrams if structure changed
- Ensure all tests pass (see Testing Requirements)
- Update documentation as needed
- Rebase on latest main:
git fetch upstream git rebase upstream/main
- Squash commits if you have multiple small commits (optional but recommended)
Use the same format as commit messages:
feat(ecs): add support for Fargate capacity provider
## Description
Brief description of what this PR does.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Infrastructure change
- [ ] CI/CD update
## Motivation and Context
Why is this change required? What problem does it solve?
Fixes # (issue)
## How Has This Been Tested?
Describe the tests you ran to verify your changes.
## Screenshots (if applicable)
Add screenshots to help explain your changes.
## Checklist
- [ ] My code follows the code style of this project
- [ ] I have run pre-commit hooks and all checks pass
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes (if applicable)
- [ ] All new and existing tests pass
- [ ] My changes generate no new warnings
- [ ] I have checked my code and corrected any misspellings- Maintainers will review your PR within a few days
- Address any feedback or requested changes
- Once approved, a maintainer will merge your PR
- Your branch will be deleted after merge
-
Delete your feature branch:
git branch -d feature/your-feature-name git push origin --delete feature/your-feature-name
-
Update your local main:
git checkout main git pull upstream main
- Search existing issues to avoid duplicates
- Check the documentation to ensure it's not already covered
- Verify the issue in a clean environment
For Bug Reports:
## Bug Description
A clear description of what the bug is.
## Steps to Reproduce
1. Go to '...'
2. Run command '...'
3. See error
## Expected Behavior
What you expected to happen.
## Actual Behavior
What actually happened.
## Environment
- OS: [e.g., macOS 14.0]
- Terraform version: [e.g., 1.7.0]
- AWS region: [e.g., us-east-1]
- Approach: [ECS or EKS]
## Logs/Error MessagesPaste relevant logs or error messages here
## Additional Context
Any other context about the problem.
For Feature Requests:
## Feature Description
Clear description of the feature you'd like.
## Use Case
Why is this feature needed? What problem does it solve?
## Proposed Solution
How you envision this feature working.
## Alternatives Considered
Other solutions you've considered.
## Additional Context
Any other context or screenshots.If you have questions about contributing:
- Check existing documentation: README.md, infra-ecs/README.md, infra-eks/README.md
- Search closed issues: Someone may have asked the same question
- Open a new issue: Use the "Question" label
Thank you for contributing to this learning project! Your improvements help others learn AWS, Terraform, and cloud infrastructure patterns.