Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/eks-managed-node-group/main.tf
Original file line number Diff line number Diff line change
@@ -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, "")
}

################################################################################
Expand Down
12 changes: 0 additions & 12 deletions modules/eks-managed-node-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
8 changes: 4 additions & 4 deletions modules/fargate-profile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}

Expand Down
12 changes: 0 additions & 12 deletions modules/fargate-profile/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
8 changes: 4 additions & 4 deletions modules/self-managed-node-group/main.tf
Original file line number Diff line number Diff line change
@@ -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, "")
}

################################################################################
Expand Down
12 changes: 0 additions & 12 deletions modules/self-managed-node-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
12 changes: 0 additions & 12 deletions node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down
Loading