Skip to content

docs: document IAM permissions plan capture/deadlocks need on Aurora/RDS - #2698

Merged
erikdarlingdata merged 1 commit into
devfrom
docs/pg-iam-permissions
Aug 30, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
docs/pg-iam-permissions

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

What

pg_plan_capture and pg_deadlocks both failed on an entire Aurora fleet today because the monitoring host's IAM role had zero RDS permissions — and this requirement was documented nowhere except the collectors' own runtime error messages. Adding it to docs/postgres-first-target-runbook.md so the next person (or the next fleet) doesn't have to re-derive it from source under time pressure.

Changes

  • New subsection under step 1 (IAM, for the two collectors that read the server log): explains why this is a different identity axis from the DB-level pg_monitor grant, gives the exact IAM policy statement (rds:DescribeDBClusters, rds:DescribeDBLogFiles, rds:DownloadDBLogFilePortion), and clarifies self-managed Postgres doesn't need it at all (verified directly against DarlingWorker's dispatch table — both collectors correctly fall back to the SQL-side pg_read_file() path for non-Aurora/non-RDS targets).
  • New row in the step 10 failure-modes table for the specific denied-IAM-action error shape, matching the existing table's format.

Docs-only change, no code touched.

🤖 Generated with Claude Code

…ora/RDS

Today's incident: pg_plan_capture and pg_deadlocks both failed on the entire
Aurora fleet because the monitoring host's IAM role had zero RDS permissions.
Neither collector's requirement (rds:DescribeDBClusters, rds:DescribeDBLogFiles,
rds:DownloadDBLogFilePortion — reading the server log through the RDS control
plane, since Aurora/RDS exposes no local log directory) was documented anywhere
outside the collectors' own runtime error messages. Adds an IAM subsection under
step 1 and a failure-modes table row so the next person recognizes this
immediately instead of re-deriving it from source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown

Reviewed. This is a docs-only change (no code touched), so the correctness/security/performance/parity checklist mostly doesn't apply — but I verified the factual claims against the actual Darling source since a runbook with a wrong IAM policy is worse than no runbook:

  • IAM actions match code: RdsLogSource.cs calls exactly DescribeDBClustersAsync (to resolve the Aurora writer), DescribeDBLogFilesAsync, and DownloadDBLogFilePortionAsync — matching the three actions in the new policy JSON.
  • Dispatch/fallback claim verified: DarlingWorker.cs's collector dispatch table routes pg_plan_capture and pg_deadlocks through the RDS log API only when Target.IsAurora || Target.IsAwsRds; everything else (including self-managed Postgres) falls through to the pg_read_file() route. Confirms the doc's claim that self-managed doesn't need this IAM grant.
  • Error-shape claim verified: RdsLogUnavailableException.IsAuthorizationRefusal matches AWS's "is not authorized to perform: rds:..." / "no identity-based policy allows" / AccessDenied message shapes, and the catch in DarlingWorker.cs (~line 4643) logs status PERMISSIONS with the raw AWS message (which names the action and the IAM role ARN) prefixed onto an explanation. Matches the new step 10 table row.
  • Lite/Darling parity: not applicable — Lite is SQL-Server-only and has no PostgreSQL/RDS code path, so there's no counterpart to keep in sync.

No issues found. The doc's IAM policy example uses wildcard resource ARNs (cluster:*, db:*) rather than a specific instance/cluster ARN — reasonable for a generic runbook example, not a correctness problem.

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