Skip to content

Commit 47c7e7a

Browse files
whiskeyjimbomax-rocket-internet
authored andcommitted
Fix: ENI's prevent SecGrps from being destroyed on tf destroy (#311)
* Fix: remove ENI's on term fixes cluster destroy issues with security group still attached * Fix: delete ENIs on term to allow sg destroy
1 parent 18e0086 commit 47c7e7a

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

CHANGELOG.md

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

1212
### Added
1313

14+
- Write your awesome addition here (by @you)
15+
- Fixed: Ability to destroy clusters due to security groups being attached to ENI's (by @whiskeyjimbo)
1416
- Added outputs for worker IAM instance profile(s) (by @soapergem)
1517
- Added support for cluster logging via the `cluster_enabled_log_types` variable (by @sc250024)
1618

local.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ locals {
7373
ebs_optimized = true # sets whether to use ebs optimization on supported types.
7474
enable_monitoring = true # Enables/disables detailed monitoring.
7575
public_ip = false # Associate a public ip address with a worker
76+
eni_delete = true # Delete the ENI on termination (if set to false you will have to manually delete before destroying)
7677
kubelet_extra_args = "" # This string is passed directly to kubelet if set. Useful for adding labels or taints.
7778
subnets = "${join(",", var.subnets)}" # A comma delimited string of subnets to place the worker nodes in. i.e. subnet-123,subnet-456,subnet-789
7879
autoscaling_enabled = false # Sets whether policy and matching tags will be added to allow autoscaling.

workers_launch_template.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ resource "aws_launch_template" "workers_launch_template" {
6464

6565
network_interfaces {
6666
associate_public_ip_address = "${lookup(var.worker_groups_launch_template[count.index], "public_ip", local.workers_group_launch_template_defaults["public_ip"])}"
67+
delete_on_termination = "${lookup(var.worker_groups_launch_template[count.index], "eni_delete", local.workers_group_launch_template_defaults["eni_delete"])}"
6768
security_groups = ["${local.worker_security_group_id}", "${var.worker_additional_security_group_ids}", "${compact(split(",",lookup(var.worker_groups_launch_template[count.index],"additional_security_group_ids", local.workers_group_launch_template_defaults["additional_security_group_ids"])))}"]
6869
}
6970

0 commit comments

Comments
 (0)