compute-engine-instance
Eimert/compute-engine-instance/google
terraform google cloud VMs
terraform-google-compute-engine-instance Create virtual machines on Google Cloud. With DNS A record for easy access. Published in the Terraform registry. Usage example: Create VMs with public IP addresses and DNS A record alias. Machine type can be changed without destroying the boot disk. 1. Create a new directory for this terraform configuration 2. Create a main.tf, for example: ``ruby Configure the Google Cloud provider provider "google" { credentials = "${file("king-of-my-google-cloud-castle.json")}" project = "smashing-dash-1992" } google_dns_managed_zone resource is required. If not used, values can be left as-is. resource "google_dns_managed_zone" "managed_zone" { # descriptive name for dns zone name = "cloud-zone" # requires last dot. Ex.: prod.example.com. dns_name = "cloud.eimert
| Name | Type | Description | Default |
|---|---|---|---|
| dns_zone_name | any | The DNS zone that is pointing to Google' nameservers (if any). A.k.a. Google' DN | required |
| dns_managed_zone_name_indicator | any | Descriptive name for dns_zone_name. See README.md with example for creating reso | required |
| public_key_path | any | Only private-key auth is enabled by default. Use `ssh-keygen -t rsa` to generate | "~/.ssh/id_rsa.pub" |
| zone | any | GC zone | "europe-west4-c" |
| amount | any | Number of VMs | "1" |
| disk_destroy_local_exec_command_or_fail | any | ":" | |
| username | any | username of user account to be created | "google" |
| dns_record_name | any | DNS record type == A. For example: 'tower-dev' will become tower-dev.cloud.examp | "tower-dev" |
| name_prefix | any | hostname format: name_prefix-amount | "vm" |
| user_data | any | VM description. | "Managed by terraform plan https://githu |
| disk_create_local_exec_command_or_fail | any | ":" | |
| disk_create_local_exec_command_and_continue | any | ":" | |
| disk_destroy_local_exec_command_and_continue | any | ":" | |
| region | any | GC region | "europe-west4" |
| machine_type | any | List of VM sizes: https://github.com/Eimert/terraform-google-compute-engine-inst | "n1-standard-2" |
| disk_type | any | pd-standard or pd-ssd | "pd-standard" |
| disk_image | any | [Available OS images/templates](https://cloud.google.com/compute/docs/images) | "centos-cloud/centos-7" |
| disk_size | any | Primary disk' size in GB | "20" |
| automatic_restart | any | Allow google cloud to restart VM for patching (recommended). | "true" |
zones_available — Output gc zones having free space.addresses — VM IP addresses.