mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-17 17:22:13 +01:00
* Replace coalesce() usage for locals with ternary operator. Fixes terraform errors during destroy when only empty strings were passed to coalesce(). * Update changelog. * Fix formatting.
This commit is contained in:
@@ -18,6 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed errors sometimes happening during destroy due to usage of coalesce() in local.tf (by @petrikero)
|
||||
- Write your awesome change here (by @you)
|
||||
|
||||
# History
|
||||
|
||||
25
local.tf
25
local.tf
@@ -1,28 +1,11 @@
|
||||
locals {
|
||||
asg_tags = null_resource.tags_as_list_of_maps.*.triggers
|
||||
|
||||
# Followed recommendation http://67bricks.com/blog/?p=85
|
||||
# to workaround terraform not supporting short circut evaluation
|
||||
cluster_security_group_id = coalesce(
|
||||
join("", aws_security_group.cluster.*.id),
|
||||
var.cluster_security_group_id,
|
||||
)
|
||||
cluster_security_group_id = var.cluster_create_security_group ? aws_security_group.cluster[0].id : var.cluster_security_group_id
|
||||
cluster_iam_role_name = var.manage_cluster_iam_resources ? aws_iam_role.cluster[0].name : var.cluster_iam_role_name
|
||||
cluster_iam_role_arn = var.manage_cluster_iam_resources ? aws_iam_role.cluster[0].arn : data.aws_iam_role.custom_cluster_iam_role[0].arn
|
||||
worker_security_group_id = var.worker_create_security_group ? aws_security_group.workers[0].id : var.worker_security_group_id
|
||||
|
||||
cluster_iam_role_name = coalesce(
|
||||
join("", aws_iam_role.cluster.*.name),
|
||||
var.cluster_iam_role_name,
|
||||
"aws-eks"
|
||||
)
|
||||
cluster_iam_role_arn = coalesce(
|
||||
join("", aws_iam_role.cluster.*.arn),
|
||||
join("", data.aws_iam_role.custom_cluster_iam_role.*.arn),
|
||||
"aws-eks"
|
||||
)
|
||||
|
||||
worker_security_group_id = coalesce(
|
||||
join("", aws_security_group.workers.*.id),
|
||||
var.worker_security_group_id,
|
||||
)
|
||||
default_iam_role_id = concat(aws_iam_role.workers.*.id, [""])[0]
|
||||
kubeconfig_name = var.kubeconfig_name == "" ? "eks_${var.cluster_name}" : var.kubeconfig_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user