Skip to content

fix(tailscale-exit-nodes): lock AWS firewall after instance is running#80

Merged
bendwyer merged 1 commit into
mainfrom
aws-lock-firewall-after-ready
Jun 29, 2026
Merged

fix(tailscale-exit-nodes): lock AWS firewall after instance is running#80
bendwyer merged 1 commit into
mainfrom
aws-lock-firewall-after-ready

Conversation

@bendwyer

Copy link
Copy Markdown
Owner

Problem

The provision saga called PutInstancePublicPorts immediately after CreateInstances, while the Lightsail instance was still in the pending transition state. Lightsail rejects port changes during transition (InvalidResourceState), so the AWS firewall-lock step failed and the instance never reached active.

Fix

Move the AWS firewall lock to after the readiness poll, which already waits for the instance to reach running. PutInstancePublicPorts then targets a settled instance. Vultr is unaffected (its firewall group is applied at create time).

The instance still joins the tailnet during boot (via DERP) under the default firewall; the lock-down to UDP 41641 applies once it is running.

Test

The existing AWS happy-path saga test mocks the instance as running and does not assert call order, so it continues to pass. The suite gates the Docker build in CI.

🤖 Generated with Claude Code

Lightsail rejects PutInstancePublicPorts while an instance is still in the
pending transition state (InvalidResourceState). The provision saga locked
the firewall immediately after create, before the instance had settled. Move
the lock to after the readiness poll, which already waits for the instance to
reach running, so the port change targets a settled instance. Vultr is
unaffected (its firewall group is applied at create time).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bendwyer bendwyer merged commit 9857f8f into main Jun 29, 2026
5 checks passed
@bendwyer bendwyer deleted the aws-lock-firewall-after-ready branch June 29, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant