mirror of
https://github.com/awslabs/amazon-bedrock-agentcore-samples.git
synced 2025-09-08 20:50:46 +00:00
115 lines
3.6 KiB
Markdown
115 lines
3.6 KiB
Markdown
|
# Configuration
|
||
|
|
||
|
## Environment Variables
|
||
|
|
||
|
The SRE Agent uses environment variables for sensitive configuration values. Create a `.env` file in the `sre_agent/` directory with the following required variables:
|
||
|
|
||
|
```bash
|
||
|
# Required: API key for Claude model access
|
||
|
# For Anthropic direct access:
|
||
|
ANTHROPIC_API_KEY=sk-ant-api-key-here
|
||
|
|
||
|
# For Amazon Bedrock access:
|
||
|
AWS_DEFAULT_REGION=us-east-1
|
||
|
AWS_PROFILE=your-profile-name # Or use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
|
||
|
|
||
|
# Required: AgentCore Gateway authentication
|
||
|
GATEWAY_ACCESS_TOKEN=your-gateway-token-here # Generated by gateway setup
|
||
|
|
||
|
# Optional: Debugging and logging
|
||
|
LOG_LEVEL=INFO # Options: DEBUG, INFO, WARNING, ERROR
|
||
|
DEBUG=false # Enable debug mode for verbose output
|
||
|
```
|
||
|
|
||
|
**Note**: The SRE Agent looks for the `.env` file in the `sre_agent/` directory, not the project root. This allows for modular configuration management.
|
||
|
|
||
|
## Agent Configuration
|
||
|
|
||
|
The agent behavior is configured through `sre_agent/config/agent_config.yaml`. This file defines the mapping between agents and their available tools, as well as LLM parameters:
|
||
|
|
||
|
```yaml
|
||
|
# Agent to tool mapping
|
||
|
agents:
|
||
|
kubernetes_agent:
|
||
|
name: "Kubernetes Infrastructure Agent"
|
||
|
description: "Specializes in Kubernetes operations and troubleshooting"
|
||
|
tools:
|
||
|
- get_pod_status
|
||
|
- get_deployment_status
|
||
|
- get_cluster_events
|
||
|
- get_resource_usage
|
||
|
- get_node_status
|
||
|
|
||
|
logs_agent:
|
||
|
name: "Application Logs Agent"
|
||
|
description: "Expert in log analysis and pattern detection"
|
||
|
tools:
|
||
|
- search_logs
|
||
|
- get_error_logs
|
||
|
- analyze_log_patterns
|
||
|
- get_recent_logs
|
||
|
- count_log_events
|
||
|
|
||
|
metrics_agent:
|
||
|
name: "Performance Metrics Agent"
|
||
|
description: "Analyzes performance metrics and trends"
|
||
|
tools:
|
||
|
- get_performance_metrics
|
||
|
- get_error_rates
|
||
|
- get_resource_metrics
|
||
|
- get_availability_metrics
|
||
|
- analyze_trends
|
||
|
|
||
|
runbooks_agent:
|
||
|
name: "Operational Runbooks Agent"
|
||
|
description: "Provides operational procedures and guides"
|
||
|
tools:
|
||
|
- search_runbooks
|
||
|
- get_incident_playbook
|
||
|
- get_troubleshooting_guide
|
||
|
- get_escalation_procedures
|
||
|
- get_common_resolutions
|
||
|
|
||
|
# Global tools available to all agents
|
||
|
global_tools:
|
||
|
- x-amz-bedrock-agentcore-search # AgentCore search tool
|
||
|
|
||
|
# Gateway configuration
|
||
|
gateway:
|
||
|
uri: "https://your-gateway-url.com" # Updated during setup
|
||
|
```
|
||
|
|
||
|
## Gateway Configuration
|
||
|
|
||
|
The AgentCore Gateway is configured through `gateway/config.yaml`. This configuration is managed by the setup scripts but can be customized:
|
||
|
|
||
|
```yaml
|
||
|
# AgentCore Gateway Configuration Template
|
||
|
# Copy this file to config.yaml and update with your environment-specific settings
|
||
|
|
||
|
# AWS Configuration
|
||
|
account_id: "YOUR_ACCOUNT_ID"
|
||
|
region: "us-east-1"
|
||
|
role_name: "YOUR_ROLE_NAME"
|
||
|
endpoint_url: "https://bedrock-agentcore-control.us-east-1.amazonaws.com"
|
||
|
credential_provider_endpoint_url: "https://us-east-1.prod.agent-credential-provider.cognito.aws.dev"
|
||
|
|
||
|
# Cognito Configuration
|
||
|
user_pool_id: "YOUR_USER_POOL_ID"
|
||
|
client_id: "YOUR_CLIENT_ID"
|
||
|
|
||
|
# S3 Configuration
|
||
|
s3_bucket: "your-agentcore-schemas-bucket"
|
||
|
s3_path_prefix: "devops-multiagent-demo" # Path prefix for OpenAPI schema files
|
||
|
|
||
|
# Provider Configuration
|
||
|
# This ARN is automatically generated by create_gateway.sh when it runs create_credentials_provider.py
|
||
|
provider_arn: "arn:aws:bedrock-agentcore:REGION:ACCOUNT_ID:token-vault/default/apikeycredentialprovider/YOUR_PROVIDER_NAME"
|
||
|
|
||
|
# Gateway Configuration
|
||
|
gateway_name: "MyAgentCoreGateway"
|
||
|
gateway_description: "AgentCore Gateway for API Integration"
|
||
|
|
||
|
# Target Configuration
|
||
|
target_description: "S3 target for OpenAPI schema"
|
||
|
```
|