Skip to content

Commit da6ff7d

Browse files
Fix for "" AMI ID error in PR 115 (#117)
* Fix for "" AMI ID * update changelog
1 parent 5531776 commit da6ff7d

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12-
- A useful addition (slam dunk, @self 🔥)
1312
- add support for [`amazon-eks-node-*` AMI with bootstrap script](https://aws.amazon.com/blogs/opensource/improvements-eks-worker-node-provisioning/) (by @erks)
14-
- expose `kubelet_extra_args` worker group option (replacing `kubelet_node_labels`) to allow specifying arbitrary kubelet options (e.g. taints and labels) (by @erks)
13+
- expose `kubelet_extra_args` worker group option (replacing `kubelet_node_labels`) to allow specifying arbitrary kubelet options (e.g. taints and labels) (by @erks)
1514

1615
### Changed
1716

18-
- A subtle but thoughtful change. (Boomshakalaka, @self 🏀)
1917
- allow a custom AMI to be specified as a default (by @erks)
18+
- Bugfix for above change (by @max-rocket-internet)
2019
- **Breaking change** Removed support for `eks-worker-*` AMI. The cluster specifying a custom AMI based off of `eks-worker-*` AMI will have to rebuild the AMI from `amazon-eks-node-*`. (by @erks)
2120
- **Breaking change** Removed `kubelet_node_labels` worker group option in favor of `kubelet_extra_args`. (by @erks)
2221

local.tf

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ locals {
99
kubeconfig_name = "${var.kubeconfig_name == "" ? "eks_${var.cluster_name}" : var.kubeconfig_name}"
1010

1111
workers_group_defaults_defaults = {
12-
name = "count.index" # Name of the worker group. Literal count.index will never be used but if name is not set, the count.index interpolation will be used.
13-
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.
14-
asg_desired_capacity = "1" # Desired worker capacity in the autoscaling group.
15-
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
16-
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
17-
instance_type = "m4.large" # Size of the workers instances.
18-
spot_price = "" # Cost of spot instance.
19-
root_volume_size = "100" # root volume size of workers instances.
20-
root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1'
21-
root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1".
22-
key_name = "" # The key name that should be used for the instances in the autoscaling group
23-
pre_userdata = "" # userdata to pre-append to the default userdata.
24-
additional_userdata = "" # userdata to append to the default userdata.
25-
ebs_optimized = true # sets whether to use ebs optimization on supported types.
26-
enable_monitoring = true # Enables/disables detailed monitoring.
27-
public_ip = false # Associate a public ip address with a worker
28-
kubelet_extra_args = "" # This string is passed directly to kubelet if set. Useful for adding labels or taints.
29-
subnets = "" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789
30-
autoscaling_enabled = false # Sets whether policy and matching tags will be added to allow autoscaling.
12+
name = "count.index" # Name of the worker group. Literal count.index will never be used but if name is not set, the count.index interpolation will be used.
13+
ami_id = "${data.aws_ami.eks_worker.id}" # AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI.
14+
asg_desired_capacity = "1" # Desired worker capacity in the autoscaling group.
15+
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
16+
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
17+
instance_type = "m4.large" # Size of the workers instances.
18+
spot_price = "" # Cost of spot instance.
19+
root_volume_size = "100" # root volume size of workers instances.
20+
root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1'
21+
root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1".
22+
key_name = "" # The key name that should be used for the instances in the autoscaling group
23+
pre_userdata = "" # userdata to pre-append to the default userdata.
24+
additional_userdata = "" # userdata to append to the default userdata.
25+
ebs_optimized = true # sets whether to use ebs optimization on supported types.
26+
enable_monitoring = true # Enables/disables detailed monitoring.
27+
public_ip = false # Associate a public ip address with a worker
28+
kubelet_extra_args = "" # This string is passed directly to kubelet if set. Useful for adding labels or taints.
29+
subnets = "" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789
30+
autoscaling_enabled = false # Sets whether policy and matching tags will be added to allow autoscaling.
3131
}
3232

3333
workers_group_defaults = "${merge(local.workers_group_defaults_defaults, var.workers_group_defaults)}"

workers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "aws_launch_configuration" "workers" {
2626
associate_public_ip_address = "${lookup(var.worker_groups[count.index], "public_ip", lookup(local.workers_group_defaults, "public_ip"))}"
2727
security_groups = ["${local.worker_security_group_id}"]
2828
iam_instance_profile = "${aws_iam_instance_profile.workers.id}"
29-
image_id = "${lookup(var.worker_groups[count.index], "ami_id", lookup(local.workers_group_defaults, "ami_id", data.aws_ami.eks_worker.id))}"
29+
image_id = "${lookup(var.worker_groups[count.index], "ami_id", lookup(local.workers_group_defaults, "ami_id"))}"
3030
instance_type = "${lookup(var.worker_groups[count.index], "instance_type", lookup(local.workers_group_defaults, "instance_type"))}"
3131
key_name = "${lookup(var.worker_groups[count.index], "key_name", lookup(local.workers_group_defaults, "key_name"))}"
3232
user_data_base64 = "${base64encode(element(data.template_file.userdata.*.rendered, count.index))}"

0 commit comments

Comments
 (0)