sam 33f9f4daf7 terraform: fmt normalization + deprecated resource rename + commit lockfile
Ran `terraform init && terraform validate && terraform fmt` after
installing terraform 1.9.8 locally (which the initial commit couldn't
do since terraform wasn't on the authoring host).

Changes:
  - fmt: alignment normalization on image.tf, store_vm.tf, bmpgen_vm.tf,
    outputs.tf.
  - proxmox_virtual_environment_download_file -> proxmox_download_file
    (deprecated in bpg/proxmox v0.111.1, removed in v1.0).
  - .terraform.lock.hcl: unignored + committed. Pins bpg/proxmox to
    v0.111.1 and hashicorp/random to v3.9.0 so contributors get the same
    provider set on `terraform init`.

`terraform validate` is now Success, no warnings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-20 18:33:39 -07:00

51 lines
1.7 KiB
HCL

# Outputs feed the run-test.sh wrapper (jq consumes `terraform output -json`)
# and give the operator sane next-step hints after `apply`.
output "store_vm_ip" {
description = "IPv4 the store VM will be reachable on."
value = var.store_vm_ip_cidr != "" ? split("/", var.store_vm_ip_cidr)[0] : (
length(proxmox_virtual_environment_vm.store.ipv4_addresses) > 1 ?
proxmox_virtual_environment_vm.store.ipv4_addresses[1][0] : ""
)
}
output "bmpgen_vm_ip" {
description = "IPv4 the bmpgen VM will be reachable on."
value = var.bmpgen_vm_ip_cidr != "" ? split("/", var.bmpgen_vm_ip_cidr)[0] : (
length(proxmox_virtual_environment_vm.bmpgen.ipv4_addresses) > 1 ?
proxmox_virtual_environment_vm.bmpgen.ipv4_addresses[1][0] : ""
)
}
output "ssh_username" {
description = "SSH username cloud-init provisioned on both VMs."
value = var.ssh_username
}
output "grafana_url" {
description = "Grafana URL once deploy.sh finishes on the store VM."
value = format("http://%s:3000/grafana/",
var.store_vm_ip_cidr != "" ? split("/", var.store_vm_ip_cidr)[0] : "<store_ip>"
)
}
output "next_steps" {
description = "What to do after apply."
value = <<-EOT
Cloud-init on both VMs runs for ~5-10 minutes after apply completes.
Poll the store VM until it's up, then run the assertions:
../scripts/run-test.sh
To iterate on the terraform without rebuilding the VMs:
terraform apply -target=proxmox_virtual_environment_file.store_cloud_init
# then reset the VM: qm shutdown <vmid> && qm start <vmid>
# (cloud-init re-runs the snippet at next boot only if you touch it)
To tear down:
../scripts/teardown.sh
EOT
}