Skip to content

Commit bf5f52b

Browse files
committed
update after review
1 parent 541ea58 commit bf5f52b

File tree

9 files changed

+153
-125
lines changed

9 files changed

+153
-125
lines changed

examples/bottlerocket/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117

@@ -87,6 +73,23 @@ resource "aws_iam_role_policy_attachment" "ssm" {
8773
policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
8874
}
8975

76+
################################################################################
77+
# Kubernetes provider configuration
78+
################################################################################
79+
data "aws_eks_cluster" "cluster" {
80+
name = module.eks.cluster_id
81+
}
82+
83+
data "aws_eks_cluster_auth" "cluster" {
84+
name = module.eks.cluster_id
85+
}
86+
87+
provider "kubernetes" {
88+
host = data.aws_eks_cluster.cluster.endpoint
89+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
90+
token = data.aws_eks_cluster_auth.cluster.token
91+
}
92+
9093
################################################################################
9194
# Supporting Resources
9295
################################################################################

examples/complete/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117

@@ -187,6 +173,23 @@ module "disabled_node_groups" {
187173
create_eks = false
188174
}
189175

176+
################################################################################
177+
# Kubernetes provider configuration
178+
################################################################################
179+
data "aws_eks_cluster" "cluster" {
180+
name = module.eks.cluster_id
181+
}
182+
183+
data "aws_eks_cluster_auth" "cluster" {
184+
name = module.eks.cluster_id
185+
}
186+
187+
provider "kubernetes" {
188+
host = data.aws_eks_cluster.cluster.endpoint
189+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
190+
token = data.aws_eks_cluster_auth.cluster.token
191+
}
192+
190193
################################################################################
191194
# Additional security groups for workers
192195
################################################################################

examples/fargate/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117

@@ -178,6 +164,23 @@ module "fargate_profile_existing_cluster" {
178164
}
179165
}
180166

167+
################################################################################
168+
# Kubernetes provider configuration
169+
################################################################################
170+
data "aws_eks_cluster" "cluster" {
171+
name = module.eks.cluster_id
172+
}
173+
174+
data "aws_eks_cluster_auth" "cluster" {
175+
name = module.eks.cluster_id
176+
}
177+
178+
provider "kubernetes" {
179+
host = data.aws_eks_cluster.cluster.endpoint
180+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
181+
token = data.aws_eks_cluster_auth.cluster.token
182+
}
183+
181184
################################################################################
182185
# Supporting Resources
183186
################################################################################

examples/instance_refresh/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
# Based on the official aws-node-termination-handler setup guide at https://github.com/aws/aws-node-termination-handler#infrastructure-setup
3016

3117
provider "helm" {
@@ -259,6 +245,23 @@ module "eks" {
259245
}
260246
}
261247

248+
################################################################################
249+
# Kubernetes provider configuration
250+
################################################################################
251+
data "aws_eks_cluster" "cluster" {
252+
name = module.eks.cluster_id
253+
}
254+
255+
data "aws_eks_cluster_auth" "cluster" {
256+
name = module.eks.cluster_id
257+
}
258+
259+
provider "kubernetes" {
260+
host = data.aws_eks_cluster.cluster.endpoint
261+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
262+
token = data.aws_eks_cluster_auth.cluster.token
263+
}
264+
262265
################################################################################
263266
# Supporting Resources
264267
################################################################################

examples/irsa/main.tf

+17-13
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@ locals {
1111
################################################################################
1212
# EKS Module
1313
################################################################################
14-
data "aws_eks_cluster" "cluster" {
15-
name = module.eks.cluster_id
16-
}
17-
18-
data "aws_eks_cluster_auth" "cluster" {
19-
name = module.eks.cluster_id
20-
}
21-
22-
provider "kubernetes" {
23-
host = data.aws_eks_cluster.cluster.endpoint
24-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
25-
token = data.aws_eks_cluster_auth.cluster.token
26-
}
2714

2815
module "eks" {
2916
source = "../.."
@@ -66,6 +53,23 @@ module "eks" {
6653
}
6754
}
6855

56+
################################################################################
57+
# Kubernetes provider configuration
58+
################################################################################
59+
data "aws_eks_cluster" "cluster" {
60+
name = module.eks.cluster_id
61+
}
62+
63+
data "aws_eks_cluster_auth" "cluster" {
64+
name = module.eks.cluster_id
65+
}
66+
67+
provider "kubernetes" {
68+
host = data.aws_eks_cluster.cluster.endpoint
69+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
70+
token = data.aws_eks_cluster_auth.cluster.token
71+
}
72+
6973
################################################################################
7074
# Supporting Resources
7175
################################################################################

examples/launch_templates/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117
cluster_name = local.name
@@ -87,6 +73,23 @@ module "eks" {
8773
}
8874
}
8975

76+
################################################################################
77+
# Kubernetes provider configuration
78+
################################################################################
79+
data "aws_eks_cluster" "cluster" {
80+
name = module.eks.cluster_id
81+
}
82+
83+
data "aws_eks_cluster_auth" "cluster" {
84+
name = module.eks.cluster_id
85+
}
86+
87+
provider "kubernetes" {
88+
host = data.aws_eks_cluster.cluster.endpoint
89+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
90+
token = data.aws_eks_cluster_auth.cluster.token
91+
}
92+
9093
################################################################################
9194
# Supporting Resources
9295
################################################################################

examples/launch_templates_with_managed_node_groups/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117

@@ -96,6 +82,23 @@ module "eks" {
9682
}
9783
}
9884

85+
################################################################################
86+
# Kubernetes provider configuration
87+
################################################################################
88+
data "aws_eks_cluster" "cluster" {
89+
name = module.eks.cluster_id
90+
}
91+
92+
data "aws_eks_cluster_auth" "cluster" {
93+
name = module.eks.cluster_id
94+
}
95+
96+
provider "kubernetes" {
97+
host = data.aws_eks_cluster.cluster.endpoint
98+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
99+
token = data.aws_eks_cluster_auth.cluster.token
100+
}
101+
99102
################################################################################
100103
# Supporting Resources
101104
################################################################################

examples/managed_node_groups/main.tf

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ locals {
1212
# EKS Module
1313
################################################################################
1414

15-
data "aws_eks_cluster" "cluster" {
16-
name = module.eks.cluster_id
17-
}
18-
19-
data "aws_eks_cluster_auth" "cluster" {
20-
name = module.eks.cluster_id
21-
}
22-
23-
provider "kubernetes" {
24-
host = data.aws_eks_cluster.cluster.endpoint
25-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
26-
token = data.aws_eks_cluster_auth.cluster.token
27-
}
28-
2915
module "eks" {
3016
source = "../.."
3117

@@ -101,6 +87,23 @@ module "eks" {
10187
}
10288
}
10389

90+
################################################################################
91+
# Kubernetes provider configuration
92+
################################################################################
93+
data "aws_eks_cluster" "cluster" {
94+
name = module.eks.cluster_id
95+
}
96+
97+
data "aws_eks_cluster_auth" "cluster" {
98+
name = module.eks.cluster_id
99+
}
100+
101+
provider "kubernetes" {
102+
host = data.aws_eks_cluster.cluster.endpoint
103+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
104+
token = data.aws_eks_cluster_auth.cluster.token
105+
}
106+
104107
################################################################################
105108
# Supporting Resources
106109
################################################################################

0 commit comments

Comments
 (0)