-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputs.tf
87 lines (74 loc) · 2.26 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
output "cluster_address" {
description = "Bootstrap node public ip"
value = aws_instance.bootstrap_node.public_ip
}
output "identifier" {
description = "Identifier of the cluster"
value = var.identifier
}
output "trust_token" {
description = "Trust token for the cluster"
value = ssh_resource.trust_token.result
}
output "bootstrap_node" {
description = "Bootstrap node details"
value = {
slug = aws_instance.bootstrap_node.tags.Name
public_ip = aws_instance.bootstrap_node.public_ip
id = aws_instance.bootstrap_node.id
}
}
output "bastion_access" {
description = "Bastion access output for passing into other modules"
value = {
user = local.user
host = aws_instance.bastion.public_ip
port = local.ssh_port
private_key = tls_private_key.terraform_cloud.private_key_openssh
architecture = var.ami_architecture
}
sensitive = true
}
output "nodes" {
description = "Compute nodes details"
value = [
for key, node in aws_instance.nodes :
{
slug = node.tags.Name
public_ip = node.public_ip
id = node.id
}
]
}
output "nodes_iam_role" {
description = "IAM Role for nodes and bootstrap node"
value = {
name = aws_iam_role.nodes.name
id = aws_iam_role.nodes.id
}
}
output "balancer" {
description = "Load balancer details"
value = {
enabled = var.balancer || var.global_accelerator
name = var.global_accelerator ? module.global_accelerator[0].name : (var.balancer ? module.balancer[0].name : null)
address = var.global_accelerator ? module.global_accelerator[0].address : (var.balancer ? module.balancer[0].address : null)
dependencies = var.global_accelerator ? module.global_accelerator[0].dependencies : (var.balancer ? module.balancer[0].dependencies : [])
}
}
output "nodes_security_group_id" {
description = "Nodes security group id"
value = aws_security_group.nodes_firewall.id
}
output "bastion_security_group_id" {
description = "Bastion security group id"
value = aws_security_group.bastion_firewall.id
}
output "vpc_id" {
description = "VPC id"
value = var.vpc_id
}
output "subnet_ids" {
description = "Subnet IDs"
value = var.public_subnet_ids
}