Skip to content

Commit 9cfe55a

Browse files
committed
Suppress unstable outputs by default
1 parent d9551c8 commit 9cfe55a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ output "name" {
1414
}
1515

1616
output "security_group_details" {
17-
description = "Details about the security group created"
18-
value = var.create_before_destroy ? aws_security_group.cbd : aws_security_group.default
17+
description = "(UNSTABLE) Details about the security group created"
18+
value = var.unstable_output_enabled ? (var.create_before_destroy ? aws_security_group.cbd : aws_security_group.default) : null
1919
}
2020

2121
output "rules" {
22-
description = "Details about all the security group rules created"
23-
value = concat(try(values(aws_security_group_rule.default), []), aws_security_group_rule.sg, aws_security_group_rule.cidr, aws_security_group_rule.self, aws_security_group_rule.egress)
22+
description = "(UNSTABLE) Details about all the security group rules created"
23+
value = var.unstable_output_enabled ? concat(try(values(aws_security_group_rule.default), []), aws_security_group_rule.sg, aws_security_group_rule.cidr, aws_security_group_rule.self, aws_security_group_rule.egress) : null
2424
}

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,12 @@ variable "rule_matrix" {
9292
A convenient way to apply the same set of rules to a set of subjects. See README for details.
9393
EOT
9494
}
95+
96+
variable "unstable_output_enabled" {
97+
type = bool
98+
default = false
99+
description = <<-EOT
100+
Some outputs are unstable, meaning that they can show a change even when no resource changes are made.
101+
These outputs are suppressed by default. Set `unstable_output_enabled` to enable them.
102+
EOT
103+
}

0 commit comments

Comments
 (0)