-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
57 lines (48 loc) · 2.17 KB
/
outputs.tf
File metadata and controls
57 lines (48 loc) · 2.17 KB
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
# Module Outputs
output "autoscaling_group_id" {
description = "The ID of the Auto Scaling Group."
value = aws_autoscaling_group.this.id
}
output "autoscaling_group_name" {
description = "The name of the Auto Scaling Group."
value = aws_autoscaling_group.this.name
}
output "autoscaling_group_arn" {
description = "The ARN of the Auto Scaling Group."
value = aws_autoscaling_group.this.arn
}
# Simplify complex conditional outputs
output "launch_template_id" {
description = "The ID of the Launch Template created or used."
value = var.use_launch_template ? (var.create_launch_template ? aws_launch_template.this[0].id : local.launch_template_source_id) : null
}
output "launch_template_arn" {
description = "The ARN of the Launch Template created or used."
value = var.use_launch_template ? (
var.create_launch_template ? aws_launch_template.this[0].arn :
length(data.aws_launch_template.existing) > 0 ? data.aws_launch_template.existing[0].arn : null
) : null
}
output "launch_template_latest_version" {
description = "The latest version number of the Launch Template created or used."
value = var.use_launch_template ? (
var.create_launch_template ? aws_launch_template.this[0].latest_version :
length(data.aws_launch_template.existing) > 0 ? data.aws_launch_template.existing[0].latest_version : null
) : null
}
output "launch_configuration_name" {
description = "The name of the Launch Configuration created or used."
value = !var.use_launch_template ? (var.create_launch_configuration ? aws_launch_configuration.this[0].name : local.launch_config_source_name) : null
}
output "scaling_policy_arns" {
description = "Map of scaling policy names to their ARNs."
value = { for k, v in aws_autoscaling_policy.this : k => v.arn }
}
output "scheduled_action_arns" {
description = "Map of scheduled action names to their ARNs."
value = { for k, v in aws_autoscaling_schedule.this : k => v.arn }
}
output "lifecycle_hook_names" {
description = "Map of lifecycle hook names (keys used in var.lifecycle_hooks) to their actual AWS names."
value = { for k, v in aws_autoscaling_lifecycle_hook.this : k => v.name }
}