Skip to content

Commit 94b2d16

Browse files
committed
Pass bastion instance id around so it can be templated
1 parent e20fdc2 commit 94b2d16

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

modules/eks/submodules/k8s/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ locals {
2020
k8s_tunnel_port = random_integer.port.result
2121
aws_auth_yaml = basename(local.aws_auth_filename)
2222
ssh_pvt_key_path = var.ssh_key.path
23-
ssh_extra_args = var.ssh_extra_args
23+
ssh_extra_args = var.bastion_info != null templatestring(var.ssh_extra_args, {bastion_instance_id = var.bastion.instance_id}) : ""
2424
eks_cluster_arn = var.eks_info.cluster.arn
2525
bastion_user = var.bastion_info != null ? var.bastion_info.user : ""
2626
bastion_public_ip = var.bastion_info != null ? var.bastion_info.public_ip : ""

modules/eks/submodules/k8s/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ variable "bastion_info" {
66
ssh_bastion_command = Command to ssh onto bastion.
77
EOF
88
type = object({
9+
instance_id = string
910
user = string
1011
public_ip = string
1112
security_group_id = string

modules/eks/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ variable "node_iam_policies" {
9999

100100
variable "bastion_info" {
101101
description = <<EOF
102+
instance_id = Bastion instance id
102103
user = Bastion username.
103104
public_ip = Bastion public ip.
104105
security_group_id = Bastion sg id.

modules/infra/submodules/bastion/outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
output "info" {
22
description = "Bastion information."
33
value = {
4+
instance_id = aws_instance.bastion.id
45
user = var.bastion.username
56
public_ip = aws_eip.bastion.public_ip
67
security_group_id = aws_security_group.bastion.id

0 commit comments

Comments
 (0)