Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 1.5 KB

File metadata and controls

90 lines (67 loc) · 1.5 KB

Setup Instructions

Prerequisites

  1. Install SAM CLI:

    # macOS
    brew install aws-sam-cli
    
    # Windows
    # Download from: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
    
    # Verify installation
    sam --version
  2. Install AWS CLI:

    # macOS
    brew install awscli
    
    # Or download from: https://aws.amazon.com/cli/
    
    # Verify installation
    aws --version
  3. Configure AWS Credentials:

    aws configure

    Enter your:

    • AWS Access Key ID
    • AWS Secret Access Key
    • Default region (e.g., us-east-1)
    • Output format (json)
  4. Install Python & pip (if not already installed):

    # macOS
    brew install python
    
    # Verify
    python3 --version
    pip3 --version

Deploy with SAM

# Make script executable
chmod +x deploy.sh

# Deploy (will prompt for project name and region)
./deploy.sh

Alternative SAM Commands

# Build only
sam build

# Deploy with guided setup (first time)
sam deploy --guided

# Deploy with existing config
sam deploy

# Local testing
sam local start-api
sam local invoke ImageResizerFunction

Test

# Get bucket name from deployment output, then:
aws s3 cp me.jpeg s3://YOUR-INPUT-BUCKET-NAME/

# Check resized images in output bucket
aws s3 ls s3://YOUR-OUTPUT-BUCKET-NAME/resized/ --recursive

Cleanup

# Delete entire stack
sam delete --stack-name YOUR-STACK-NAME