Skip to content

Commit d8eb919

Browse files
committed
fix: do not set tags on existing network interfaces when creating ec2 instances
1 parent ffa284d commit d8eb919

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/cloud/services/ec2/instances.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,12 @@ func (s *Service) runInstance(role string, i *infrav1.Instance) (*infrav1.Instan
623623
}
624624

625625
if len(i.Tags) > 0 {
626-
resources := []string{ec2.ResourceTypeInstance, ec2.ResourceTypeVolume, ec2.ResourceTypeNetworkInterface}
626+
resources := []string{ec2.ResourceTypeInstance, ec2.ResourceTypeVolume}
627+
628+
if len(i.NetworkInterfaces) == 0 {
629+
resources = append(resources, ec2.ResourceTypeNetworkInterface)
630+
}
631+
627632
for _, r := range resources {
628633
spec := &ec2.TagSpecification{ResourceType: aws.String(r)}
629634

0 commit comments

Comments
 (0)