diff --git a/modules/eks-managed-node-group/main.tf b/modules/eks-managed-node-group/main.tf index aa9bd93d03..8f4838d859 100644 --- a/modules/eks-managed-node-group/main.tf +++ b/modules/eks-managed-node-group/main.tf @@ -1,13 +1,13 @@ data "aws_partition" "current" { - count = var.create && var.partition == "" ? 1 : 0 + count = var.create ? 1 : 0 } data "aws_caller_identity" "current" { - count = var.create && var.account_id == "" ? 1 : 0 + count = var.create ? 1 : 0 } locals { - partition = try(data.aws_partition.current[0].partition, var.partition) - account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id) + partition = try(data.aws_partition.current[0].partition, "") + account_id = try(data.aws_caller_identity.current[0].account_id, "") } ################################################################################ diff --git a/modules/eks-managed-node-group/variables.tf b/modules/eks-managed-node-group/variables.tf index 7f5180fa67..392cb17645 100644 --- a/modules/eks-managed-node-group/variables.tf +++ b/modules/eks-managed-node-group/variables.tf @@ -17,18 +17,6 @@ variable "region" { default = null } -variable "partition" { - description = "The AWS partition - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - -variable "account_id" { - description = "The AWS account ID - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - ################################################################################ # User Data ################################################################################ diff --git a/modules/fargate-profile/main.tf b/modules/fargate-profile/main.tf index 78c94357f4..984f27b2f4 100644 --- a/modules/fargate-profile/main.tf +++ b/modules/fargate-profile/main.tf @@ -4,15 +4,15 @@ data "aws_region" "current" { region = var.region } data "aws_partition" "current" { - count = var.create && var.partition == "" ? 1 : 0 + count = var.create ? 1 : 0 } data "aws_caller_identity" "current" { - count = var.create && var.account_id == "" ? 1 : 0 + count = var.create ? 1 : 0 } locals { - account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id) - partition = try(data.aws_partition.current[0].partition, var.partition) + account_id = try(data.aws_caller_identity.current[0].account_id, "") + partition = try(data.aws_partition.current[0].partition, "") region = try(data.aws_region.current[0].region, "") } diff --git a/modules/fargate-profile/variables.tf b/modules/fargate-profile/variables.tf index 5d87e56447..8442d54d0c 100644 --- a/modules/fargate-profile/variables.tf +++ b/modules/fargate-profile/variables.tf @@ -18,18 +18,6 @@ variable "region" { default = null } -variable "partition" { - description = "The AWS partition - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - -variable "account_id" { - description = "The AWS account ID - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - ################################################################################ # IAM Role ################################################################################ diff --git a/modules/self-managed-node-group/main.tf b/modules/self-managed-node-group/main.tf index 8a65dc6a66..1c87adc9e4 100644 --- a/modules/self-managed-node-group/main.tf +++ b/modules/self-managed-node-group/main.tf @@ -1,13 +1,13 @@ data "aws_partition" "current" { - count = var.create && var.partition == "" ? 1 : 0 + count = var.create ? 1 : 0 } data "aws_caller_identity" "current" { - count = var.create && var.account_id == "" ? 1 : 0 + count = var.create ? 1 : 0 } locals { - partition = try(data.aws_partition.current[0].partition, var.partition) - account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id) + partition = try(data.aws_partition.current[0].partition, "") + account_id = try(data.aws_caller_identity.current[0].account_id, "") } ################################################################################ diff --git a/modules/self-managed-node-group/variables.tf b/modules/self-managed-node-group/variables.tf index 6e42508c68..692e0520fb 100644 --- a/modules/self-managed-node-group/variables.tf +++ b/modules/self-managed-node-group/variables.tf @@ -17,18 +17,6 @@ variable "region" { default = null } -variable "partition" { - description = "The AWS partition - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - -variable "account_id" { - description = "The AWS account ID - pass through value to reduce number of GET requests from data sources" - type = string - default = "" -} - ################################################################################ # User Data ################################################################################ diff --git a/node_groups.tf b/node_groups.tf index f43a3e325d..443112dc74 100644 --- a/node_groups.tf +++ b/node_groups.tf @@ -233,10 +233,6 @@ module "fargate_profile" { region = var.region - # Pass through values to reduce GET requests from data sources - partition = local.partition - account_id = local.account_id - # Fargate Profile cluster_name = time_sleep.this[0].triggers["name"] cluster_ip_family = var.ip_family @@ -278,10 +274,6 @@ module "eks_managed_node_group" { region = var.region - # Pass through values to reduce GET requests from data sources - partition = local.partition - account_id = local.account_id - cluster_name = time_sleep.this[0].triggers["name"] kubernetes_version = each.value.kubernetes_version != null ? each.value.kubernetes_version : time_sleep.this[0].triggers["kubernetes_version"] @@ -406,10 +398,6 @@ module "self_managed_node_group" { region = var.region - # Pass through values to reduce GET requests from data sources - partition = local.partition - account_id = local.account_id - cluster_name = time_sleep.this[0].triggers["name"] # Autoscaling Group