diff --git a/CHANGELOG.md b/CHANGELOG.md index eca01c2d8f..cc4fec1007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [[v0.2.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v0.1.1...v0.2.0)] - 2018-06-08] + +### Changed + +- `worker_ami_id` is now made optional. If not specified, the module will source the latest AWS supported EKS AMI instead. + +## [[v0.1.1](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v0.1.0...v0.1.1)] - 2018-06-07] + +### Changed + +- pre-commit hooks fixed and working. +- made progress on CI, advancing the build to the final `kitchen test` stage before failing. + ## [v0.1.0] - 2018-06-07 ### Added - Everything! Initial release of the module. -- Kudos to @tanmng for finding and fixing bug #1. +- added a local variable to do a lookup against for a dynamic value in userdata which was previously static. Kudos to @tanmng for finding and fixing bug #1! diff --git a/README.md b/README.md index fb8e0fd5dc..98718a1725 100644 --- a/README.md +++ b/README.md @@ -89,15 +89,15 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | cluster_ingress_cidrs | The CIDRs from which we can execute kubectl commands. | list | - | yes | -| cluster_name | Name of the EKS cluster. | string | - | yes | +| cluster_name | Name of the EKS cluster which is also used as a prefix in names of related resources. | string | - | yes | | cluster_version | Kubernetes version to use for the cluster. | string | `1.10` | no | | subnets | A list of subnets to associate with the cluster's underlying instances. | list | - | yes | -| tags | A map of tags to add to all resources | string | `` | no | +| tags | A map of tags to add to all resources. | string | `` | no | | vpc_id | VPC id where the cluster and other resources will be deployed. | string | - | yes | -| workers_ami_id | AMI ID for the eks workers. | string | - | yes | -| workers_asg_desired_capacity | description | string | `1` | no | -| workers_asg_max_size | description | string | `3` | no | -| workers_asg_min_size | description | string | `1` | no | +| workers_ami_id | AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI. | string | `` | no | +| workers_asg_desired_capacity | Desired worker capacity in the autoscaling group. | string | `1` | no | +| workers_asg_max_size | Maximum worker capacity in the autoscaling group. | string | `3` | no | +| workers_asg_min_size | Minimum worker capacity in the autoscaling group. | string | `1` | no | | workers_instance_type | Size of the workers instances. | string | `m4.large` | no | ## Outputs diff --git a/data.tf b/data.tf index 95ce1b666c..c7c69c5b84 100644 --- a/data.tf +++ b/data.tf @@ -1,5 +1,15 @@ data "aws_region" "current" {} +data "aws_ami" "eks_worker" { + filter { + name = "name" + values = ["eks-worker-*"] + } + + most_recent = true + owners = ["602401143452"] # Amazon +} + data "aws_iam_policy_document" "workers_assume_role_policy" { statement { sid = "EKSWorkerAssumeRole" diff --git a/examples/eks_test_fixture/main.tf b/examples/eks_test_fixture/main.tf index 561a14bc6b..db359db707 100644 --- a/examples/eks_test_fixture/main.tf +++ b/examples/eks_test_fixture/main.tf @@ -14,16 +14,6 @@ provider "random" { provider "http" {} provider "local" {} -data "aws_ami" "eks_worker" { - filter { - name = "name" - values = ["eks-worker-*"] - } - - most_recent = true - owners = ["602401143452"] # Amazon -} - data "aws_availability_zones" "available" {} data "http" "workstation_external_ip" { @@ -75,7 +65,6 @@ module "eks" { subnets = "${module.vpc.public_subnets}" tags = "${local.tags}" vpc_id = "${module.vpc.vpc_id}" - workers_ami_id = "${data.aws_ami.eks_worker.id}" cluster_ingress_cidrs = ["${local.workstation_external_cidr}"] workers_instance_type = "t2.small" } diff --git a/variables.tf b/variables.tf index 634a400dca..456cf37948 100644 --- a/variables.tf +++ b/variables.tf @@ -4,7 +4,7 @@ variable "cluster_ingress_cidrs" { } variable "cluster_name" { - description = "Name of the EKS cluster." + description = "Name of the EKS cluster which is also used as a prefix in names of related resources." } variable "cluster_version" { @@ -18,7 +18,7 @@ variable "subnets" { } variable "tags" { - description = "A map of tags to add to all resources" + description = "A map of tags to add to all resources." default = {} } @@ -27,21 +27,22 @@ variable "vpc_id" { } variable "workers_ami_id" { - description = "AMI ID for the eks workers." + description = "AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI." + default = "" } variable "workers_asg_desired_capacity" { - description = "description" + description = "Desired worker capacity in the autoscaling group." default = "1" } variable "workers_asg_max_size" { - description = "description" + description = "Maximum worker capacity in the autoscaling group." default = "3" } variable "workers_asg_min_size" { - description = "description" + description = "Minimum worker capacity in the autoscaling group." default = "1" } diff --git a/version b/version index 8308b63aea..1474d00f01 100644 --- a/version +++ b/version @@ -1 +1 @@ -v0.1.1 +v0.2.0 diff --git a/workers.tf b/workers.tf index c1fa97ab6d..b5d0367eec 100644 --- a/workers.tf +++ b/workers.tf @@ -19,7 +19,7 @@ resource "aws_launch_configuration" "workers" { associate_public_ip_address = true name_prefix = "${var.cluster_name}" iam_instance_profile = "${aws_iam_instance_profile.workers.name}" - image_id = "${var.workers_ami_id}" + image_id = "${var.workers_ami_id == "" ? data.aws_ami.eks_worker.id : var.workers_ami_id}" instance_type = "${var.workers_instance_type}" security_groups = ["${aws_security_group.workers.id}"] user_data_base64 = "${base64encode(local.workers_userdata)}"