Skip to content

feat(terraform): add volume backup exclusion resource (EON-7912)#71

Open
atlowChemi wants to merge 2 commits intomainfrom
chemi/EON-7912-exclude-ec2-volumes
Open

feat(terraform): add volume backup exclusion resource (EON-7912)#71
atlowChemi wants to merge 2 commits intomainfrom
chemi/EON-7912-exclude-ec2-volumes

Conversation

@atlowChemi
Copy link
Copy Markdown
Member

@atlowChemi atlowChemi commented Apr 5, 2026

Summary

Companion PR to eon-io/eon-service#28165. Adds a new eon_volume_backup_exclusion Terraform resource that allows excluding specific EBS volumes from future EC2 instance backups.

  • Client layer: Two new direct-HTTP methods (ExcludeVolumeFromBackup, CancelVolumeBackupExclusion) calling PATCH /v1/projects/{projectId}/resources/{id}/volumes/{volumeId}/exclude and .../include. Uses raw HTTP (same pattern as StartBigQueryDatasetRestore) because the SDK doesn't have these endpoints yet.
  • Resource: eon_volume_backup_exclusion — create excludes, destroy re-includes. Both attributes (resource_id, volume_id) require replacement on change. Supports import via resource_id/volume_id format.
  • Read is a no-op: There is no GET endpoint to check exclusion status, so Read just persists state. No drift detection.
  • Docs: Auto-generated via go generate ./... using terraform-plugin-docs.

Review & Testing Checklist for Human

  • Verify API paths match eon-service PR: Confirm the URLs (/resources/{id}/volumes/{volumeId}/exclude and /include) match the OpenAPI spec in eon-service#28165 exactly — a mismatch here would cause silent 404s at runtime.
  • Accept the no-op Read: The resource cannot detect drift — if a volume is re-included outside Terraform, state won't update. Decide if this is acceptable or if a read-back mechanism is needed.
  • Accept import without validation: ImportState sets state without calling any API. An import of a non-existent or non-excluded volume will succeed silently.
  • Decide if unit tests are needed: No unit tests were added for the new resource or client methods. Other resources in this repo have mock-based tests.

Suggested test plan: After the eon-service PR is merged, apply the resource against a real EC2 instance with multiple volumes, verify the non-root volume becomes excluded, then terraform destroy and verify it's re-included.

Notes

  • The golangci-lint config needs a version field for golangci-lint v2 — this is a pre-existing issue, not introduced by this PR. go vet and go test both pass cleanly.
  • Mock client stubs always return nil (no error tracking), consistent with existing mock patterns.

Link to Devin session: https://eon.devinenterprise.com/sessions/0a6eebe354004283bfc89ebb9daee533
Requested by: @atlowChemi

@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@atlowChemi atlowChemi marked this pull request as ready for review April 5, 2026 16:54
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