Setup Guide
Prerequisites
Section titled “Prerequisites”- Python 3.11+
- An AWS account with Bedrock access (Claude 3.5 Haiku)
- A Microsoft 365 tenant with Teams
- The
chukfiCLI binary compiled and on PATH - A PostgreSQL database for the Chukfi CMS
Step 1: Enable Amazon Bedrock
Section titled “Step 1: Enable Amazon Bedrock”Request Claude 3.5 Haiku Access
Section titled “Request Claude 3.5 Haiku Access”- Go to the AWS Bedrock console
- In the left sidebar, click Model access
- Click Manage model access
- Find Claude 3.5 Haiku by Anthropic and request access
- Wait for approval (usually instant for Haiku)
Configure AWS Credentials
Section titled “Configure AWS Credentials”The bot uses the standard AWS credential chain (env vars, ~/.aws/credentials, or IAM role):
export AWS_REGION=us-east-1export AWS_ACCESS_KEY_ID=AKIA...export AWS_SECRET_ACCESS_KEY=...For production on ECS, attach an IAM role with the BedrockRuntimeAccess policy.
Verify Bedrock Access
Section titled “Verify Bedrock Access”aws bedrock-runtime converse \ --model-id anthropic.claude-3-5-haiku-20241022-v1:0 \ --messages '[{"role":"user","content":[{"text":"Hello"}]}]'Step 2: Set Up the Teams Outgoing Webhook
Section titled “Step 2: Set Up the Teams Outgoing Webhook”- Open Microsoft Teams
- Go to your team → Apps → Outgoing Webhook
- Configure:
- Name:
Chukfi CMS Bot - Callback URL:
https://your-server.com/api/webhook - Description:
AI-powered content management
- Name:
- Click Create
- Copy the HMAC secret — you’ll need it for the environment config
Step 3: Configure the Bot
Section titled “Step 3: Configure the Bot”Clone and Install
Section titled “Clone and Install”git clone https://github.com/smattera/chukfi-teams-bot.gitcd chukfi-teams-botpython -m venv .venvsource .venv/bin/activatepip install -r requirements.txtEnvironment Variables
Section titled “Environment Variables”Copy the example config and fill in your values:
cp .env.example .env| Variable | Required | Description |
|---|---|---|
AWS_REGION |
Yes | AWS region for Bedrock (default: us-east-1) |
BEDROCK_MODEL_ID |
No | Bedrock model ID (default: anthropic.claude-3-5-haiku-20241022-v1:0) |
TEAMS_WEBHOOK_SECRET |
Yes | HMAC secret from Teams Outgoing Webhook |
CHUKFI_BIN |
No | Path to chukfi binary (default: found on PATH) |
CHUKFI_CONFIG |
No | Path to chukfi.config.json (default: ./chukfi.config.json) |
DATABASE_URL |
Yes | PostgreSQL connection string |
LOG_LEVEL |
No | Logging level (default: INFO) |
Update Tenant IDs
Section titled “Update Tenant IDs”Edit config.py to set your actual Entra Tenant UUIDs:
ALLOWED_TENANTS: ClassVar[set[str]] = { "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", # Your tenant UUID}Step 4: Run the Bot
Section titled “Step 4: Run the Bot”Development Mode
Section titled “Development Mode”# Disable HMAC auth for local testingTEAMS_WEBHOOK_SECRET="" uvicorn main:app --reload --port 8000Production Mode
Section titled “Production Mode”uvicorn main:app --host 0.0.0.0 --port 8000Test with curl
Section titled “Test with curl”curl -X POST http://localhost:8000/api/webhook \ -H "Content-Type: application/json" \Step 5: Deploy
Section titled “Step 5: Deploy”Docker
Section titled “Docker”# Build the image (from the repo root)docker build -t chukfi-teams-bot -f chukfi-teams-bot/Dockerfile .
# Run with env filedocker run -p 8000:8000 --env-file .env chukfi-teams-botECS Fargate (Recommended)
Section titled “ECS Fargate (Recommended)”- Push the Docker image to Amazon ECR
- Create an ECS task definition with the image
- Set environment variables in the task definition or AWS Secrets Manager
- Attach an IAM task role with Bedrock runtime access
- Deploy behind an Application Load Balancer
- Point your domain’s DNS at the ALB
Cloud VM
Section titled “Cloud VM”Any Linux VM works. The bot is lightweight — 0.25 vCPU / 512 MB is sufficient.
Step 6: Test in Teams
Section titled “Step 6: Test in Teams”- Go to your team channel in Microsoft Teams
- Type
@Chukfi CMS Bot create a blog post about fall health tips - The bot should respond with a confirmation and the entry ID
- Check the admin UI — the entry should appear in draft status
- Review and publish via the admin interface