Skip to content

Commit 696e557

Browse files
committed
use us-west-2 everywhere
1 parent c91328b commit 696e557

3 files changed

Lines changed: 139 additions & 3 deletions

File tree

.mcp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"command": "uvx",
1313
"args": ["awslabs.aws-api-mcp-server@latest"],
1414
"env": {
15-
"AWS_REGION": "us-east-1"
15+
"AWS_REGION": "us-west-2"
1616
}
1717
},
1818
"awslabs.cfn-mcp-server": {
1919
"command": "uvx",
2020
"args": ["awslabs.cfn-mcp-server@latest"],
2121
"env": {
22-
"AWS_REGION": "us-east-1"
22+
"AWS_REGION": "us-west-2"
2323
}
2424
},
2525
"awslabs.aws-iac-mcp-server": {

deploy-scenarios.sh

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#!/usr/bin/env bash
2+
# Deploy NDX:Try AWS Scenarios to the current AWS account
3+
# Usage: ./deploy-scenarios.sh [scenario-name]
4+
# - No arguments: deploy all scenarios
5+
# - With argument: deploy only the specified scenario
6+
# Examples:
7+
# ./deploy-scenarios.sh # Deploy all
8+
# ./deploy-scenarios.sh quicksight-dashboard # Deploy only quicksight
9+
10+
set -e
11+
12+
REGION="us-west-2"
13+
ALL_SCENARIOS=("text-to-speech" "council-chatbot" "foi-redaction" "planning-ai" "smart-car-park" "quicksight-dashboard")
14+
15+
# Check if a specific scenario was requested
16+
if [ -n "$1" ]; then
17+
# Validate the scenario name
18+
VALID=false
19+
for s in "${ALL_SCENARIOS[@]}"; do
20+
if [ "$s" == "$1" ]; then
21+
VALID=true
22+
break
23+
fi
24+
done
25+
26+
if [ "$VALID" = false ]; then
27+
echo "Error: Invalid scenario '$1'"
28+
echo "Valid scenarios: ${ALL_SCENARIOS[*]}"
29+
exit 1
30+
fi
31+
32+
SCENARIOS=("$1")
33+
echo "Deploying single scenario: $1"
34+
else
35+
SCENARIOS=("${ALL_SCENARIOS[@]}")
36+
echo "Deploying all scenarios"
37+
fi
38+
39+
# Get current AWS account
40+
ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
41+
echo "AWS Account: $ACCOUNT_ID"
42+
echo "Region: $REGION"
43+
echo ""
44+
45+
# Create S3 bucket for large templates if needed
46+
DEPLOY_BUCKET="ndx-try-deploy-${ACCOUNT_ID}-${REGION}"
47+
echo "Creating deployment bucket: $DEPLOY_BUCKET"
48+
aws s3 mb "s3://${DEPLOY_BUCKET}" --region "$REGION" 2>/dev/null || echo "Bucket already exists or created"
49+
echo ""
50+
51+
# Deploy each scenario
52+
for scenario in "${SCENARIOS[@]}"; do
53+
echo "=========================================="
54+
echo "Deploying: $scenario"
55+
echo "=========================================="
56+
57+
# Build parameter overrides
58+
PARAMS="Environment=sandbox AutoCleanupHours=24"
59+
60+
# Special handling for quicksight-dashboard - needs subscription first
61+
if [ "$scenario" == "quicksight-dashboard" ]; then
62+
echo "Step 1: Deploying QuickSight subscription..."
63+
aws cloudformation deploy \
64+
--template-file "cloudformation/scenarios/quicksight-dashboard/subscription-template.yaml" \
65+
--stack-name "ndx-try-quicksight-subscription" \
66+
--region "$REGION" \
67+
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \
68+
--s3-bucket "$DEPLOY_BUCKET" \
69+
--no-fail-on-empty-changeset \
70+
2>&1 || { echo "Warning: QuickSight subscription deployment had issues"; continue; }
71+
72+
echo ""
73+
echo "Step 2: Deploying QuickSight dashboard (no user permissions needed)..."
74+
fi
75+
76+
aws cloudformation deploy \
77+
--template-file "cloudformation/scenarios/${scenario}/template.yaml" \
78+
--stack-name "ndx-try-${scenario}" \
79+
--region "$REGION" \
80+
--parameter-overrides $PARAMS \
81+
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
82+
--s3-bucket "$DEPLOY_BUCKET" \
83+
--no-fail-on-empty-changeset \
84+
2>&1 || echo "Warning: ${scenario} deployment had issues"
85+
86+
echo ""
87+
done
88+
89+
echo ""
90+
echo "=========================================="
91+
echo "DEPLOYMENT COMPLETE - ENDPOINT TABLE"
92+
echo "=========================================="
93+
echo ""
94+
echo "| Scenario | API Endpoint | Status |"
95+
echo "|----------|--------------|--------|"
96+
97+
# Map scenarios to their output key names
98+
declare -A OUTPUT_KEYS=(
99+
["text-to-speech"]="ConvertURL"
100+
["council-chatbot"]="ChatbotURL"
101+
["foi-redaction"]="RedactionURL"
102+
["planning-ai"]="AnalyzerURL"
103+
["smart-car-park"]="AvailabilityAPI"
104+
["quicksight-dashboard"]="DashboardUrl"
105+
)
106+
107+
for scenario in "${SCENARIOS[@]}"; do
108+
STACK_NAME="ndx-try-${scenario}"
109+
OUTPUT_KEY="${OUTPUT_KEYS[$scenario]}"
110+
111+
# Get stack status
112+
STATUS=$(aws cloudformation describe-stacks \
113+
--stack-name "$STACK_NAME" \
114+
--region "$REGION" \
115+
--query "Stacks[0].StackStatus" \
116+
--output text 2>/dev/null || echo "NOT_FOUND")
117+
118+
# Get API endpoint using the correct output key
119+
ENDPOINT=$(aws cloudformation describe-stacks \
120+
--stack-name "$STACK_NAME" \
121+
--region "$REGION" \
122+
--query "Stacks[0].Outputs[?OutputKey=='${OUTPUT_KEY}'].OutputValue" \
123+
--output text 2>/dev/null || echo "N/A")
124+
125+
# Handle empty endpoint
126+
if [ -z "$ENDPOINT" ] || [ "$ENDPOINT" == "None" ]; then
127+
ENDPOINT="N/A"
128+
fi
129+
130+
echo "| ${scenario} | ${ENDPOINT} | ${STATUS} |"
131+
done
132+
133+
echo ""
134+
echo "Account: $ACCOUNT_ID"
135+
echo "Region: $REGION"
136+
echo "Deployed: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"

eleventy.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default function(eleventyConfig) {
130130
}
131131

132132
const deployment = scenario.deployment;
133-
const region = deployment.region || 'eu-west-2';
133+
const region = deployment.region || 'us-west-2';
134134
const templateUrl = deployment.templateUrl || deployment.templateS3Url;
135135

136136
if (!templateUrl) {

0 commit comments

Comments
 (0)