Files
nixos-zfs-ec2-ami/variables.tf
T
2026-06-20 11:41:57 -07:00

104 lines
2.6 KiB
Terraform

variable "aws_region" {
type = string
default = "us-west-2"
description = "AWS region."
}
variable "name" {
type = string
default = "nixos-zfs-ec2"
description = "Name prefix for builder resources and the published AMI."
}
variable "system" {
type = string
default = "aarch64-linux"
description = "Target NixOS system for the AMI."
validation {
condition = contains(["aarch64-linux", "x86_64-linux"], var.system)
error_message = "system must be aarch64-linux or x86_64-linux."
}
}
variable "input_hash" {
type = string
description = "Stable hash of the AMI builder inputs."
}
variable "builder_git_rev" {
type = string
description = "Git revision of this AMI builder."
}
variable "flake_lock_rev" {
type = string
description = "Revision or hash representing flake.lock inputs."
}
variable "builder_instance_type" {
type = string
default = "t4g.large"
description = "Temporary EC2 instance type used to build and seed the AMI."
}
variable "vpc_id" {
type = string
default = null
description = "VPC ID. Defaults to the account default VPC."
}
variable "subnet_id" {
type = string
default = null
description = "Subnet ID. Defaults to the first subnet in the selected/default VPC."
}
variable "base_nixos_ami_id" {
type = string
default = null
description = "Base NixOS AMI used only for the temporary builder. If null, OpenTofu searches for a recent NixOS AMI."
}
variable "base_nixos_ami_owners" {
type = list(string)
default = ["427812963091"]
description = "AWS account IDs to search for base NixOS AMIs."
}
variable "base_nixos_ami_name_pattern" {
type = string
default = null
description = "Base NixOS AMI name filter."
}
variable "root_volume_size_gb" {
type = number
default = 30
description = "Temporary builder root EBS volume size. This becomes the final AMI root snapshot size."
}
variable "nix_volume_size_gb" {
type = number
default = 50
description = "Temporary /nix EBS volume size. This becomes the final AMI /nix snapshot size."
}
variable "nix_pool" {
type = string
default = "nixos-zfs-nix"
description = "ZFS pool name for the AMI-provided /nix volume."
}
variable "nix_device_name" {
type = string
default = "/dev/sdf"
description = "EC2 block device name for the AMI /nix volume. NixOS imports by ZFS pool identity, not this device name."
}
variable "ssh_public_key" {
type = string
default = null
description = "Optional SSH public key for debugging the temporary builder."
}