Skip to content

Commit 215dc84

Browse files
hodducmax-rocket-internet
authored andcommitted
Fix broken terraform plan/apply on a cluster < 1.14 (Fix #582) (#600)
1 parent 4f3f5b6 commit 215dc84

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1717

1818
- Updated instance_profile_names and instance_profile_arns outputs to also consider launch template as well as asg (by @ankitwal)
1919
- Fix deprecated interpolation-only expression (by @angelabad)
20+
- Fix broken terraform plan/apply on a cluster < 1.14 (by @hodduc)
2021

2122
# History
2223

data.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
locals {
2-
worker_ami_name_filter = var.worker_ami_name_filter != "" ? var.worker_ami_name_filter : "amazon-eks-node-${var.cluster_version}-v*"
3-
worker_ami_name_filter_windows = var.worker_ami_name_filter_windows != "" ? var.worker_ami_name_filter_windows : "Windows_Server-2019-English-Core-EKS_Optimized-${var.cluster_version}-*"
2+
worker_ami_name_filter = var.worker_ami_name_filter != "" ? var.worker_ami_name_filter : "amazon-eks-node-${var.cluster_version}-v*"
3+
4+
# Windows nodes are available from k8s 1.14. If cluster version is less than 1.14, fix ami filter to some constant to not fail on 'terraform plan'.
5+
worker_ami_name_filter_windows = (var.worker_ami_name_filter_windows != "" ?
6+
var.worker_ami_name_filter_windows : "Windows_Server-2019-English-Core-EKS_Optimized-${tonumber(var.cluster_version) >= 1.14 ? var.cluster_version : 1.14}-*"
7+
)
48
}
59

610
data "aws_iam_policy_document" "workers_assume_role_policy" {

0 commit comments

Comments
 (0)