Skip to content

Commit

Permalink
Merge pull request #12 from getndazn/delete-on-termination
Browse files Browse the repository at this point in the history
Delete network interface on instance termination
  • Loading branch information
Michał Wieczorek authored Jun 12, 2020
2 parents 7438646 + 5087116 commit 686f006
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG/2020-06-12-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- type: changed
m: Delete network interface on instance termination
owner: mwieczorek
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ resource "aws_launch_template" "bastion-service-host" {

network_interfaces {
associate_public_ip_address = var.public_ip
delete_on_termination = var.delete_network_interface_on_termination
security_groups = concat(
[aws_security_group.bastion_service.id],
var.security_groups_additional
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,8 @@ variable "on_demand_base_capacity" {
default = 0
description = "allows a base level of on demand when using spot"
}

variable "delete_network_interface_on_termination" {
description = "if network interface created for bastion host should be deleted when instance in terminated. Setting propagated to aws_launch_template.network_interfaces.delete_on_termination"
default = true
}

0 comments on commit 686f006

Please sign in to comment.