---
title: "How to create an AWS S3 bucket for Postgres backups"
description: "Part 1 of a series on automating nightly Postgres backups from many Neon projects to S3 via scheduled GitHub Actions covers the AWS setup."
url: "https://swe.quest/articles/how-to-create-an-aws-s3-bucket-for-postgres-backups-1b827136764e94f1"
canonical: "https://neon.com/blog/how-to-create-an-aws-s3-bucket-for-postgres-backups"
source: "Neon"
published: "2024-10-28"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["cloud","identity-auth","postgres","ci-cd","multi-tenancy"]
---

# How to create an AWS S3 bucket for Postgres backups

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-10-28, 4 min read, How-to. Original: [https://neon.com/blog/how-to-create-an-aws-s3-bucket-for-postgres-backups](https://neon.com/blog/how-to-create-an-aws-s3-bucket-for-postgres-backups)

## Summary

Part 1 of a series on automating nightly Postgres backups from many Neon projects to S3 via scheduled GitHub Actions covers the AWS setup. It registers GitHub's OIDC identity provider (token.actions.githubusercontent.com, audience sts.amazonaws.com), creates a web-identity IAM role scoped to a specific repository, and creates a general-purpose S3 bucket. A bucket policy then grants that role List, Get, Put and Delete access. Bucket region matters, since distance from the databases lengthens backup jobs, and the account ID, bucket name and role name should be stored as GitHub Secrets for part 2.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)

## Prerequisites

- AWS IAM basics ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- GitHub Actions basics ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

AWS S3, AWS IAM, OpenID Connect, GitHub Actions, Neon

## Related posts

- [How to Set Up Nightly Backups to AWS S3 for Multiple Neon Projects](https://swe.quest/articles/how-to-set-up-nightly-backups-to-aws-s3-for-multiple-neon-projects-8546de66a0aa7f01.md): Neon · 2024-10-29 · Medium · 7 min read · PostgreSQL, CI/CD, Cloud platforms, Databases
  Nightly backups of multiple Neon Postgres databases can be automated with one GitHub Actions workflow per database.
- [Automated PostgreSQL Backups](https://swe.quest/articles/automated-postgresql-backups-be869b2aa09ef3bf.md): Railway · 2022-09-02 · Medium · 4 min read · PostgreSQL, Cloud platforms, Storage systems
  A deployable Node.js template automates PostgreSQL backups on Railway by running a cron job that uploads compressed dumps to an S3 bucket.
- [Neon Twin: Move Dev/Test/Staging to Neon, Keep Production on RDS](https://swe.quest/articles/neon-twin-move-dev-test-staging-to-neon-keep-production-on-rds-a26cd19df36ac332.md): Neon · 2024-07-24 · Medium · 7 min read · PostgreSQL, CI/CD, Databases
  A Neon Twin is a nightly-synced copy of an RDS Postgres production database kept in Neon for dev, test and staging, so teams get instant provisioning, branching and scale-to-zero without migrating production.
- [Add files to your branches](https://swe.quest/articles/add-files-to-your-branches-c605b42373f4bac8.md): Neon · 2026-11-23 · Medium · 6 min read · Storage systems, Serverless, PostgreSQL, Cloud platforms
  Neon Object Storage is an S3-compatible store whose buckets belong to database branches: child branches inherit buckets and objects via the same copy-on-write model as Neon Postgres, so previews get isolated, unbilled-until-diverged copies of production files.
- [Recreating S3 in Postgres using PostgREST](https://swe.quest/articles/recreating-s3-in-postgres-using-postgrest-d07b4a06448dac82.md): Neon · 2025-05-27 · Medium · 7 min read · PostgreSQL, API design, Identity & auth, SQL
  A simple S3-like file server can be built inside Postgres by storing binary data in a BYTEA table and exposing it through PostgREST's functions-as-RPC via the Neon Data API.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
