This repository provides a standardized template for Infrastructure as Code (IaC) implementations using both AWS CloudFormation and Terraform. It includes comprehensive CI/CD workflows, security checks, and code quality enforcement to ensure reliable and secure infrastructure deployments.
The repository implements industry best practices for infrastructure management including automated linting, security scanning with Checkov, and pre-commit hooks for code quality. It supports both AWS CloudFormation and Terraform deployments with proper version control integration and automated workflow checks through GitHub Actions.
- The
main
branch is intended as part of walkthrough in the workshop. - The
solution
branch contains the full solution for the workshop.
.
├── cloudformation/ # CloudFormation templates and related resources
│ └── template.yaml # Main CloudFormation template file
├── terraform/ # Terraform configuration files
│ ├── main.tf # Main Terraform configuration
│ ├── providers.tf # AWS provider configurations
│ └── version.tf # Terraform version and backend configuration
├── .github/
│ └── workflows/ # GitHub Actions workflow definitions
│ ├── on-push.yaml # Workflow for push events
│ └── on-pull-request.yaml # Workflow for pull requests
└── .config/
├── checkov/ # Config for checkov
├── cfn-guard/ # Config for cfn-guard
└── tf-lint/ # Config for tf-lint
- AWS CLI installed and configured
- Git installed
- GitHub repository created from this template
-
Fork this repository into your own GitHub.
-
Clone the repository:
git clone https://github.com/your-org/your-repo.git
cd your-repo
- Set up the development environment:
make install
- Configure AWS credentials:
aws configure
The infrastructure deployment process follows a structured workflow from local development through CI/CD pipelines to production deployment.
[Local Development] -> [Pre-commit Hooks] -> [GitHub Actions] -> [AWS Infrastructure]
| | | |
v v v v
Code Changes --> Code Quality --> Validation --> Deployment
Checks & Linting Security Scanning
Key Component Interactions:
- Local development triggers pre-commit hooks for initial validation
- Git push triggers GitHub Actions workflows
- Workflows perform format checking and linting
- Security scanning with Checkov validates infrastructure
- Pull request checks ensure code quality
- Successful checks allow deployment to AWS
- Infrastructure changes are tracked in version control