The Simplest Way to Make AWS Backup and Drone Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using aws backup and drone together lets your team save cloud data before deploys. Drone runs your build steps while AWS Backup saves copies of your databases and disks. This workflow keeps production changes safe. A pipeline triggers a snapshot before any database change runs. If the update fails, the team restores the saved state right away. You do not need manual steps before pushing new code. How aws backup and drone share permissions and data Drone runs build steps inside isolated conta

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Using aws backup and drone together lets your team save cloud data before deploys. Drone runs your build steps while AWS Backup saves copies of your databases and disks.

This workflow keeps production changes safe. A pipeline triggers a snapshot before any database change runs. If the update fails, the team restores the saved state right away. You do not need manual steps before pushing new code.

How aws backup and drone share permissions and data

Drone runs build steps inside isolated containers. Each step needs permission to talk to your cloud account. The best method uses temporary role assumption instead of static keys. Your runner requests a short session from the cloud provider.

Once logged in, the runner sends a start call to the backup service. The backup service takes over and copies the target volume or database. Drone does not hold the actual snapshot data. The data stays inside your cloud storage vault at all times.

The pipeline only reads job status IDs from the cloud API. Your build step polls the job ID until the snapshot finishes. When the status shows complete, Drone moves to the next deploy step. If the snapshot fails, Drone stops the pipeline right there.

Common failure modes and how to scope roles

Many teams make mistakes when they set up these two tools. The most common error is putting long-lived admin keys in shared pipeline secrets. If a build log leaks, an attacker gets full control over your cloud. Shared service accounts also make audit logs hard to read.

You cannot tell which pipeline or developer started a snapshot job. Another big risk is giving the build runner permission to delete vaults. A bad script in a pull request could wipe out your recovery points.

AWS IAM Policies + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, give each repo its own cloud role. Scope that role so it can only start backup jobs and read status. Never let the pipeline role delete recovery points or change vault lock rules. Also, restrict which target resources the role can back up using resource tags.

Network paths between your runner and the cloud API need tight rules too. Run your build agents inside a private subnet with strict outbound rules. Use private cloud endpoints so traffic never crosses the public internet. Log every API call from the runner to track who triggered each backup.

Testing recovery points inside your build pipeline

Taking a snapshot is only half of the safety work. Your team also needs to know that saved copies work when needed. You can use a scheduled pipeline to test recovery points every week. The runner asks the cloud service to restore a snapshot into a test zone.

Once the test database comes online, the pipeline runs basic health checks. It checks that tables exist and recent rows match expectations. If the test passes, the runner deletes the temporary test resource. This habit proves your backup setup works before a real outage hits.

When test scripts query restored data, you must protect sensitive fields. Masking rewrites matched fields like emails, phone numbers, card numbers, or national IDs in results. This keeps real user details out of your build logs during recovery tests.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should Drone wait for the backup job to finish before deploying?

Yes, for critical database schema changes, the pipeline should wait for completion. This ensures you have a clean recovery point before any destructive step runs. For small app code changes, you can trigger the job and move on.

How do we stop pull requests from triggering production backups?

Scope your pipeline rules so backup steps only run on merges to main. You should also tie the cloud role trust policy to the main branch. This stops untrusted branch builds from calling your production cloud account.

Where should we store the cloud role settings for the runner?

Keep role identifiers in your repo config or scoped pipeline variables. Never store static secret keys in plain text inside your repo files. Use runner identity tokens to trade for short cloud sessions at runtime.

The query runs. The emails stay hidden.