📋 Overview: This guide provides three deployment options for the Quip Exporter:
  • Method 1: AWS deployment with CloudFormation (CLI) - Full control, production-ready
  • Method 2: AWS deployment with MCP Server (Kiro IDE) - Simplified AWS deployment
  • Method 3: Local Python script execution (no AWS required) - Quick & simple
🚀 Quick Start Recommendation: New users should start with Method 3 (Local Script) to test the exporter before deploying to AWS. It's the fastest way to get started!

📋 Prerequisites

Required Tools & Access

  • AWS Account with appropriate permissions (CloudFormation, Lambda, S3, DynamoDB, API Gateway, IAM, Amplify)
  • AWS CLI installed and configured (aws configure)
  • Git for cloning the repository
  • Python 3.9+ for building Lambda packages
  • (Optional) Kiro IDE with AWS MCP Server configured

Verify AWS CLI Configuration

# Check AWS credentials
aws sts get-caller-identity

# Expected output:
# {
#     "UserId": "...",
#     "Account": "123456789012",
#     "Arn": "arn:aws:iam::123456789012:user/your-username"
# }

🏗️ Architecture Overview

The deployment creates the following AWS resources:
  • Lambda Function - Python 3.9 runtime (15 min timeout, 3008 MB memory)
  • API Gateway - REST API with 3 endpoints (export, status, stop)
  • S3 Bucket - Stores exported ZIP files (1-day lifecycle)
  • DynamoDB Table - Tracks export status and progress
  • IAM Role - Lambda execution role with necessary permissions
  • Amplify App - Hosts the web frontend (manual deployment)
⚠️ Cost Estimate: This deployment uses AWS services that may incur costs:
  • Lambda: Pay per invocation and execution time
  • API Gateway: Pay per API call
  • S3: Pay per GB stored (minimal with 1-day lifecycle)
  • DynamoDB: Pay-per-request pricing
  • Amplify: Free tier available for static hosting
Estimated cost for moderate use: $5-20/month

Method 1 Deploy with AWS CLI (CloudFormation)

1 Clone the Repository
git clone git@ssh.gitlab.aws.dev:aws-sup-namer-projects/quip2word.git
cd quip2word
2 Build Lambda Package
# Navigate to lambda directory
cd lambda

# Install dependencies
pip install -r requirements.txt -t .

# Create deployment package
cd ..
cd lambda
Compress-Archive -Path * -DestinationPath ../deployment/packages/lambda-function.zip -Force

# On Linux/Mac:
# cd lambda
# zip -r ../deployment/packages/lambda-function.zip .
3 Deploy CloudFormation Stack
# Set your stack name and stage
STACK_NAME="quip-exporter-dev"
STAGE="dev"

# Create the stack
aws cloudformation create-stack \
  --stack-name $STACK_NAME \
  --template-body file://deployment/infrastructure-template.yaml \
  --parameters ParameterKey=Stage,ParameterValue=$STAGE \
  --capabilities CAPABILITY_IAM

# Wait for stack creation to complete
aws cloudformation wait stack-create-complete --stack-name $STACK_NAME
4 Upload Lambda Code
# Get the Lambda function name from stack outputs
FUNCTION_NAME=$(aws cloudformation describe-stacks \
  --stack-name $STACK_NAME \
  --query "Stacks[0].Outputs[?OutputKey=='FunctionName'].OutputValue" \
  --output text)

# Update Lambda function code
aws lambda update-function-code \
  --function-name quip-exporter-dev \
  --zip-file fileb://deployment/packages/lambda-function.zip

# Wait for update to complete
aws lambda wait function-updated --function-name quip-exporter-dev
5 Get API Gateway URL
# Get the API URL
API_URL=$(aws cloudformation describe-stacks \
  --stack-name $STACK_NAME \
  --query "Stacks[0].Outputs[?OutputKey=='ApiUrl'].OutputValue" \
  --output text)

echo "API Gateway URL: $API_URL"
6 Configure S3 CORS (Critical!)
⚠️ Known Issue: S3 bucket CORS must be configured for frontend downloads to work.
# Apply CORS configuration to S3 bucket
aws s3api put-bucket-cors \
  --bucket quip-exporter-files-dev-ACCOUNT_ID \
  --cors-configuration file://deployment/s3-cors.json \
  --profile YOUR_PROFILE

# Verify CORS configuration
aws s3api get-bucket-cors \
  --bucket quip-exporter-files-dev-ACCOUNT_ID \
  --profile YOUR_PROFILE
✅ Backend Deployed! Your Lambda function and API Gateway are now live.

Method 2 Deploy with AWS MCP Server (Kiro IDE)

