Skip to content

docs: AWS Bedrock cost attribution with STS session tags cookbook - #1055

Open
naresh4dev wants to merge 5 commits into
mainfrom
cookbook/aws-sts-session-tags
Open

docs: AWS Bedrock cost attribution with STS session tags cookbook#1055
naresh4dev wants to merge 5 commits into
mainfrom
cookbook/aws-sts-session-tags

Conversation

@naresh4dev

Copy link
Copy Markdown
Member

Summary

  • Adds a comprehensive cookbook (guides/use-cases/aws-bedrock-cost-attribution-with-sts-session-tags.mdx) covering end-to-end setup for forwarding Portkey metadata as AWS STS session tags during Bedrock AssumeRole calls
  • Updates the existing assumed-role doc (product/model-catalog/connect-bedrock-with-amazon-assumed-role.mdx) with minimum gateway version, clearer IAM guidance, updated model name, and cross-link to the new cookbook
  • Adds the new page to both "Use Cases" nav sections in docs.json

Cookbook covers:

  1. How it works — architecture diagram of metadata → STS tags → Bedrock → CUR 2.0 flow
  2. Step 1: Gateway configAWS_BEDROCK_STS_SESSION_TAGS_ENABLED=true with ECS, K8s, Docker Compose examples
  3. Step 2: AWS IAM setup — caller policy + target trust policy (with cross-account notes)
  4. Step 3: Send metadata — Python, JS SDK, and cURL examples
  5. Step 4: CloudTrail verification — CLI command and expected output
  6. Step 5: Cost Explorer — tag activation and viewing
  7. Tag constraints — sanitisation table (50 tags, 128/256 char limits, aws: prefix)
  8. Credential caching — how different tag sets produce different cache keys
  9. Troubleshooting — AccessDenied, missing tags, Cost Explorer lag, upgrade failures, role chaining

Context

Addresses the customer-reported issue where STS session tags were not being forwarded. The feature requires gateway ≥ 2.19.0 with the AWS_BEDROCK_STS_SESSION_TAGS_ENABLED flag. This cookbook provides the missing configuration documentation that was requested.

Related gateway PR: https://github.com/Portkey-AI/gateway-enterprise-node/pull/1868

Test plan

  • Verify cookbook renders correctly on Mintlify preview
  • Confirm all internal links resolve (assumed-role doc ↔ cookbook cross-links)
  • Verify nav entry appears under Cookbooks → Use Cases in both version tabs

…tags

Add a comprehensive guide covering end-to-end setup for forwarding
Portkey metadata as AWS STS session tags during Bedrock AssumeRole calls.
Covers gateway configuration, IAM permissions (caller + target trust
policy), SDK/cURL examples, CloudTrail verification, Cost Explorer
activation, tag sanitisation constraints, credential caching, and
troubleshooting common errors.

Also updates the existing assumed-role doc with minimum gateway version,
clearer IAM guidance, and a cross-link to the new cookbook.
@mintlify

mintlify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
portkey-docs 🟢 Ready View Preview Sep 2, 2026, 6:32 PM

- Replace real AWS account IDs and role names in the troubleshooting
  error example with generic placeholders
- Expand the Credential Caching section with: cache key composition
  table, TTL details, cache backend (Redis vs in-memory), when new
  AssumeRole calls happen, STS call volume estimation formula, and
  a note about throttling for high-cardinality metadata
Comment thread guides/use-cases/aws-bedrock-cost-attribution-with-sts-session-tags.mdx Outdated
Remove the raw cache key format string (internal implementation detail)
while keeping the parameter table and 'not in cache key' clarification
that are useful for users.
Replace the box-drawing character diagram with a Mermaid sequenceDiagram
that Mintlify renders natively with interactive zoom/pan controls.
- Move IAM permission setup (caller policy + trust policy) to Step 1
- Move gateway env flag enablement to Step 2 with a warning to
  complete IAM setup first to avoid AccessDenied on all requests
- Add enterprise self-hosted note at the top
- Update all step references in troubleshooting section

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The detailed gateway-version, caching, IAM, and AWS billing claims require human validation against the linked implementation and AWS behavior.

Pull request overview

Adds an Enterprise self-hosted cookbook for attributing Amazon Bedrock costs by forwarding Portkey metadata as AWS STS session tags.

Changes:

  • Documents IAM, gateway, request, CloudTrail, and Cost Explorer setup.
  • Explains tag sanitization, credential caching, and troubleshooting.
  • Links the assumed-role guide and registers the cookbook in both navigation sections.
File summaries
File Description
product/model-catalog/connect-bedrock-with-amazon-assumed-role.mdx Adds version/IAM requirements and cookbook link.
guides/use-cases/aws-bedrock-cost-attribution-with-sts-session-tags.mdx Adds the end-to-end cost-attribution cookbook.
docs.json Adds the cookbook to both Use Cases navigation lists.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants