Files
nixos-zfs-ec2-ami/variables.tf
T
2026-06-30 21:43:28 -07:00

134 lines
3.7 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 "builder_repo_url" {
type = string
default = "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/nixos-zfs-ec2-ami.git"
description = "Repository URL containing the AMI builder and shared NixOS modules."
}
variable "flake_lock_rev" {
type = string
description = "Revision or hash representing flake.lock inputs."
}
variable "builder_instance_type" {
type = string
default = null
description = "Temporary EC2 instance type used to build and seed the AMI. Defaults to c7g.2xlarge for aarch64-linux and c7i.2xlarge for x86_64-linux."
}
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 "root_volume_iops" {
type = number
default = 6000
description = "Temporary builder root gp3 IOPS. This affects builder speed only; snapshots do not preserve provisioned IOPS."
}
variable "root_volume_throughput" {
type = number
default = 250
description = "Temporary builder root gp3 throughput in MiB/s. This affects builder speed only; snapshots do not preserve provisioned throughput."
}
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_volume_iops" {
type = number
default = 12000
description = "Temporary /nix gp3 IOPS used while building and seeding the AMI."
}
variable "nix_volume_throughput" {
type = number
default = 500
description = "Temporary /nix gp3 throughput in MiB/s used while building and seeding the AMI."
}
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."
}