AWS Bedrock enterprise features
PREREQUISITES
Python 3.8+AWS CLI configured with appropriate IAM permissionsboto3 installed (pip install boto3)AWS Bedrock access enabled in your AWS account
Setup
To use AWS Bedrock enterprise features, ensure you have AWS CLI configured with credentials that have Bedrock access permissions. Install boto3 for Python SDK interaction.
Install boto3:
pip install boto3 Collecting boto3 Downloading boto3-1.26.0-py3-none-any.whl (132 kB) Installing collected packages: boto3 Successfully installed boto3-1.26.0
Step by step
This example demonstrates how to list available foundation models and describe enterprise features like private model access and usage monitoring using AWS Bedrock's Python SDK.
import os
import boto3
# Initialize Bedrock client
client = boto3.client('bedrock', region_name='us-east-1')
# List available foundation models
response = client.list_foundation_models()
print('Available foundation models:')
for model in response.get('foundationModels', []):
print(f"- {model['modelName']} (Provider: {model['providerName']})")
# Example: Describe enterprise features (mocked as Bedrock API does not expose direct enterprise feature calls)
# In practice, enterprise features include private model endpoints, VPC integration, and audit logging
print('\nEnterprise features include:')
print('- Secure private model access via VPC endpoints')
print('- Compliance and governance with AWS CloudTrail integration')
print('- Usage monitoring and cost controls via AWS CloudWatch')
print('- Seamless integration with AWS IAM for access management') Available foundation models: - anthropic.claude-3-5-sonnet-20241022 (Provider: Anthropic) - amazon.titan-text-express-v1 (Provider: Amazon) - meta.llama3-1-70b-instruct-v1 (Provider: Meta) Enterprise features include: - Secure private model access via VPC endpoints - Compliance and governance with AWS CloudTrail integration - Usage monitoring and cost controls via AWS CloudWatch - Seamless integration with AWS IAM for access management
Common variations
You can use AWS Bedrock with asynchronous calls via aiobotocore or integrate Bedrock models with AWS Lambda for serverless AI inference. Enterprise deployments often leverage VPC endpoints for private network access and CloudWatch for detailed monitoring.
import asyncio
import aiobotocore
async def list_models_async():
session = aiobotocore.get_session()
async with session.create_client('bedrock', region_name='us-east-1') as client:
response = await client.list_foundation_models()
print('Async available foundation models:')
for model in response.get('foundationModels', []):
print(f"- {model['modelName']} (Provider: {model['providerName']})")
asyncio.run(list_models_async()) Async available foundation models: - anthropic.claude-3-5-sonnet-20241022 (Provider: Anthropic) - amazon.titan-text-express-v1 (Provider: Amazon) - meta.llama3-1-70b-instruct-v1 (Provider: Meta)
Troubleshooting
If you encounter AccessDeniedException, verify your IAM permissions include bedrock:ListFoundationModels and other Bedrock actions. For network errors, ensure your VPC endpoints are correctly configured for private Bedrock access. Check AWS CloudTrail logs for audit and compliance troubleshooting.
Key Takeaways
- Use AWS Bedrock for secure, scalable access to foundation models with enterprise-grade compliance.
- Leverage VPC endpoints and IAM integration for private and controlled model usage.
- Monitor usage and costs via AWS CloudWatch and audit with CloudTrail for governance.
- AWS Bedrock supports multiple foundation model providers under one unified API.
- Async SDK usage and serverless integration enable flexible enterprise AI deployments.