Skip to content

Commit 25b9ec3

Browse files
committed
imp: add ec2 region ssh_config and list-machines metadata
1 parent f1a71ec commit 25b9ec3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Justfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ list-machines:
452452
pubIpv6: $"(ansi red)--",
453453
Id: $"(ansi red)--",
454454
Type: $"(ansi red)--"
455+
Region: $"(ansi red)--"
455456
}
456457
}
457458

@@ -471,7 +472,7 @@ list-machines:
471472
let machine = ($host | str replace -r '\.ipv(4|6)$' '')
472473

473474
let update = if ($host | str ends-with ".ipv4") {
474-
{ pubIpv4: $hostData }
475+
{ pubIpv4: $hostData, Region: $it.Tag }
475476
} else if ($host | str ends-with ".ipv6") {
476477
{ pubIpv6: $hostData }
477478
} else {
@@ -799,6 +800,7 @@ ssh-config-example:
799800

800801
Host machine-example-1.ipv4
801802
HostName 1.2.3.5
803+
Tag eu-central-1
802804

803805
Host machine-example-1.ipv6
804806
HostName ff00::01

flake/opentofu/cluster.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ in {
683683
684684
Host ${name}.ipv4
685685
HostName ''${aws_eip.${name}[0].public_ip}
686+
Tag ${nodes.${name}.aws.region}
686687
687688
Host ${name}.ipv6
688689
HostName ''${length(aws_instance.${name}[0].ipv6_addresses) > 0 ? aws_instance.${name}[0].ipv6_addresses[0] : "unavailable.ipv6"}

0 commit comments

Comments
 (0)