https://github.com/qoyyuum/free-gcp
Easily create a free GCP VM Server as and when needed with Terraform
https://github.com/qoyyuum/free-gcp
free gcp google-cloud-platform server terraform
Last synced: about 1 year ago
JSON representation
Easily create a free GCP VM Server as and when needed with Terraform
- Host: GitHub
- URL: https://github.com/qoyyuum/free-gcp
- Owner: Qoyyuum
- Created: 2020-11-13T09:30:09.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T17:38:41.000Z (over 4 years ago)
- Last Synced: 2025-02-10T04:29:45.703Z (over 1 year ago)
- Topics: free, gcp, google-cloud-platform, server, terraform
- Language: HCL
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :earth_asia: Terraform a (Free) Micro Google VPS
## Pre-requisites
* Must have an active account on [Google Cloud Platform](https://console.cloud.google.com/) (Sign up or Sign in)
* Enable [Compute Engine](https://console.cloud.google.com/compute) after creating a project.
* Get Service Account Key - Navigate to the [Service Accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts). Click "Create Service Account". Fill in the blanks, click "Create". Set Role as "Project > Editor", click "Done". Click the newly created account's Actions (far right) menu icon and select "Create Key". Set Key Type as "JSON" and click "Create". Once prompted for the JSON file to save, save it in this cloned repo on your machine.
* Install [Terraform v0.13.5 or later](https://www.terraform.io/downloads.html) - it's also available via [Chocolatey](https://chocolatey.org/packages/terraform)
## Setup
The `main.tf` file has a couple of places that needs an update before proceeding to *Usage* section.
Replace the following:
* **{PROJECTID}** - Obtainable after creating a project.
* **{CREDENTIALS}** - Obtainable after creating the service account
## Usage
### Test
Check if the file will load properly with `terraform plan`
### Deployment
`terraform apply`, then type `yes` when asked to approve the deployment.
### Destroy
When done for the day or no longer need a VM running, `terraform destroy`, then `yes` when prompted
## Further Reference
[Getting Started](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started) with Google Provider
More about Terraform [Google Compute Instance](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance)
## Fair Warning
You may be charged for exceeding beyond Google's Free Tier. Please read and understand further at their official docs as time passes by. https://cloud.google.com/free/