Skip to content

Commit

Permalink
slightly cleanup locals
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek committed Sep 6, 2023
1 parent ed4a84b commit 8ebac1b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bootstrap/terraform/aws-bootstrap/locals.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
locals {
sts_principal = "sts.${data.aws_partition.current.dns_suffix}"
create_vpc = var.create_cluster && var.create_vpc ? true : false
private_subnet_ids = var.create_cluster ? module.vpc[0].private_subnets_ids : var.private_subnet_ids
public_subnet_ids = var.create_cluster ? module.vpc[0].public_subnets_ids : var.public_subnet_ids
worker_private_subnet_ids = var.create_cluster ? module.vpc[0].worker_private_subnets_ids : var.worker_private_subnet_ids
vpc_id = var.create_cluster ? module.vpc[0].vpc_id : data.aws_eks_cluster.cluster[0].vpc_config[0].vpc_id
cluster_id = var.create_cluster ? module.cluster[0].cluster_id : data.aws_eks_cluster.cluster[0].id
cluster_config = try(var.create_cluster ? module.cluster[0].config_map_aws_auth : tomap(false), {})
cluster_oidc_issuer_url = var.create_cluster ? module.cluster[0].cluster_oidc_issuer_url : data.aws_eks_cluster.cluster[0].identity[0].oidc.0.issuer
cluster_endpoint = var.create_cluster ? module.cluster[0].cluster_endpoint : data.aws_eks_cluster.cluster[0].endpoint
private_subnet_ids = var.create_cluster ? one(module.vpc[*].private_subnets_ids) : var.private_subnet_ids
public_subnet_ids = var.create_cluster ? one(module.vpc[*].public_subnets_ids) : var.public_subnet_ids
worker_private_subnet_ids = var.create_cluster ? one(module.vpc[*].worker_private_subnets_ids) : var.worker_private_subnet_ids
vpc_id = var.create_cluster ? one(module.vpc[*].vpc_id) : data.aws_eks_cluster.cluster[0].vpc_config[0].vpc_id
cluster_id = var.create_cluster ? one(module.cluster[*].cluster_id) : one(data.aws_eks_cluster.cluster[*].id)
cluster_config = try(var.create_cluster ? one(module.cluster[*].config_map_aws_auth) : tomap(false), {})
cluster_oidc_issuer_url = var.create_cluster ? one(module.cluster[*].cluster_oidc_issuer_url) : one(data.aws_eks_cluster.cluster[*].identity[0].oidc.0.issuer)
cluster_endpoint = var.create_cluster ? one(module.cluster[*].cluster_endpoint) : one(data.aws_eks_cluster.cluster[*].endpoint)
}

0 comments on commit 8ebac1b

Please sign in to comment.