bedrock-ops
Operate a Bedrock Knowledge Base + S3 RAG data pipeline with guardrails. S3 sync with force-upload for content-only changes, KB ingestion polling, cost monitoring, and automatic MFA session refresh — all mediated by an identity-checking safety layer.
Install with your preferred package manager.
gh skill install oharu121/skills bedrock-opsnpx skills add oharu121/skills/bedrock-opspnpm dlx skills add oharu121/skills/bedrock-opsWhat it does
Section titled “What it does”Running a Bedrock KB in production means daily S3 uploads, ingestion runs, and the occasional “who am I logged in as?” moment. This skill wraps those operations in a safety layer: every write verifies your STS identity matches the configured account, every sync runs dry-run first, destructive flags are blocked unless you explicitly opt in, and MFA sessions auto-refresh via a TOTP secret stored outside of version control.
The operational commands you’d reach for — s3 sync, s3 cp, bedrock-agent start-ingestion-job, ce get-cost-and-usage — all route through aws_safe.py, which enforces the same rules regardless of what you ran. You describe what you want in natural language, and Claude Code picks the right subcommand.
The skill also handles a subtle pitfall: s3 sync skips files where only content changed if byte count is the same (common when you re-chunk markdown with different anchors). A dedicated force-upload intent uses s3 cp --recursive instead, so the KB sees the new content.
When to use it
Section titled “When to use it”- You run a Bedrock RAG pipeline and want consistent safety rails across all S3/KB operations
- You’re tired of re-entering MFA codes — TOTP auto-refresh handles it
- You need to poll ingestion jobs without writing another 15-second sleep loop
- You share the KB across multiple team members and want an identity mismatch to fail loudly
How it works
Section titled “How it works”-
First-time setup. Run
uv run python setup_project.py <profile> [s3-bucket]— it lists available AWS profiles and generatesaws-project.json. Drop your MFA serial and TOTP secret intoaws-project.local.json(gitignored). -
Session verify.
/bedrock-ops verifyrunssts get-caller-identityand checks it against the configured account ID. If the session is expired, TOTP auto-refresh regenerates it silently. -
Dry-run any write. S3 syncs and copies always dry-run first. You see what would change, then pass
--executeto make it real. The confirmation banner shows profile, account, command, and mode. -
Poll ingestions.
/bedrock-ops kb sync <kb-id>auto-detects the data source ID, starts the ingestion, then polls every 15 seconds untilCOMPLETEorFAILED, printing elapsed time. -
Force-upload for content-only changes. When chunk anchors change but file sizes don’t, sync skips them.
/bedrock-ops s3 force-uploadusess3 cp --recursiveto push every file.
Example
Section titled “Example”You’ve updated the markdown docs feeding a Bedrock KB — added chunk anchors without changing file sizes.
/bedrock-ops s3 force-upload ./docs s3://my-rag-bucket/docs/The skill confirms identity, shows a dry-run diff, prompts for --execute, uploads every file, then you run:
/bedrock-ops kb sync kb-abc123It starts the ingestion and polls until done, printing COMPLETE in 3m 42s when finished.
Safety rules (always on)
Section titled “Safety rules (always on)”- Identity check — STS caller must match
account_idinaws-project.json - Explicit profile — every command uses
--profilefrom config; env vars ignored - Dry-run first —
s3 sync/cp/mvrequire explicit--execute - No silent deletes —
--deleteblocked unless--i-understand-this-deletesis passed - Service blocklist —
iamandorganizationsdenied by default - Confirmation banner — profile, account, command, and mode shown before any write
- Session auto-refresh — expired sessions re-issue via TOTP from
aws-project.local.json
Related skills
Section titled “Related skills”Source
Section titled “Source”View SKILL.md on GitHub — full command matrix, aws-project.json schema, and aws_safe.py implementation.