Skip to content

Commit 478b8b3

Browse files
committed
Switch Kubernetes provider to use exec auth for fresh EKS tokens
1 parent 4af8578 commit 478b8b3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ The module has been tested with:
4646
| [aws_iam_user.materialize](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |
4747
| [aws_iam_user_policy.materialize_s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy) | resource |
4848
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
49-
| [aws_eks_cluster_auth.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_auth) | data source |
5049
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
5150

5251
## Inputs

datasources.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
data "aws_eks_cluster_auth" "cluster" {
2-
name = module.eks.cluster_name
3-
}
4-
51
data "aws_region" "current" {}
62
data "aws_caller_identity" "current" {}

providers.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
provider "kubernetes" {
22
host = module.eks.cluster_endpoint
33
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
4-
token = data.aws_eks_cluster_auth.cluster.token
4+
5+
exec {
6+
api_version = "client.authentication.k8s.io/v1beta1"
7+
command = "aws"
8+
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name]
9+
}
510
}
611

712
provider "helm" {

0 commit comments

Comments
 (0)