{"id":28386670,"url":"https://github.com/gmccormick8/simple-gcp-mario","last_synced_at":"2026-01-27T07:03:23.035Z","repository":{"id":292213678,"uuid":"978385088","full_name":"gmccormick8/simple-gcp-mario","owner":"gmccormick8","description":"Terraform Project To Deploy A Simple Mario Game to GCP With A Compute Engine MIG Backend","archived":false,"fork":false,"pushed_at":"2025-06-13T16:07:56.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T17:29:08.783Z","etag":null,"topics":["bash","gce","gcp","google-cloud-platform","google-compute-engine","iac","infastructure-as-code","load-balancer","mario","mario-game","terraform","vpc-creation","web","webapp"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmccormick8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-05T22:51:45.000Z","updated_at":"2025-06-13T16:08:00.000Z","dependencies_parsed_at":"2025-05-08T18:34:19.380Z","dependency_job_id":"c2ab6c19-9586-46de-ae43-decde80cdb17","html_url":"https://github.com/gmccormick8/simple-gcp-mario","commit_stats":null,"previous_names":["gmccormick8/simple-gcp-mario"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gmccormick8/simple-gcp-mario","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmccormick8%2Fsimple-gcp-mario","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmccormick8%2Fsimple-gcp-mario/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmccormick8%2Fsimple-gcp-mario/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmccormick8%2Fsimple-gcp-mario/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmccormick8","download_url":"https://codeload.github.com/gmccormick8/simple-gcp-mario/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmccormick8%2Fsimple-gcp-mario/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262094387,"owners_count":23257950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","gce","gcp","google-cloud-platform","google-compute-engine","iac","infastructure-as-code","load-balancer","mario","mario-game","terraform","vpc-creation","web","webapp"],"created_at":"2025-05-30T15:30:30.744Z","updated_at":"2026-01-27T07:03:18.016Z","avatar_url":"https://github.com/gmccormick8.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Mario Game With Compute Engine MIG Backend Project\n\n[![Run Super Linter](https://github.com/gmccormick8/simple-gcp-mario/actions/workflows/super-linter.yml/badge.svg?branch=main)](https://github.com/gmccormick8/simple-gcp-mario/actions/workflows/super-linter.yml)\n\nThis project deploys a scalable web application using Infrastructure as Code (IaC) on Google Cloud Platform using Terraform.\nIt creates a VPC network, Managed Instance Group (MIG) running a lightwieght Mario game web app, and a global HTTP load balancer.\nThis project is designed to run from the Google Cloud Shell using a user-friendly startup script. Simply clone this repository, run the script (following the prompts), and let Terraform do the rest!\n\n## Architecture\n\n- **VPC Network** with custom subnet and firewall rules\n  - VPC Flow Logging enabled with 5-second intervals\n  - Full metadata collection for network analysis\n- **Managed Instance Group** with autoscaling (1-5 instances)\n- **Global HTTP Load Balancer** for traffic distribution\n- **Cloud NAT** for internet egress from private instances\n- **IAP-protected SSH access** to instances\n- **Service Account** with minimal required permissions\n- **Shielded VMs** with secure boot and integrity monitoring\n\n## Credits\n\nThis project uses the [Mario Game](https://github.com/anndcodes/mario-game) repository created by [anndcodes](https://github.com/anndcodes). The game is deployed on each instance as a demo web application.\n\n## Prerequisites\n\n1. Google Cloud Platform account\n2. [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) installed - Preinstalled in Google Cloud Shell\n3. [Terraform](https://www.terraform.io/downloads.html) ~\u003e 1.11 installed - Terraform is preinstalled in Google Cloud Shell.\n4. Active GCP project with billing enabled\n5. It is recommended to run this project from the [Google Cloud Shell](https://cloud.google.com/shell/docs/using-cloud-shell)\n\nThe tilde (~\u003e) operator allows only the rightmost version component to increment. For example, `~\u003e 1.11` allows installing versions 1.11.0 up to but not including 1.12.0.\n\n## Required GCP APIs\n\nThis project requires the following Google Cloud APIs to be enabled:\n\n- Compute Engine API (`compute.googleapis.com`)\n- Identity and Access Management (IAM) API (`iam.googleapis.com`)\n- Cloud Resource Manager API (`cloudresourcemanager.googleapis.com`)\n- Service Usage API (`serviceusage.googleapis.com`)\n\nThese APIs will be automatically enabled when you run the `setup.sh` script.\n\n## Quick Start\n\n1. Open Google Cloud Shell or your local terminal\n\n2. Clone this repository:\n\n   ```bash\n   git clone https://github.com/gmccormick8/simple-gcp-mario.git \u0026\u0026 cd simple-gcp-mario\n   ```\n\n3. Run setup script to initialize the project (enter \"y\" when prompted):\n\n   ```bash\n   bash setup.sh\n   ```\n\nThe setup script will:\n\n- Verify and update Terraform if needed\n- Enable required Google Cloud APIs\n- Initialize Terraform\n- Create and apply the Terraform configuration\n\u003c!-- textlint-disable --\u003e\n- Display a link to the newly created website at the end of the output. Please note that it may take several minutes for the website to go live.\n\u003c!-- textlint-enable --\u003e\n\n## Manual Deployment\n\nIf you prefer to deploy manually:\n\n1. Set your Google Cloud project ID:\n\n```bash\necho 'project_id = \"YOUR_PROJECT_ID\"' \u003e terraform.tfvars\n```\n\n2. Initialize Terraform:\n\n```bash\nterraform init\n```\n\n3. Review the deployment plan:\n\n```bash\nterraform plan\n```\n\n4. Apply the configuration (enter \"yes\" when prompted):\n\n```bash\nterraform apply\n```\n\n## Cleanup\n\nTo destroy all resources (enter \"yes\" when prompted):\n\n```bash\nterraform destroy\n```\n\n## Customization\n\n- The machine type, min/max replicas can be modified in `main.tf`\n\n## Module Structure\n\n### Network Module (`./modules/network`)\n\n- Creates VPC network and subnets\n- Configures firewall rules\n- Sets up Cloud NAT and Cloud Router\n- Enables VPC Flow Logging with:\n  - 5-second aggregation intervals\n  - 50% sampling rate\n  - Full metadata collection\n\n### Compute Module (`./modules/compute`)\n\n- Deploys managed instance group\n- Configures instance template with Mario game\n- Implements autoscaling\n- Enables OS Login\n\n### Load Balancer Module (`./modules/load-balancer`)\n\n- Creates global HTTP load balancer\n- Sets up health checks\n- Configures backend services\n\n## Security Features\n\n- Private instances with no public IPs\n- IAP-protected SSH access\n- Minimal service account permissions\n- OS Login enabled by default\n- Shielded VM features:\n  - Secure Boot enabled\n  - vTPM enabled\n  - Integrity monitoring enabled\n- VPC Flow Logging for network security monitoring\n\n## Security Notes\n\nThis implementation:\n\n- Uses HTTP (not HTTPS)\n- Is intended for development/testing purposes\n- Is not suitable for production use\n\n## Cost Considerations\n\nThis setup uses:\n\n- e2-micro instances (1-5 instances)\n  - ~$6.11/month per instance\n- Standard persistent disks\n  - ~$0.04/GB/month\n- Global load balancer\n  - ~$18/month for the forwarding rule\n  - ~$0.008/GB processed\n- Cloud NAT\n  - ~$0.045/hour when in use\n- Network egress\n  - $0.085/GB to $0.23/GB depending on region\n\nTotal estimated monthly cost: $30-100 USD depending on:\n\n- Number of active instances\n- Amount of traffic processed\n- Data transfer volumes\n- Region selection\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmccormick8%2Fsimple-gcp-mario","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmccormick8%2Fsimple-gcp-mario","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmccormick8%2Fsimple-gcp-mario/lists"}