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
- Batch create Application Inference Profiles from a yaml file
- Batch tag existing Application Inference Profiles from a yaml file
- 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)
┌─────────────────────────────────────────────────────────────────┐
│ Installation & Setup │
│ 1. Install dependencies │
│ 2. Configure AWS credentials │
└────────────────────────┬────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Choose Your Approach │
└─────────────┬───────────────────────────────────┬───────────────┘
│ │
▼ ▼
┌─────────────────────────────┐ ┌─────────────────────────────┐
│ Interactive Mode │ │ Batch Mode │
│ (Single Profile) │ │ (Multiple Profiles) │
└──────────┬──────────────────┘ └──────────┬──────────────────┘
│ │
│ ▼
│ ┌─────────────────────────────┐
│ │ Generate YAML Template │
│ │ bedrock_batch_create_ │
│ │ profiles.py │
│ └──────────┬──────────────────┘
│ │
│ ▼
│ ┌─────────────────────────────┐
│ │ Review & Modify YAML │
│ │ - Update profile names │
│ │ - Adjust tags │
│ │ - Add existing profiles │
│ └──────────┬──────────────────┘
│ │
│ ▼
│ ┌─────────────────────────────┐
│ │ Batch Create Profiles │
│ │ -f ./bedrock-profiles.yaml │
│ └──────────┬──────────────────┘
│ │
└─────────────┬───────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Optional: Tag Existing Profiles │
│ -t ./bedrock-profiles.yaml │
└────────────────────────┬────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Manage Profiles │
│ - List profiles (-l) │
│ - Delete profiles │
│ - Export to CSV (automatic) │
└─────────────────────────────────────────────────────────────────┘
- 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.txtWhen 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.pyThe 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
Generate a YAML template file with available models and inference profiles:
python3 bedrock_batch_create_profiles.pyThe tool will:
- Prompt you to select AWS profile and region
- Ask for a filter keyword (e.g.,
claude,titan,llama,mistral) - List matching Foundation Models and System-Defined Inference Profiles
- Generate a timestamped YAML file (e.g.,
claude-bedrock-profiles-20260115011234567.yaml)
Important: Before using the generated YAML file, you must:
- Review and modify profile names (especially for inference profiles that have "CHANGE ME-" prefix)
- Adjust tags as needed
- Optionally add existing profiles to tag under
existing-profiles-to-tagsection
Run the tool in batch creation mode:
python3 bedrock_inference_profile_management_tool.py -f ./bedrock-profiles.yamlRun the tool in batch tagging mode:
python3 bedrock_inference_profile_management_tool.py -t ./bedrock-profiles.yamlTo list and manage existing profiles:
python bedrock_inference_profile_management_tool.py -lThis 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
Verify that tags have been applied to your inference profile:
aws bedrock list-tags-for-resource \
--resource-arn arn:aws:bedrock:us-west-2:123456789:application-inference-profile/aaabbbccc \
--region us-west-2Example output:
{
"tags": [
{
"key": "map-migrated",
"value": "mig123Bedrock"
},
{
"key": "Environment",
"value": "Development"
}
]
}Monitor invocations to verify the profile is being used successfully:
aws cloudwatch get-metric-statistics \
--namespace AWS/Bedrock \
--metric-name Invocations \
--dimensions Name=ModelId,Value=aaabbbccc \
--start-time 2026-01-14T02:25:00Z \
--end-time 2026-01-14T02:35:00Z \
--period 300 \
--statistics Sum \
--region us-west-2Example output:
{
"Label": "Invocations",
"Datapoints": [
{
"Timestamp": "2026-01-14T02:30:00+00:00",
"Sum": 1.0,
"Unit": "Count"
}
]
}Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.