mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Iam roles anywhere docs (#18559)
* Add documentation for IAM Roles Anywhere Co-authored-by: krrishdholakia <krrishdholakia@gmail.com> * Refactor Bedrock provider docs for IAM Roles Anywhere Co-authored-by: krrishdholakia <krrishdholakia@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
parent
bdd05475bc
commit
969790c463
1 changed files with 47 additions and 0 deletions
|
|
@ -2208,6 +2208,53 @@ response = completion(
|
|||
| `aws_role_name` | `RoleArn` | The Amazon Resource Name (ARN) of the role to assume | [AssumeRole API](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.assume_role) |
|
||||
| `aws_session_name` | `RoleSessionName` | An identifier for the assumed role session | [AssumeRole API](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.assume_role) |
|
||||
|
||||
### IAM Roles Anywhere (On-Premise / External Workloads)
|
||||
|
||||
[IAM Roles Anywhere](https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html) extends IAM roles to workloads **outside of AWS** (on-premise servers, edge devices, other clouds). It uses the same STS mechanism as regular IAM roles but authenticates via X.509 certificates instead of AWS credentials.
|
||||
|
||||
**Setup**: Configure the [AWS Signing Helper](https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html) as a credential process in `~/.aws/config`:
|
||||
|
||||
```ini
|
||||
[profile litellm-roles-anywhere]
|
||||
credential_process = aws_signing_helper credential-process \
|
||||
--certificate /path/to/certificate.pem \
|
||||
--private-key /path/to/private-key.pem \
|
||||
--trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/abc123 \
|
||||
--profile-arn arn:aws:rolesanywhere:us-east-1:123456789012:profile/def456 \
|
||||
--role-arn arn:aws:iam::123456789012:role/MyBedrockRole
|
||||
```
|
||||
|
||||
**Usage**: Reference the profile in LiteLLM:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="sdk" label="SDK">
|
||||
|
||||
```python
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="bedrock/anthropic.claude-3-sonnet-20240229-v1:0",
|
||||
messages=[{"role": "user", "content": "Hello!"}],
|
||||
aws_profile_name="litellm-roles-anywhere",
|
||||
)
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="proxy" label="PROXY">
|
||||
|
||||
```yaml
|
||||
model_list:
|
||||
- model_name: bedrock-claude
|
||||
litellm_params:
|
||||
model: bedrock/anthropic.claude-3-sonnet-20240229-v1:0
|
||||
aws_profile_name: "litellm-roles-anywhere"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
See the [IAM Roles Anywhere Getting Started Guide](https://docs.aws.amazon.com/rolesanywhere/latest/userguide/getting-started.html) for trust anchor and profile setup.
|
||||
|
||||
|
||||
|
||||
Make the bedrock completion call
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue