Skip to content

feat(ebs-volume): add standalone persistent EBS data volume component - #20

Merged
opariffazman merged 1 commit into
mainfrom
feat/ebs-volume-component
Jun 30, 2026
Merged

opariffazman merged 1 commit into
mainfrom
feat/ebs-volume-component

Conversation

@opariffazman

Copy link
Copy Markdown
Contributor

Summary

New AWS ebs-volume component: standalone, encrypted EBS data volumes in their own state, decoupled
from the ec2 instance lifecycle so an environment can destroy/apply its compute while the data
survives. Closes #17.

Component(s)

ebs-volume (new) · ci · docs

Type

  • Added — new component or feature (MINOR)

Changes

  • ebs-volume/terraform — volumes map + for_each; per-entry availability_zone (required,
    AZ-locked), size_gb (20), type (gp3), optional iops/throughput, final_snapshot
    (default false). encrypted hardcoded true. RFC1035 key validation. aws ~> 6.0.
  • Output volumes → { volume_id, arn, availability_zone, name }; name (<env>-<key>) is the
    Name tag the consuming instance self-attaches by.
  • Attachment stays env-owned — the env's user_data finds the volume by Name tag and
    attaches/formats/mounts it, with an ec2:AttachVolume/… grant composed via iam-policy and fed
    through ec2's existing iam_role_policy_arns. No ec2 change.
  • Destroy safety is the env's job — Terragrunt prevent_destroy is the hard guard; the module's
    final_snapshot (default false) is an opt-in recovery net, baking in no policy.
  • Registered in the CI matrix, root README components table, and CHANGELOG [Unreleased] → Added.

Out of scope (deliberate): the vpc azs output for cleaner consumer AZ wiring is split into #19;
snapshot_id / kms_key_id deferred (YAGNI).

Validation

  • terraform fmt / validate / tflint pass on the changed component (the gate)
  • CHANGELOG.md [Unreleased] updated
  • Component README / root README updated (new component)

A new AWS component that creates standalone, encrypted EBS data volumes in
their own state, decoupled from the ec2 instance lifecycle — so an environment
can destroy/apply its ec2 compute while the data on these volumes survives.

- volumes map + for_each: per-entry availability_zone (required, AZ-locked),
  size_gb (20), type (gp3), optional iops/throughput, final_snapshot (default
  false). encrypted hardcoded true. RFC1035 key validation.
- Output volumes -> { volume_id, arn, availability_zone, name }; name is the
  Name tag the instance self-attaches by.
- Attachment stays env-owned (self-attach by Name tag in user_data + a scoped
  iam-policy grant through ec2's existing iam_role_policy_arns) — no ec2 change.
- Destroy safety is the env's job (Terragrunt prevent_destroy); final_snapshot
  is an opt-in recovery net.

Registered in the CI matrix, root README, and CHANGELOG. Closes #17.
The vpc azs output for cleaner consumer AZ wiring is tracked separately in #19.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@opariffazman
opariffazman requested a review from Lexxick as a code owner June 30, 2026 00:42
@github-actions

Copy link
Copy Markdown

📝 Changelog preview (draft)

Generated from Conventional Commits. Curate into CHANGELOG.md → ## [Unreleased] — trim noise, keep consumer-facing changes.

[Unreleased]

Added

  • ebs-volume: Add standalone persistent EBS data volume component
  • automation-roles: Allow CI role to manage scoped iam policies
  • iam-policy: Add generic IAM policy factory component

Fixed

  • release: Annotate the vX.Y.Z tag so tagging survives tag.gpgsign

@opariffazman
opariffazman merged commit b3c7bea into main Jun 30, 2026
12 checks passed
@opariffazman
opariffazman deleted the feat/ebs-volume-component branch June 30, 2026 00:49
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.

[change] ebs-volume: new component — persistent, instance-independent EBS data volume

1 participant