https://github.com/trydock/gcp-basic-vm
Basic Standalone VM instance in GCP
https://github.com/trydock/gcp-basic-vm
Last synced: 5 months ago
JSON representation
Basic Standalone VM instance in GCP
- Host: GitHub
- URL: https://github.com/trydock/gcp-basic-vm
- Owner: trydock
- License: gpl-3.0
- Created: 2021-06-05T23:30:43.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-06T00:46:43.000Z (about 5 years ago)
- Last Synced: 2025-06-19T04:08:17.170Z (about 1 year ago)
- Language: HCL
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gcp-basic-vm
Basic Standalone VM instance in GCP
## Prerequisite
- Create a GCP service account.
- Add permissions to create VM instance and Instance Templates.
- Add a key to service account.
- Download the json key file from the GCP service account.
## Usage:
Clone to your workstation.
Copy the sample config file.
```
cp -ar terraform.tfvars.sample terraform.tfvars
```
Update the config parameters in `terraform.tfvars` file.
- Update `gcp_cred_file` with the path to the key you download from GCP service account.
- Update `gcp_project` with the correct name of the GCP project you created.
- Update `gcp_region` with the preffered region where you want the resource to be created.
- Update `service_account` with the correct email of the service account.
Lets validate if the terraform files are valid, using.
```
terraform validate
```
Then issue plan, review the output.
```
terraform plan
```
Finally apply the terraform changes.
```
terraform apply
```
done.