Skip to content

femnad/terraform-gcp-lazyspot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-gcp-lazyspot

A Terraform module for lazy GCP spot instances.

Example Usage

Minimal

provider "google" {
    # Google provider configuration here.
}

module "instance" {
  source  = "femnad/lazyspot/gcp"
  version = "0.6.5"

  github_user = "femnad"
}

Requirements

Name Version
terraform >= 0.13
google >= 5.39.1
http >= 3.4.0
random >= 3.5.1

Providers

Name Version
google >= 5.39.1
http >= 3.4.0
random >= 3.5.1

Modules

No modules.

Resources

Name Type
google_compute_firewall.other resource
google_compute_firewall.self resource
google_compute_instance.this resource
google_compute_network.this resource
google_compute_subnetwork.this resource
google_dns_record_set.this resource
random_pet.this resource
google_compute_image.this data source
http_http.github data source
http_http.ipinfo data source

Inputs

Name Description Type Default Required
github_user A GitHub user to lookup allowed SSH keys string n/a yes
auto_create_subnetworks When creating a network, auto create subnetworks? bool false no
disk_size Root disk size in GiB number 10 no
disks List of disks to attach
list(object({
source = string,
name = string,
}))
[] no
dns DNS properties for the record to associate with the instance
object({
name = string
ttl = optional(number)
type = optional(string)
zone = string
})
null no
firewall Firewall specification, passing null will prevent adding default rules
object({
other = optional(map(map(list(string))), {})
self = optional(object({
allow = optional(map(list(string)), {
icmp = []
tcp = ["22"]
})
ip_mask = optional(number)
ip_num = optional(number)
}), {
allow = {
icmp = []
tcp = ["22"]
}
}
)
})
{} no
image Image specification
object({
project = string
family = string
})
{
"family": "ubuntu-2404-lts-amd64",
"project": "ubuntu-os-cloud"
}
no
machine_type Instance type string "e2-micro" no
max_run_seconds Maximum run duration in seconds number 86400 no
metadata A map of metadata values map(string) {} no
name Name of the instance string null no
network Network name string null no
service_account Optional service account to associate with the instance
object({
name = string
scopes = optional(list(string), ["cloud-platform"])
})
null no
ssh_user A user name to set for authorized SSH keys, defaults to github_user string "" no
subnets n/a
list(object({
cidr = string
name = optional(string)
tier = optional(string, "PREMIUM")
})
)
[
{
"cidr": "10.1.0.0/24"
}
]
no

Outputs

No outputs.