Skip to content

Commit

Permalink
Merge pull request #7094 from granular-ryanbonham/fix_eni_delete_on_t…
Browse files Browse the repository at this point in the history
…ermination

Mark ENI 0 as delete_on_termination for LaunchTemplates
  • Loading branch information
k8s-ci-robot authored Jun 5, 2019
2 parents b645938 + 15a4570 commit bd74205
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ func (t *LaunchTemplate) RenderCloudformation(target *cloudformation.Cloudformat
ImageID: image,
InstanceType: e.InstanceType,
NetworkInterfaces: []*cloudformationLaunchTemplateNetworkInterfaces{
{AssociatePublicIPAddress: e.AssociatePublicIP},
{AssociatePublicIPAddress: e.AssociatePublicIP,
DeleteOnTermination: fi.Bool(true)},
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func TestLaunchTemplateCloudformationRender(t *testing.T) {
"KeyName": "mykey",
"NetworkInterfaces": [
{
"AssociatePublicIpAddress": true
"AssociatePublicIpAddress": true,
"DeleteOnTermination": true
}
],
"Placement": [
Expand Down Expand Up @@ -144,7 +145,8 @@ func TestLaunchTemplateCloudformationRender(t *testing.T) {
"KeyName": "mykey",
"NetworkInterfaces": [
{
"AssociatePublicIpAddress": true
"AssociatePublicIpAddress": true,
"DeleteOnTermination": true
}
],
"Placement": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ func (t *LaunchTemplate) RenderTerraform(target *terraform.TerraformTarget, a, e
InstanceType: e.InstanceType,
Lifecycle: &terraform.Lifecycle{CreateBeforeDestroy: fi.Bool(true)},
NetworkInterfaces: []*terraformLaunchTemplateNetworkInterfaces{
{AssociatePublicIPAddress: e.AssociatePublicIP},
{AssociatePublicIPAddress: e.AssociatePublicIP,
DeleteOnTermination: fi.Bool(true)},
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ resource "aws_launch_template" "test" {
network_interfaces = {
associate_public_ip_address = true
delete_on_termination = true
security_groups = ["${aws_security_group.nodes-1.id}", "${aws_security_group.nodes-2.id}"]
}
Expand Down Expand Up @@ -155,6 +156,7 @@ resource "aws_launch_template" "test" {
network_interfaces = {
associate_public_ip_address = true
delete_on_termination = true
security_groups = ["${aws_security_group.nodes-1.id}", "${aws_security_group.nodes-2.id}"]
}
Expand Down

0 comments on commit bd74205

Please sign in to comment.