You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(bedrock): add AWS SigV4 and STS web identity authentication
The Bedrock inference provider previously required a pre-signed bearer
token (AWS_BEARER_TOKEN_BEDROCK). This PR adds full AWS credential chain
support so Bedrock works natively in EKS/IRSA, GitHub Actions OIDC,
EC2, ECS, and Lambda without managing long-lived credentials.
When no api_key is configured, requests are signed using AWS SigV4 via
botocore. STS role assumption and web identity federation are supported
through RefreshableBotoSession, which refreshes credentials
automatically. Bearer token mode is unchanged — if api_key is set in
config or passed via x-llamastack-provider-data, it takes precedence.
Also corrects the endpoint URL from bedrock-mantle to
bedrock-runtime.<region>.amazonaws.com/openai/v1, and gates the
bedrock model in ci-tests on AWS_DEFAULT_REGION (works for both
bearer and SigV4 modes) instead of AWS_BEARER_TOKEN_BEDROCK.
Closes#4730
Signed-off-by: skamenan7 <skamenan@redhat.com>
|`network.timeout.connect`|`float \| None`| No || Connection timeout in seconds. |
35
35
|`network.timeout.read`|`float \| None`| No || Read timeout in seconds. |
36
36
|`network.headers`|`dict[str, str] \| None`| No || Additional HTTP headers to include in all requests. |
37
-
|`region_name`|`str`| No | us-east-2 | AWS Region for the Bedrock Runtime endpoint |
37
+
|`aws_access_key_id`|`SecretStr \| None`| No || The AWS access key to use. Default use environment variable: AWS_ACCESS_KEY_ID |
38
+
|`aws_secret_access_key`|`SecretStr \| None`| No || The AWS secret access key to use. Default use environment variable: AWS_SECRET_ACCESS_KEY |
39
+
|`aws_session_token`|`SecretStr \| None`| No || The AWS session token to use. Default use environment variable: AWS_SESSION_TOKEN |
40
+
|`aws_role_arn`|`str \| None`| No || The AWS role ARN to assume. Default use environment variable: AWS_ROLE_ARN |
41
+
|`aws_web_identity_token_file`|`str \| None`| No || The path to the web identity token file. Default use environment variable: AWS_WEB_IDENTITY_TOKEN_FILE |
42
+
|`aws_role_session_name`|`str \| None`| No || The session name to use when assuming a role. Default use environment variable: AWS_ROLE_SESSION_NAME |
43
+
|`region_name`|`str \| None`| No | us-east-2 | AWS Region for the Bedrock Runtime endpoint |
44
+
|`profile_name`|`str \| None`| No || The profile name that contains credentials to use.Default use environment variable: AWS_PROFILE |
45
+
|`total_max_attempts`|`int \| None`| No || An integer representing the maximum number of attempts that will be made for a single request, including the initial attempt. Default use environment variable: AWS_MAX_ATTEMPTS |
46
+
|`retry_mode`|`str \| None`| No || A string representing the type of retries Boto3 will perform.Default use environment variable: AWS_RETRY_MODE |
47
+
|`connect_timeout`|`float \| None`| No | 60.0 | The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds. |
48
+
|`read_timeout`|`float \| None`| No | 60.0 | The time in seconds till a timeout exception is thrown when attempting to read from a connection.The default is 60 seconds. |
49
+
|`session_ttl`|`int \| None`| No | 3600 | The time in seconds till a session expires. The default is 3600 seconds (1 hour). |
Copy file name to clipboardExpand all lines: docs/docs/providers/safety/remote_bedrock.mdx
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,9 @@ AWS Bedrock safety provider for content moderation using AWS's safety services.
36
36
|`aws_access_key_id`|`SecretStr \| None`| No || The AWS access key to use. Default use environment variable: AWS_ACCESS_KEY_ID |
37
37
|`aws_secret_access_key`|`SecretStr \| None`| No || The AWS secret access key to use. Default use environment variable: AWS_SECRET_ACCESS_KEY |
38
38
|`aws_session_token`|`SecretStr \| None`| No || The AWS session token to use. Default use environment variable: AWS_SESSION_TOKEN |
39
+
|`aws_role_arn`|`str \| None`| No || The AWS role ARN to assume. Default use environment variable: AWS_ROLE_ARN |
40
+
|`aws_web_identity_token_file`|`str \| None`| No || The path to the web identity token file. Default use environment variable: AWS_WEB_IDENTITY_TOKEN_FILE |
41
+
|`aws_role_session_name`|`str \| None`| No || The session name to use when assuming a role. Default use environment variable: AWS_ROLE_SESSION_NAME |
39
42
|`region_name`|`str \| None`| No || The default AWS Region to use, for example, us-west-1 or us-west-2.Default use environment variable: AWS_DEFAULT_REGION |
40
43
|`profile_name`|`str \| None`| No || The profile name that contains credentials to use.Default use environment variable: AWS_PROFILE |
41
44
|`total_max_attempts`|`int \| None`| No || An integer representing the maximum number of attempts that will be made for a single request, including the initial attempt. Default use environment variable: AWS_MAX_ATTEMPTS |
0 commit comments