Skip to content

feat: configurable EBS root volume encryption#14

Merged
leonardosul merged 2 commits intomainfrom
feat/configurable-ebs-encryption
Mar 3, 2026
Merged

feat: configurable EBS root volume encryption#14
leonardosul merged 2 commits intomainfrom
feat/configurable-ebs-encryption

Conversation

@leonardosul
Copy link
Contributor

Summary

  • Adds encrypt_root_volume variable (default true) so users can disable root EBS encryption for faster cold starts
  • Encrypted gp3 adds ~11s to EC2 pending state vs ~5s unencrypted — the NAT instance is a stateless packet forwarder with no sensitive data on the root volume
  • Wired into launch template, CONFIG_VERSION hash, test fixture, and docs

Benchmark plan

The test fixture defaults to encrypt_root_volume = false in this PR so the integration test runs with encryption disabled. The timing summary now logs encryption state, making it easy to compare against previous runs (which all used encrypted volumes).

Key phases to compare:

Phase What it measures
Wait for NAT running with EIP Cold-start: includes EC2 pending time (encryption impact)
Wait for NAT restarted with EIP Restart from stopped: volume already exists (no impact expected)
Wait for workload egress IP End-to-end connectivity latency
Workload-measured connectivity latency In-guest boot-to-internet time

Merge criteria: only merge if cold-start timing shows meaningful improvement (~5-6s faster) with no regression on restart or connectivity.

After merging, reset the fixture default back to true so future test runs use the secure default.

Test plan

  • Integration test passes with encrypt_root_volume = false
  • Timing summary shows "EBS Encryption: disabled"
  • Cold-start phase (Wait for NAT running with EIP) is ~5-6s faster than baseline (~60-70s → ~55-65s)
  • Restart phase shows no regression
  • terraform validate passes at root and fixture
  • go vet ./... passes

🤖 Generated with Claude Code

Add `encrypt_root_volume` variable (default: true) so users who prioritize
boot speed over root volume encryption can opt out. Encrypted gp3 volumes
add ~6s to EC2 pending state vs unencrypted. The NAT instance is a stateless
packet forwarder with no sensitive data on the root volume.

- Wire variable into launch template and CONFIG_VERSION hash
- Test fixture defaults to false to benchmark unencrypted boot
- Timing summary now logs encryption state for comparison across runs
- Add performance docs section and "Faster Cold Start" example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leonardosul leonardosul added the integration-test Triggers integration tests label Mar 2, 2026
…aims

- Remove false DLQ claim from README (no SQS DLQ exists; Lambda retries
  via EventBridge with maximum_retry_attempts=2)
- Fix testing.md: phases 1-3 are EventBridge-driven, not direct Lambda
  invocations
- Remove unverified "Root Volume Encryption" performance section and
  "Faster Cold Start" example (benchmark showed no measurable difference)
- Update ConfigVersion hash descriptions to include encryption setting
- Strip performance claim from encrypt_root_volume variable description
- Reset test fixture default back to encrypted (true)
- Regenerate terraform-docs in README and reference.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leonardosul leonardosul merged commit 4663b8c into main Mar 3, 2026
1 check passed
@leonardosul leonardosul deleted the feat/configurable-ebs-encryption branch March 3, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-test Triggers integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant