Skip to content

Commit 9b445dc

Browse files
committed
revert changes from other mr
1 parent c0516ba commit 9b445dc

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

modules/eks-managed-node-group/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
data "aws_partition" "current" {
2-
count = var.create ? 1 : 0
2+
count = var.create && var.partition == "" ? 1 : 0
33
}
44
data "aws_caller_identity" "current" {
5-
count = var.create ? 1 : 0
5+
count = var.create && var.account_id == "" ? 1 : 0
66
}
77

88
locals {
9-
partition = try(data.aws_partition.current[0].partition, "")
10-
account_id = try(data.aws_caller_identity.current[0].account_id, "")
9+
partition = try(data.aws_partition.current[0].partition, var.partition)
10+
account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id)
1111
}
1212

1313
################################################################################

modules/eks-managed-node-group/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ variable "region" {
1717
default = null
1818
}
1919

20+
variable "partition" {
21+
description = "The AWS partition - pass through value to reduce number of GET requests from data sources"
22+
type = string
23+
default = ""
24+
}
25+
26+
variable "account_id" {
27+
description = "The AWS account ID - pass through value to reduce number of GET requests from data sources"
28+
type = string
29+
default = ""
30+
}
31+
2032
################################################################################
2133
# User Data
2234
################################################################################

modules/fargate-profile/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ data "aws_region" "current" {
44
region = var.region
55
}
66
data "aws_partition" "current" {
7-
count = var.create ? 1 : 0
7+
count = var.create && var.partition == "" ? 1 : 0
88
}
99
data "aws_caller_identity" "current" {
10-
count = var.create ? 1 : 0
10+
count = var.create && var.account_id == "" ? 1 : 0
1111
}
1212

1313
locals {
14-
account_id = try(data.aws_caller_identity.current[0].account_id, "")
15-
partition = try(data.aws_partition.current[0].partition, "")
14+
account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id)
15+
partition = try(data.aws_partition.current[0].partition, var.partition)
1616
region = try(data.aws_region.current[0].region, "")
1717
}
1818

modules/fargate-profile/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ variable "region" {
1818
default = null
1919
}
2020

21+
variable "partition" {
22+
description = "The AWS partition - pass through value to reduce number of GET requests from data sources"
23+
type = string
24+
default = ""
25+
}
26+
27+
variable "account_id" {
28+
description = "The AWS account ID - pass through value to reduce number of GET requests from data sources"
29+
type = string
30+
default = ""
31+
}
32+
2133
################################################################################
2234
# IAM Role
2335
################################################################################

modules/self-managed-node-group/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
data "aws_partition" "current" {
2-
count = var.create ? 1 : 0
2+
count = var.create && var.partition == "" ? 1 : 0
33
}
44
data "aws_caller_identity" "current" {
5-
count = var.create ? 1 : 0
5+
count = var.create && var.account_id == "" ? 1 : 0
66
}
77

88
locals {
9-
partition = try(data.aws_partition.current[0].partition, "")
10-
account_id = try(data.aws_caller_identity.current[0].account_id, "")
9+
partition = try(data.aws_partition.current[0].partition, var.partition)
10+
account_id = try(data.aws_caller_identity.current[0].account_id, var.account_id)
1111
}
1212

1313
################################################################################

modules/self-managed-node-group/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ variable "region" {
1717
default = null
1818
}
1919

20+
variable "partition" {
21+
description = "The AWS partition - pass through value to reduce number of GET requests from data sources"
22+
type = string
23+
default = ""
24+
}
25+
26+
variable "account_id" {
27+
description = "The AWS account ID - pass through value to reduce number of GET requests from data sources"
28+
type = string
29+
default = ""
30+
}
31+
2032
################################################################################
2133
# User Data
2234
################################################################################

0 commit comments

Comments
 (0)