1- output "instance_public_ip" {
2- description = " Public IP address of the EC2 instance"
3- value = aws_eip. api_server . public_ip
1+ output "vpc_id" {
2+ value = aws_vpc. main . id
43}
54
6- output "instance_id" {
7- description = " ID of the EC2 instance"
8- value = aws_instance. api_server . id
5+ output "public_subnet_ids" {
6+ value = [for s in aws_subnet . public : s . id ]
97}
108
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 } "
9+ output "app_private_subnet_ids" {
10+ value = [for s in aws_subnet . app_private : s . id ]
1411}
1512
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- }
13+ output "db_private_subnet_ids" {
14+ value = [for s in aws_subnet . db_private : s . id ]
15+ }
16+
17+ output "dependent_private_subnet_ids" {
18+ value = [for s in aws_subnet . dependent_private : s . id ]
19+ }
20+
21+ output "observability_private_subnet_ids" {
22+ value = [for s in aws_subnet . observability_private : s . id ]
23+ }
24+
25+ output "nat_gateway_ids" {
26+ value = [for ng in aws_nat_gateway . main : ng . id ]
27+ }
28+
29+ output "bastion_public_ips" {
30+ value = [for i in aws_instance . api_server : i . public_ip ]
31+ }
32+
33+ output "ssh_commands" {
34+ value = [for i in aws_instance . api_server : " ssh -i ${ var . key_name } .pem ubuntu@${ i . public_ip } " ]
35+ sensitive = true
36+ }
37+
38+ output "alb_dns_name" {
39+ value = aws_lb. main . dns_name
40+ }
41+
42+ output "alb_arn" {
43+ value = aws_lb. main . arn
44+ }
45+
46+ output "target_group_arn" {
47+ value = aws_lb_target_group. app_tg . arn
48+ }
49+
50+ output "dependent_sg_id" {
51+ value = aws_security_group. dependent_sg . id
52+ }
53+
54+ output "observability_sg_id" {
55+ value = aws_security_group. observability_sg . id
56+ }
57+
58+ output "db_sg_id" {
59+ value = aws_security_group. db_sg . id
60+ }
0 commit comments