Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agent-blueprint/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ NEXT_PUBLIC_AWS_REGION=us-west-2
# If false, the app will be publicly accessible without authentication
ENABLE_COGNITO=true

PROJECT_NAME=strands-agent-chatbot

# AWS Cognito settings (set automatically during deployment)
COGNITO_USER_POOL_ID=us-west-2_XXXXXXXXX
COGNITO_USER_POOL_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (enableCognito) {
const chatbotStack = new ChatbotStack(app, 'ChatbotStack', {
env,
...cognitoProps,
projectName: 'strands-agent-chatbot',
projectName: process.env.PROJECT_NAME || 'strands-agent-chatbot',
environment: 'dev',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if [ -f "$ENV_FILE" ]; then
echo " - ENABLE_COGNITO: ${ENABLE_COGNITO:-true}"
echo " - CORS_ORIGINS: ${CORS_ORIGINS:-not set}"
echo " - ALLOWED_IP_RANGES: ${ALLOWED_IP_RANGES:-not set}"
echo " - PROJECT_NAME: ${PROJECT_NAME}"
else
echo "No .env file found at $ENV_FILE, using environment defaults"
fi
Expand Down Expand Up @@ -46,8 +47,8 @@ echo "Deploying to AWS Account: $ACCOUNT_ID in region: $AWS_REGION"

# Check if DynamoDB tables already exist
echo "🔍 Checking for existing DynamoDB tables..."
USERS_TABLE_EXISTS=$(aws dynamodb describe-table --table-name strands-agent-chatbot-users --region $AWS_REGION 2>/dev/null && echo "true" || echo "false")
SESSIONS_TABLE_EXISTS=$(aws dynamodb describe-table --table-name strands-agent-chatbot-sessions --region $AWS_REGION 2>/dev/null && echo "true" || echo "false")
USERS_TABLE_EXISTS=$(aws dynamodb describe-table --table-name "${PROJECT_NAME}-users" --region $AWS_REGION 2>/dev/null && echo "true" || echo "false")
SESSIONS_TABLE_EXISTS=$(aws dynamodb describe-table --table-name "${PROJECT_NAME}-sessions" --region $AWS_REGION 2>/dev/null && echo "true" || echo "false")

if [ "$USERS_TABLE_EXISTS" = "true" ] && [ "$SESSIONS_TABLE_EXISTS" = "true" ]; then
echo "✅ Existing DynamoDB tables found - will import them"
Expand Down
28 changes: 15 additions & 13 deletions agent-blueprint/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e
# Strands Agent Chatbot - Main Deployment Orchestrator
# Routes to specific deployment scripts

# AWS Profile support
# Usage: PROFILE=myprofile ./deploy.sh

export PROJECT_NAME="strands-agent-chatbot"

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
Expand Down Expand Up @@ -165,7 +170,7 @@ deploy_agentcore_runtime() {
echo ""

NOVA_SECRET_EXISTS=$(aws secretsmanager describe-secret \
--secret-id "strands-agent-chatbot/nova-act-api-key" \
--secret-id "${PROJECT_NAME}/nova-act-api-key" \
--query 'Name' \
--output text \
--region "$AWS_REGION" 2>/dev/null || echo "")
Expand All @@ -181,12 +186,12 @@ deploy_agentcore_runtime() {
if [ -n "$NOVA_ACT_KEY" ]; then
log_step "Setting Nova Act API Key in Secrets Manager..."
aws secretsmanager create-secret \
--name "strands-agent-chatbot/nova-act-api-key" \
--name "${PROJECT_NAME}/nova-act-api-key" \
--secret-string "$NOVA_ACT_KEY" \
--description "Nova Act API Key for browser automation" \
--region "$AWS_REGION" > /dev/null 2>&1 || \
aws secretsmanager put-secret-value \
--secret-id "strands-agent-chatbot/nova-act-api-key" \
--secret-id "${PROJECT_NAME}/nova-act-api-key" \
--secret-string "$NOVA_ACT_KEY" \
--region "$AWS_REGION" > /dev/null 2>&1
log_info "Nova Act API Key configured"
Expand All @@ -211,7 +216,7 @@ deploy_agentcore_runtime() {
npm run build

# Check if ECR repository already exists
if aws ecr describe-repositories --repository-names strands-agent-chatbot-agent-core --region $AWS_REGION &> /dev/null; then
if aws ecr describe-repositories --repository-names "${PROJECT_NAME}-agent-core" --region $AWS_REGION &> /dev/null; then
log_info "ECR repository already exists, importing..."
export USE_EXISTING_ECR=true
else
Expand Down Expand Up @@ -325,7 +330,6 @@ deploy_mcp_servers() {

# Export AWS region for the deployment script
export AWS_REGION
export PROJECT_NAME="strands-agent-chatbot"
export ENVIRONMENT="dev"

# Run deployment
Expand All @@ -337,7 +341,7 @@ deploy_mcp_servers() {
log_step "Verifying deployment..."

GATEWAY_URL=$(aws ssm get-parameter \
--name "/strands-agent-chatbot/dev/mcp/gateway-url" \
--name "/${PROJECT_NAME}/dev/mcp/gateway-url" \
--query 'Parameter.Value' \
--output text \
--region $AWS_REGION 2>/dev/null || echo "")
Expand Down Expand Up @@ -446,7 +450,6 @@ deploy_research_agent() {

# Export environment variables for the deployment script
export AWS_REGION
export PROJECT_NAME="strands-agent-chatbot"
export ENVIRONMENT="dev"

# Run deployment
Expand Down Expand Up @@ -480,11 +483,10 @@ deploy_browser_use_agent() {

# Export environment variables for the deployment script
export AWS_REGION
export PROJECT_NAME="strands-agent-chatbot"
export ENVIRONMENT="dev"

# Check if ECR repository already exists
if aws ecr describe-repositories --repository-names strands-agent-chatbot-browser-use-agent --region $AWS_REGION &> /dev/null; then
if aws ecr describe-repositories --repository-names "${PROJECT_NAME}-browser-use-agent" --region $AWS_REGION &> /dev/null; then
log_info "ECR repository already exists, importing..."
export USE_EXISTING_ECR=true
else
Expand All @@ -500,7 +502,7 @@ deploy_browser_use_agent() {
log_step "Verifying deployment..."

RUNTIME_ARN=$(aws ssm get-parameter \
--name "/strands-agent-chatbot/dev/a2a/browser-use-agent-runtime-arn" \
--name "/${PROJECT_NAME}/dev/a2a/browser-use-agent-runtime-arn" \
--query 'Parameter.Value' \
--output text \
--region $AWS_REGION 2>/dev/null || echo "")
Expand Down Expand Up @@ -617,20 +619,20 @@ display_deployment_summary() {

# Get Gateway URL
GATEWAY_URL=$(aws ssm get-parameter \
--name "/strands-agent-chatbot/dev/mcp/gateway-url" \
--name "/${PROJECT_NAME}/dev/mcp/gateway-url" \
--query 'Parameter.Value' \
--output text \
--region $AWS_REGION 2>/dev/null || echo "Not available")

# Get A2A Runtime ARNs
RESEARCH_AGENT_ARN=$(aws ssm get-parameter \
--name "/strands-agent-chatbot/dev/a2a/research-agent-runtime-arn" \
--name "/${PROJECT_NAME}/dev/a2a/research-agent-runtime-arn" \
--query 'Parameter.Value' \
--output text \
--region $AWS_REGION 2>/dev/null || echo "Not deployed")

BROWSER_AGENT_ARN=$(aws ssm get-parameter \
--name "/strands-agent-chatbot/dev/a2a/browser-use-agent-runtime-arn" \
--name "/${PROJECT_NAME}/dev/a2a/browser-use-agent-runtime-arn" \
--query 'Parameter.Value' \
--output text \
--region $AWS_REGION 2>/dev/null || echo "Not deployed")
Expand Down