From e6671e45ae115f80802a2ddf3ed998c02601809e Mon Sep 17 00:00:00 2001 From: Max Williams Date: Mon, 17 Dec 2018 09:43:53 +0100 Subject: [PATCH] Changing AMI data resource to filter for k8s version of cluster (#215) * Changing AMI data resource to only use k8s version of cluster * Reverting this method as it doesn't work --- CHANGELOG.md | 1 + README.md | 1 - data.tf | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d7bad9..ec2fa97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Added `--with-aggregate-type-defaults` option to terraform-docs (by @max-rocket-internet) +- Updated AMI ID filtering to only filter AMIs from current cluster k8s version (by @max-rocket-internet) ## [[v1.8.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v1.7.0...v1.8.0)] - 2018-12-04] diff --git a/README.md b/README.md index 10f5ffc..48f71e2 100644 --- a/README.md +++ b/README.md @@ -149,4 +149,3 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | worker\_security\_group\_id | Security group ID attached to the EKS workers. | | workers\_asg\_arns | IDs of the autoscaling groups containing workers. | | workers\_asg\_names | Names of the autoscaling groups containing workers. | - diff --git a/data.tf b/data.tf index 6a031ff..17de345 100644 --- a/data.tf +++ b/data.tf @@ -18,11 +18,11 @@ data "aws_iam_policy_document" "workers_assume_role_policy" { data "aws_ami" "eks_worker" { filter { name = "name" - values = ["amazon-eks-node-*"] + values = ["amazon-eks-node-${var.cluster_version}-v*"] } most_recent = true - owners = ["602401143452"] # Amazon + owners = ["602401143452"] } data "aws_iam_policy_document" "cluster_assume_role_policy" {