Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpat committed Nov 17, 2023
1 parent 15f7dc2 commit 46322a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ The following are also required:

#### Terraform Requirements:

- [Terraform](https://www.terraform.io/downloads.html) v1.4.5
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - v1.26.7
- [Terraform](https://www.terraform.io/downloads.html) v1.6.3
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - v1.26.10
- [jq](https://stedolan.github.io/jq/) v1.6
- [AWS CLI](https://aws.amazon.com/cli) (optional; useful as an alternative to the AWS Web Console) v2.7.22
- [AWS CLI](https://aws.amazon.com/cli) (optional; useful as an alternative to the AWS Web Console) v2.13.33

#### Docker Requirements:

Expand Down
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ locals {
# Kubernetes
kubeconfig_filename = "${local.cluster_name}-kubeconfig.conf"
kubeconfig_path = var.iac_tooling == "docker" ? "/workspace/${local.kubeconfig_filename}" : local.kubeconfig_filename
kubeconfig_ca_cert = data.aws_eks_cluster.cluster.certificate_authority[0].data
kubeconfig_ca_cert = module.eks.cluster_certificate_authority_data

# Mapping node_pools to node_groups
default_node_pool = {
Expand Down
8 changes: 1 addition & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ provider "aws" {

}

data "aws_eks_cluster" "cluster" {
name = module.eks.cluster_name
depends_on = [module.eks.cluster_name]
}

data "aws_eks_cluster_auth" "cluster" {
name = module.eks.cluster_name
depends_on = [module.eks.cluster_name]
}

data "aws_availability_zones" "available" {}
Expand Down Expand Up @@ -64,7 +58,7 @@ provider "kubernetes" {
# delay the initialization of the k8s provider until the cluster is ready with a defined endpoint value.
# It establishes a dependency on the entire EKS cluster being ready and also provides a desired input to
# the kubernetes provider.
host = data.aws_eks_cluster.cluster.endpoint
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(local.kubeconfig_ca_cert)
token = data.aws_eks_cluster_auth.cluster.token
}
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ output "ebs_csi_account" {
}

output "k8s_version" {
value = data.aws_eks_cluster.cluster.version
value = module.eks.cluster_version
}

output "aws_shared_credentials_file" {
Expand Down

0 comments on commit 46322a9

Please sign in to comment.