Skip to content

Commit c0410e7

Browse files
committed
Add variable for disabling dynamic outputs
1 parent 97a08c8 commit c0410e7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ output "cluster_version" {
6868

6969
output "cluster_platform_version" {
7070
description = "Platform version for the cluster"
71-
value = try(aws_eks_cluster.this[0].platform_version, null)
71+
value = var.disable_dynamic_outputs ? try(aws_eks_cluster.this[0].platform_version, null) : null
7272
}
7373

7474
output "cluster_status" {
@@ -196,7 +196,7 @@ output "cluster_iam_role_unique_id" {
196196

197197
output "cluster_addons" {
198198
description = "Map of attribute maps for all EKS cluster addons enabled"
199-
value = merge(aws_eks_addon.this, aws_eks_addon.before_compute)
199+
value = var.disable_dynamic_outputs ? merge(aws_eks_addon.this, aws_eks_addon.before_compute) : null
200200
}
201201

202202
################################################################################

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ variable "prefix_separator" {
1616
default = "-"
1717
}
1818

19+
variable "disable_dynamic_outputs" {
20+
description = "Disable outputs for resource attributes that AWS can modify, preventing state drift"
21+
type = bool
22+
default = false
23+
}
24+
1925
################################################################################
2026
# Cluster
2127
################################################################################

0 commit comments

Comments
 (0)