This tool provides a comprehensive solution for managing AWS Bedrock Application Inference Profiles. It allows you to create, list, and manage application inference profiles for Foundation Models or Cross-region Inference Profiles. The tool includes tagging capabilities and provides an interactive command line interface for easy management.
- Create Application Inference Profiles with:
- Foundation Model support
- Cross-region Inference Profile support
- Created profiles are exported to CSV automatically
- Tag management for inference profiles
- List existing Application inference profiles
- Delete existing profiles
- Interactive command-line interface
- Only support On-Demand Models, do not support Provisioned Models.
- Python 3.9 and above
- AWS Account with appropriate permissions
- AWS credentials configured (either through AWS CLI profiles or access keys)
- Clone the repository:
git clone <repository-url>
cd sample-bedrock-inference-profile-mgmt-tool
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
When using the Application Inference Profile, ensure you have the following IAM permissions (replace <region>
and <account_id>
with your values):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel*"],
"Resource": [
"arn:aws:bedrock:<region>:<account_id>:inference-profile/*",
"arn:aws:bedrock:<region>::foundation-model/*"
]
}
]
}
Run the tool in interactive creation mode:
python bedrock_inference_profile_management_tool.py
The tool will guide you through:
- AWS credential configuration (profile selection or manual input)
- Tag configuration
- Profile creation with options for:
- Foundation Models
- Cross-region Inference Profiles
To list and manage existing profiles:
python bedrock_inference_profile_management_tool.py -l
This command will:
- Display all existing Application inference profiles
- Allow you to delete selected profiles
- Show profile details including:
- Profile Name
- Region
- Model ID
- Status
- ARN
- Associated Tags
The tool automatically exports profile information to CSV files with timestamps for record-keeping. The CSV includes:
- Profile Name
- Profile ARN
- Associated Tags
- The tool includes comprehensive error handling for common scenarios
- Provides clear error messages and retry options
- Validates inputs to prevent invalid operations
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.