Skip to content

Commit 985f354

Browse files
leonardosulclaude
andcommitted
docs: clarify getPublicENI function purpose
Add doc comment explaining that device index 0 is the primary ENI where Elastic IPs are attached for NAT instances. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 276eef1 commit 985f354

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/lambda/ec2ops.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ func (h *Handler) releaseEIPs(ctx context.Context, eips []ec2types.Address) {
293293

294294
// --- ENI helper ---
295295

296+
// getPublicENI returns the primary network interface (device index 0).
297+
// For NAT instances launched via our templates, this is the public-facing ENI
298+
// where the Elastic IP should be attached.
296299
func getPublicENI(inst *Instance) *ec2types.InstanceNetworkInterface {
297300
for i := range inst.NetworkInterfaces {
298301
if aws.ToInt32(inst.NetworkInterfaces[i].Attachment.DeviceIndex) == 0 {

0 commit comments

Comments
 (0)