Skip to content

Commit e58b5dc

Browse files
committed
exposes specific resource attributes for easy querying and sharing
1 parent 2c8f473 commit e58b5dc

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

terraform/outputs.tf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
output "instance_public_ip" {
2+
description = "Public IP address of the EC2 instance"
3+
value = aws_eip.api_server.public_ip
4+
}
5+
6+
output "instance_id" {
7+
description = "ID of the EC2 instance"
8+
value = aws_instance.api_server.id
9+
}
10+
11+
output "ssh_connection_command" {
12+
description = "SSH connection command"
13+
value = "ssh -i ${var.key_name}.pem ubuntu@${aws_eip.api_server.public_ip}"
14+
}
15+
16+
output "vpc_id" {
17+
description = "VPC ID"
18+
value = aws_vpc.main.id
19+
}
20+
21+
# Remove the problematic next_steps output or fix it:
22+
output "next_steps" {
23+
description = "Next steps after deployment"
24+
value = <<EOT
25+
Next steps:
26+
1. SSH to the instance: ssh -i ${var.key_name}.pem ubuntu@${aws_eip.api_server.public_ip}
27+
2. The instance is ready for Ansible configuration
28+
EOT
29+
}

0 commit comments

Comments
 (0)