Skip to content

Commit 95ab2e2

Browse files
committed
Fix assume role
1 parent 09c21dc commit 95ab2e2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

services/chatbot/src/chatbot/chat_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ def _validate_provider_env(provider: str) -> str | None:
4343
if provider == "bedrock":
4444
if not os.environ.get("AWS_REGION"):
4545
return "Missing AWS_REGION"
46-
if not Config.AWS_BEARER_TOKEN_BEDROCK:
46+
# Allow: bearer token, static credentials, or assume role (uses instance profile)
47+
if not Config.AWS_BEARER_TOKEN_BEDROCK and not Config.AWS_ASSUME_ROLE_ARN:
4748
if not os.environ.get("AWS_ACCESS_KEY_ID") or not os.environ.get(
4849
"AWS_SECRET_ACCESS_KEY"
4950
):
50-
return "Missing AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or AWS_BEARER_TOKEN_BEDROCK"
51+
return "Missing AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, AWS_ASSUME_ROLE_ARN, or AWS_BEARER_TOKEN_BEDROCK"
5152
return None
5253
if provider == "vertex":
5354
# GOOGLE_APPLICATION_CREDENTIALS is optional if running in GCP with ADC

0 commit comments

Comments
 (0)