Prerequisites: Ensure you have the AWS MCP Server configured in Kiro IDE. Check your .kiro/settings/mcp.json file.
1 Verify MCP Server Configuration
# In Kiro IDE, check your MCP configuration
# File: .kiro/settings/mcp.json

{
  "mcpServers": {
    "awslabs.core-mcp-server": {
      "disabled": false,
      "type": "stdio",
      "command": "uv",
      "args": ["tool", "run", "--from", "awslabs.core-mcp-server@latest", "awslabs.core-mcp-server.exe"]
    }
  }
}
2 Use MCP Tools in Kiro Chat

In Kiro IDE chat, you can use natural language to deploy:

You: "Deploy the CloudFormation stack in deployment/infrastructure-template.yaml 
with stack name quip-exporter-dev and parameter Stage=dev"

Kiro: [Uses AWS MCP tools to create the stack]

You: "Upload the Lambda code from deployment/packages/lambda-function.zip 
to function quip-exporter-dev"

Kiro: [Uses AWS MCP tools to update Lambda function]

You: "Get the API Gateway URL from the CloudFormation stack outputs"

Kiro: [Retrieves and displays the API URL]
Note: The AWS MCP Server provides tools for AWS operations. Kiro will automatically use the appropriate MCP tools based on your requests.
Configure S3 CORS

Don't forget to apply CORS configuration (same as Method 1, Step 6):

You: "Apply the CORS configuration from deployment/s3-cors.json 
to the S3 bucket quip-exporter-files-dev-ACCOUNT_ID"

Kiro: [Uses AWS MCP tools to configure S3 CORS]

Method 3 Local Python Script (No AWS Required)

💻 Local Execution: Run the Quip exporter directly on your machine without any AWS infrastructure. Perfect for one-time exports or testing.
1 Install Python Dependencies
# Create virtual environment (recommended)
python -m venv .venv

