2024-05-31 20:37:39 +08:00
|
|
|
output "ec2-id-ip" {
|
|
|
|
description = "Ec2 instance id and private ip"
|
2022-09-05 18:32:37 +08:00
|
|
|
value = {
|
|
|
|
instance-id = aws_instance.ec2-instance.id
|
2024-05-31 20:37:39 +08:00
|
|
|
private-ip = aws_instance.ec2-instance.private_ip
|
2022-09-05 18:32:37 +08:00
|
|
|
}
|
|
|
|
}
|
2024-05-31 20:37:39 +08:00
|
|
|
|
|
|
|
output "instance-id" {
|
|
|
|
description = "Ec2 instance id"
|
|
|
|
value = aws_instance.ec2-instance.id
|
|
|
|
}
|
|
|
|
|
|
|
|
output "private-ip" {
|
|
|
|
description = "Ec2 instance private IP"
|
|
|
|
value = aws_instance.ec2-instance.private_ip
|
|
|
|
}
|
|
|
|
|
|
|
|
output "ssh-key-name" {
|
|
|
|
description = "Ec2 instance ssh key name"
|
|
|
|
value = var.create-ssh-key ? aws_key_pair.this[0].key_name : var.key-name
|
|
|
|
}
|
|
|
|
|
|
|
|
output "ssh-key-secret-arn" {
|
|
|
|
description = "Secretsmanager arn for ec2 instance ssh key"
|
|
|
|
value = var.create-ssh-key ? aws_secretsmanager_secret.this[0].arn : null
|
|
|
|
}
|
|
|
|
|
|
|
|
output "elastic-ip" {
|
|
|
|
description = "Ec2 instance EIP"
|
|
|
|
value = var.asso-eip ? aws_eip.ec2-eip[0].public_ip : null
|
2023-05-29 23:20:21 +08:00
|
|
|
}
|
|
|
|
|
2024-05-31 20:37:39 +08:00
|
|
|
output "public-ip" {
|
|
|
|
description = "Ec2 instance ephemeral public IP"
|
|
|
|
value = var.asso-public-ip ? aws_instance.ec2-instance.public_ip : null
|
2023-05-29 23:20:21 +08:00
|
|
|
}
|