Skip to content

feat: expose configurable EBS IOPS and throughput, default to gp3 baseline#39

Merged
leonardosul merged 1 commit into
mainfrom
worktree-default-mbps-iops
Apr 29, 2026
Merged

feat: expose configurable EBS IOPS and throughput, default to gp3 baseline#39
leonardosul merged 1 commit into
mainfrom
worktree-default-mbps-iops

Conversation

@leonardosul
Copy link
Copy Markdown
Contributor

Summary

  • Add block_device_iops (default 3000) and block_device_throughput (default 125) variables, dropping the hardcoded 250 MB/s throughput down to the gp3 baseline that's included at no extra cost.
  • Hash both new inputs into CONFIG_VERSION so a change to either triggers automatic replacement of running NAT instances on the next reconcile (same path as AMI / instance-type changes).
  • Regenerate README.md and docs/reference.md via terraform-docs.

Replacement behavior

When an operator lowers throughput from 250125 (or any other tuning), CONFIG_VERSION (lambda.tf:103) changes. On the next reconcile event, isCurrentConfig() (cmd/lambda/ec2ops.go:309) sees the running NAT's ConfigVersion tag mismatch the Lambda's env var and handler.go:136 terminates the stale instance; the termination event drives creation of a fresh NAT from the updated launch template. Replacement happens on the next event, not the moment terraform apply finishes.

The existing Phase 4: NATAMIUpgrade integration test (tests/integration/nat_zero_test.go:365) already exercises this exact replacement mechanism via AMI change — adding a separate IOPS/throughput test would be duplicate coverage.

Test plan

  • terraform fmt / terraform validate / tflint pass
  • terraform-docs-go regenerated README.md and docs/reference.md
  • All pre-commit hooks pass
  • Integration test run on a real AWS account (covered by existing AMI-upgrade phase, but a dedicated run after merge would confirm baseline values produce a working NAT)

🤖 Generated with Claude Code

…eline

Add block_device_iops and block_device_throughput variables so operators
can tune root-volume performance. Defaults are 3000 IOPS and 125 MB/s —
the gp3 baseline included at no extra cost. Previously throughput was
hardcoded to 250 MB/s, charging operators for capacity NAT instances do
not need.

Both new variables are added to CONFIG_VERSION so changes trigger
automatic NAT replacement: the Lambda detects the version mismatch on
its next reconcile and terminates the stale instance, and the new
launch template is used when the replacement is created.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@leonardosul leonardosul added the integration-test Triggers integration tests label Apr 29, 2026
@github-actions github-actions Bot removed the integration-test Triggers integration tests label Apr 29, 2026
@leonardosul leonardosul merged commit b6c75c9 into main Apr 29, 2026
8 checks passed
@leonardosul leonardosul deleted the worktree-default-mbps-iops branch April 29, 2026 01:47
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