A Terraform module for creating a fully functional Google GCE instance.
Required:
project
- The ID of the project in which the resource belongs toname
- The name of the instance
Defaults:
machine_type
- The type of instance you want to use, defaults ton1-standard-1
zone
- The zone you want to launch your instance in, defaults tonorthamerica-northeast1-a
image
- The image you want to use for your instance, defaults toubuntu-1604-lts
allow_stopping_for_update
- Allows Terraform to stop the instance to update its properties, defaults tofalse
can_ip_forward
- Allow sending and receiving of packets with non-matching source or destination IPs, defaults tofalse
create_timeout
- Timeout in minutes for creating instances, defaults to 0description
- Instance description, defaults to nothingdeletion_protection
- Enable deletion protection on this instance, defaults to falsescopes
- A list of service scopes to use, defaults tocloud-platform
protocol
- The name of the protocols to allow, defaults totcp
ports
- List of ports and/or port ranges to allow, defaults to80, 443, 22
size
- Size of the instance in GB, defaults to10
instance_id
- The gce instance id
Take a look at gce.tf for a working example.
You can overwrite more default variables if you need to.
Initialize Terraform:
terraform init
Review your changes:
terraform plan
Apply your changes:
terraform apply
Output Instance information:
terraform show
When contributing to this repository, please first discuss the change you wish to make via a Github issue.