Script icon
Docker icon
Pause icon
If icon
AwsCLI icon
Log icon
Webhook icon

Restore a Deleted S3 Object with Approval and Content Verification

Restore a deleted S3 object from an explicit version after approval, preserve version history, reject live-key replacement, and verify content with SHA256.

Categories
Infrastructure

Recover one accidentally deleted object by uploading a snapshot of an explicitly selected version onto its original key. A new current version preserves history, including the delete marker.

How it works

  1. Inspect enabled versioning and the current delete marker. Snapshot the selected data version (maximum 32 MiB) in execution storage, hash it, and save a plan.
  2. Pause for up to one hour. The operator reviews the plan and explicitly approves; the default is refusal.
  3. Recheck the delete marker. AWS CLI uploads the approved snapshot using If-None-Match: *, refusing a concurrent live object.
  4. Download the new version, compare SHA256 and size, and verify it is current before saving a receipt.

What you get

  • A reviewable plan and a verified receipt with source, marker and restored version IDs.
  • No delete operations. Changed markers, live objects and expired approvals stop recovery.

Who it's for

Platform and data teams recovering small configuration files or manifests after accidental deletion.

Why orchestrate this with Kestra

Kestra persists the evidence across a human approval pause and sequences revalidation, conditional repair and verification in one execution.

Prerequisites

Docker runners, a versioning-enabled general-purpose bucket and AWS CLI 2.38.2. Compatible endpoints must enforce conditional PutObject. Quiesce writers and lifecycle deletion during recovery. Execution storage retains the source snapshot; use appropriate access and retention policies. Content headers and user metadata are retained; historical tags, ACLs, retention and encryption settings are not restored. Bucket defaults govern the new version. Archived or SSE-C sources are outside this example.

Secrets

  • AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY: scoped credentials for GetBucketVersioning, ListBucket, GetObject, GetObjectVersion and PutObject. KMS sources also need KMS permissions.
  • S3_RECOVERY_WEBHOOK_KEY: random private webhook URL key. Restrict who can resume executions and reach this endpoint.

Quick start

  1. Configure secrets. Import the flow without the catalog-only extend block.
  2. Execute with an exact bucket, key and data version ID; leave endpoint empty for AWS.
  3. Review inspect's plan artifact. Resume with restore: true only for the intended bytes; download the receipt.
  4. Optionally POST JSON with bucket, key and version_id to the keyed webhook; it still requires approval.

How to extend

Notify an incident channel at the pause, or add a separate retention-aware recovery process for larger objects.

Links

Orchestrate with Kestra
Orchestrate AWS with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.