Project Submission Requirements
The Course 2 capstone project is your comprehensive demonstration of Infrastructure as Code competency. You will submit a Git repository that implements the complete cricket analytics platform IaC pipeline, meeting all requirements below. The project is graded on correctness (does the infrastructure deploy and work?), security (do all Checkov HIGH checks pass?), quality (does all CI pass with green checks?), operations (is the playbook idempotent?), and completeness (are all required components present?).
Mandatory Requirements
- ✅ Terraform: VPC module, ALB with HTTPS, EC2 Auto Scaling Group, RDS PostgreSQL (lifecycle prevent_destroy=true), S3 data bucket (lifecycle prevent_destroy=true), KMS keys, security groups, IAM roles
- ✅ Checkov: All HIGH severity checks pass — zero unsuppressed HIGH findings; any suppressed findings have inline justification comments
- ✅ CI Pipeline: GitHub Actions with five-stage PR quality gate (fmt → validate → tflint → Checkov → plan with PR comment) and main-branch apply pipeline
- ✅ Ansible: Three roles (cricket_common, cricket_nginx, and either cricket_app_deploy or cricket_os_hardening) with Molecule tests; site playbook applying roles to correct host groups
- ✅ Idempotency: CI pipeline includes idempotency verification step; second playbook run produces changed=0
- ✅ Live URL: A URL that returns HTTP 200 from the ALB (the health endpoint '/health' returns JSON)
- ✅ State management: Remote S3 backend with DynamoDB locking, encryption enabled
- ✅ Documentation: README.md explaining the architecture, how to deploy, and how to run tests
Submission Checklist
Before submitting, verify each requirement independently. Run 'terraform plan' and verify zero errors. Run 'checkov -d . --framework terraform --severity HIGH' and verify zero failures. Open a PR to your own repository and verify all five CI stages show green checkmarks. Merge the PR and verify the apply pipeline succeeds. Run the Ansible playbook twice against the deployed instances and verify changed=0 on the second run. Curl the ALB DNS name's /health endpoint and verify a 200 response with valid JSON. Run 'terraform destroy' and verify that it fails with prevent_destroy errors for RDS and S3. Share the repository URL and live ALB URL with the grader. A complete, working submission earns full marks — partial submissions are graded proportionally based on the fraction of requirements met.
#!/bin/bash
# Pre-submission verification script
set -euo pipefail
echo '=== Pre-submission checklist ==='
echo '1. Terraform plan passes...'
cd environments/production
terraform plan -no-color 2>&1 | tail -5
echo '2. Checkov HIGH findings...'
pip install -q checkov
CHECKOV_OUTPUT=$(checkov -d ../.. --framework terraform --severity HIGH --quiet 2>&1)
HIGH_FAILURES=$(echo "$CHECKOV_OUTPUT" | grep 'Failed checks' | awk '{sum+=$3}END{print sum+0}')
echo "HIGH failures: ${HIGH_FAILURES}"
[[ $HIGH_FAILURES -eq 0 ]] && echo 'PASS' || echo 'FAIL — resolve all HIGH findings'
echo '3. GitHub Actions CI all green...'
gh run list --limit 5 --json conclusion,name 2>/dev/null | \
python3 -c "import sys,json; runs=json.load(sys.stdin); [print(f' {r[\"name\"]}: {r[\"conclusion\"]}') for r in runs]"
echo '4. Live URL check...'
ALB_DNS=$(terraform output -raw alb_dns_name 2>/dev/null || echo 'ALB_DNS_NOT_YET_AVAILABLE')
curl -sf "https://${ALB_DNS}/health" 2>/dev/null | python3 -m json.tool && echo 'PASS' || echo 'FAIL or ALB not ready'
echo '5. prevent_destroy verification...'
terraform plan -destroy 2>&1 | grep -E 'prevent_destroy|cannot be destroyed' | head -5
echo '6. Ansible idempotency...'
cd ../../ansible
ansible-playbook -i inventory/aws_ec2.yml site.yml 2>&1 | grep 'changed=' | \
awk '{for(i=1;i<=NF;i++) if($i~/changed=/) print $i}' | \
awk -F= '{sum+=$2}END{print "Total changed:",sum+0}'
echo
echo '=== All checks complete. Review results above before submitting. ==='Congratulations on completing Course 2 — Infrastructure as Code: Terraform and Ansible! You have covered the full IaC spectrum: HCL fundamentals and the Terraform workflow, module design and remote state management, security scanning and testing, Ansible inventory and playbook authoring, role-based configuration management, and the complete CI/CD pipeline that ties everything together. The skills from this course are directly applicable to production cloud engineering roles. Course 3 — Containers: Docker and Kubernetes — builds on this foundation, adding container orchestration to the IaC toolkit and completing the cloud-native engineering skill set.