# Activate virtual environment
# Windows:
.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt
2 Get Your Quip API Key
  1. Go to Quip API Token Page
  2. Generate a new API token
  3. Copy the token (you'll need it for the next step)
3 Run the Export Script
# Basic usage
python quip2word.py <folder_url> <api_key>

# Example
python quip2word.py https://quip-amazon.com/ABC123XYZ YOUR_API_KEY

# With options
python quip2word.py https://quip-amazon.com/ABC123XYZ YOUR_API_KEY \
  --max-docs 100 \
  --max-api-calls 500
4 Find Your Exported Files

Exported files will be saved to:

quip_exports/
└── [Folder Name]/
    ├── document1.docx
    ├── document2.docx
    ├── spreadsheet1.xlsx
    └── subfolder/
        └── document3.docx
✅ Export Complete! Your Quip documents are now saved locally as DOCX and XLSX files.

Available Command-Line Options

Option Description Default
--max-docs N Maximum number of documents to export Unlimited
--max-api-calls N Maximum API calls to make Unlimited
--narrow-margins Use narrow margins in exported documents False
--no-images Skip downloading images Download images
--no-spreadsheets Skip exporting spreadsheets Export spreadsheets
⚠️ Rate Limiting: The script includes a 0.3-second delay between API calls to respect Quip's rate limits. Large folder exports may take several minutes.

🔧 Post-Deployment Steps (AWS Only)

Note: These steps only apply to Method 1 and Method 2 (AWS deployments). Skip this section if you're using Method 3 (local script).
1 Build Frontend Package
# Navigate to web-frontend directory
cd web-frontend

# Update app.js with your API Gateway URL
# Edit line 4: this.apiEndpoint = 'YOUR_API_URL_HERE';

# Create frontend package
Compress-Archive -Path * -DestinationPath ../deployment/packages/frontend-app.zip -Force

# On Linux/Mac:
# zip -r ../deployment/packages/frontend-app.zip .
2 Deploy Frontend to Amplify
Manual Step Required: Amplify deployment requires manual upload through AWS Console.
  1. Go to AWS Amplify Console
  2. Create a new app or select existing quip-exporter-app
  3. Choose "Deploy without Git provider"
  4. Upload deployment/packages/frontend-app.zip
  5. Wait for deployment to complete
  6. Note the Amplify app URL (e.g., https://quip2word.aviaws.people.aws.dev)
3 Enable Web Application Firewall (Recommended)
Security Best Practice: Enable AWS WAF to protect your frontend from common web exploits.
  1. In the Amplify Console, select your app
  2. Go to App settingsMonitoring
  3. Scroll to Web Application Firewall (WAF) section
  4. Click Enable WAF
  5. Choose a managed rule set (e.g., AWS Managed Rules - Core Rule Set)
  6. Click Save
⚠️ Note: WAF incurs additional costs (~$5-10/month for basic protection). This is optional but recommended for production deployments.
4 Verify S3 CORS Configuration
Note: This should already be configured in Step 6 of Method 1 or Method 2. Verify it's working correctly.
# Verify CORS is configured
aws s3api get-bucket-cors \
  --bucket quip-exporter-files-dev-YOUR_ACCOUNT_ID \
  --profile YOUR_PROFILE
5 Set Up Custom Domain (Optional)
Optional: Use a custom dev domain instead of the default Amplify URL.

Option A: Amazon Internal Dev Domain

  1. Request a dev domain: Create Personal Dev Domain
  2. Follow the Locke process to get yourname.people.aws.dev
  3. Once approved, configure DNS in Route 53

Option B: Route 53 Domain Setup

# Create hosted zone (if not exists)
aws route53 create-hosted-zone \
  --name yourname.people.aws.dev \
  --caller-reference $(date +%s) \
  --profile YOUR_PROFILE

Link Domain to Amplify App

  1. Go to Amplify Console
  2. Select your app → App settingsDomain management
  3. Click Add domain
  4. Enter your domain (e.g., quip-exporter.yourname.people.aws.dev)
  5. Amplify will automatically:
    • Create SSL certificate via ACM
    • Configure CloudFront distribution
    • Provide DNS records to add to Route 53
  6. Add the CNAME records to your Route 53 hosted zone:
    aws route53 change-resource-record-sets \
      --hosted-zone-id YOUR_ZONE_ID \
      --change-batch file://dns-records.json \
      --profile YOUR_PROFILE
  7. Wait for DNS propagation (5-10 minutes)
  8. Amplify will verify domain and issue SSL certificate
✅ Custom Domain Active! Your app is now accessible at your custom domain with HTTPS.

✅ Verification & Testing

Test Backend API

# Test the export endpoint
curl -X POST $API_URL/export \
  -H "Content-Type: application/json" \
  -d '{
    "quipUrl": "https://quip-amazon.com/YOUR_FOLDER_ID",
    "apiKey": "YOUR_QUIP_API_KEY"
  }'

# Expected response:
# {
#   "success": true,
#   "exportId": "uuid-here",
#   "download_url": "presigned-s3-url"
# }

Test Frontend

  1. Open your Amplify app URL in a browser
  2. Enter a Quip folder URL
  3. Enter your Quip API key
  4. Click "Start Export"
  5. Verify status updates appear
  6. Download the ZIP file when complete

Check CloudWatch Logs

# View Lambda logs
aws logs tail /aws/lambda/quip-exporter-dev --follow

# View recent errors
aws logs filter-log-events \
  --log-group-name /aws/lambda/quip-exporter-dev \
  --filter-pattern "ERROR"

🔍 Troubleshooting

Issue Solution
Stack creation fails Check CloudFormation events: aws cloudformation describe-stack-events --stack-name quip-exporter-dev
Lambda timeout Increase timeout in CloudFormation template (max 900 seconds)
CORS errors in browser Verify API Gateway CORS configuration and S3 bucket CORS
Download fails with CORS error S3 bucket CORS not configured. Run: aws s3api put-bucket-cors --bucket BUCKET_NAME --cors-configuration file://deployment/s3-cors.json
Amplify WAF not enabled WAF must be enabled manually in Amplify Console → App settings → Monitoring
Invalid API key Check Lambda logs for authentication errors. Verify Quip API key is valid
S3 access denied Verify Lambda IAM role has S3 permissions
DynamoDB errors Check Lambda IAM role has DynamoDB permissions

View Stack Resources

# List all resources in the stack
aws cloudformation describe-stack-resources --stack-name quip-exporter-dev

# Get stack outputs
aws cloudformation describe-stacks \
  --stack-name quip-exporter-dev \
  --query "Stacks[0].Outputs"

🗑️ Cleanup & Removal

⚠️ Warning: This will delete all resources and data. Exported files in S3 will be lost.
1 Empty S3 Bucket
# Get bucket name
BUCKET_NAME=$(aws cloudformation describe-stacks \
  --stack-name quip-exporter-dev \
  --query "Stacks[0].Outputs[?OutputKey=='BucketName'].OutputValue" \
  --output text)

# Empty the bucket
aws s3 rm s3://$BUCKET_NAME --recursive
2 Delete CloudFormation Stack
# Delete the stack
aws cloudformation delete-stack --stack-name quip-exporter-dev

# Wait for deletion to complete
aws cloudformation wait stack-delete-complete --stack-name quip-exporter-dev
3 Delete Amplify App (Manual)
  1. Go to AWS Amplify Console
  2. Select your app
  3. Click "Actions" → "Delete app"
  4. Confirm deletion
✅ Cleanup Complete! All AWS resources have been removed.

📚 Additional Resources