Skip to content

Commit 9fe2cfd

Browse files
Merge pull request #296 from max-rocket-internet/ami_filter
Adding optional name filter variable to be able to pin worker AMI to a release
2 parents dcdf413 + 7f8ef9a commit 9fe2cfd

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
### Added
1313

14-
- Write your awesome addition here (by @you)
14+
- Added output for generated kubeconfig filename (by @syst0m)
15+
- Added outputs for cluster role ARN and name (by @spingel)
16+
- Added optional name filter variable to be able to pin worker AMI to a release (by @max-rocket-internet)
1517

1618
### Changed
1719

@@ -21,11 +23,6 @@ project adheres to [Semantic Versioning](http://semver.org/).
2123

2224
## [[v2.2.1](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v2.2.0...v2.2.1)] - 2019-02-18]
2325

24-
### Added
25-
26-
- Added output for generated kubeconfig filename (by @syst0m)
27-
- Added outputs for cluster role ARN and name (by @spingel)
28-
2926
## [[v2.2.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v2.1.0...v2.2.0)] - 2019-02-07]
3027

3128
### Added

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
135135
| tags | A map of tags to add to all resources. | map | `{}` | no |
136136
| vpc\_id | VPC where the cluster and workers will be deployed. | string | n/a | yes |
137137
| worker\_additional\_security\_group\_ids | A list of additional security group ids to attach to worker instances | list | `[]` | no |
138+
| worker\_ami\_name\_filter | Additional name filter for AWS EKS worker AMI. Default behaviour will get latest for the cluster_version but could be set to a release from amazon-eks-ami, e.g. "v20190220" | string | `"v*"` | no |
138139
| worker\_create\_security\_group | Whether to create a security group for the workers or attach the workers to `worker_security_group_id`. | string | `"true"` | no |
139140
| worker\_group\_count | The number of maps contained within the worker_groups list. | string | `"1"` | no |
140141
| worker\_group\_launch\_template\_count | The number of maps contained within the worker_groups_launch_template list. | string | `"0"` | no |
@@ -155,9 +156,9 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
155156
|------|-------------|
156157
| cluster\_certificate\_authority\_data | Nested attribute containing certificate-authority-data for your cluster. This is the base64 encoded certificate data required to communicate with your cluster. |
157158
| cluster\_endpoint | The endpoint for your EKS Kubernetes API. |
159+
| cluster\_iam\_role\_arn | IAM role ARN of the EKS cluster. |
160+
| cluster\_iam\_role\_name | IAM role name of the EKS cluster. |
158161
| cluster\_id | The name/id of the EKS cluster. |
159-
| cluster\_role\_arn | IAM role ARN of the EKS cluster role. |
160-
| cluster\_role\_name | IAM role name of the EKS cluster role. |
161162
| cluster\_security\_group\_id | Security group ID attached to the EKS cluster. |
162163
| cluster\_version | The Kubernetes server version for the EKS cluster. |
163164
| config\_map\_aws\_auth | A kubernetes configuration to authenticate to this EKS cluster. |

data.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ data "aws_iam_policy_document" "workers_assume_role_policy" {
1818
data "aws_ami" "eks_worker" {
1919
filter {
2020
name = "name"
21-
values = ["amazon-eks-node-${var.cluster_version}-v*"]
21+
values = ["amazon-eks-node-${var.cluster_version}-${var.worker_ami_name_filter}"]
2222
}
2323

2424
most_recent = true
25-
owners = ["602401143452"]
25+
26+
# Owner ID of AWS EKS team
27+
owners = ["602401143452"]
2628
}
2729

2830
data "aws_iam_policy_document" "cluster_assume_role_policy" {

variables.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ variable "worker_group_count" {
101101
}
102102

103103
variable "workers_group_defaults" {
104-
description = "Override default values for target groups. See workers_group_defaults_defaults in locals.tf for valid keys."
104+
description = "Override default values for target groups. See workers_group_defaults_defaults in local.tf for valid keys."
105105
type = "map"
106106
default = {}
107107
}
@@ -133,7 +133,7 @@ variable "worker_group_launch_template_count" {
133133
}
134134

135135
variable "workers_group_launch_template_defaults" {
136-
description = "Override default values for target groups. See workers_group_defaults_defaults in locals.tf for valid keys."
136+
description = "Override default values for target groups. See workers_group_defaults_defaults in local.tf for valid keys."
137137
type = "map"
138138
default = {}
139139
}
@@ -152,6 +152,11 @@ variable "worker_security_group_id" {
152152
default = ""
153153
}
154154

155+
variable "worker_ami_name_filter" {
156+
description = "Additional name filter for AWS EKS worker AMI. Default behaviour will get latest for the cluster_version but could be set to a release from amazon-eks-ami, e.g. \"v20190220\""
157+
default = "v*"
158+
}
159+
155160
variable "worker_additional_security_group_ids" {
156161
description = "A list of additional security group ids to attach to worker instances"
157162
type = "list"

0 commit comments

Comments
 (0)