This document describes how to deploy the YDB Capacity Calculator application to Yandex Cloud S3 bucket.
The YDB Capacity Calculator is a static web application built using HTML, CSS, and JavaScript. It is hosted in a Yandex Cloud S3 bucket with static website hosting enabled.
- Website URL: https://capacity-calculator.s3-website.mds.yandex.net
- Deployment Method: Automated shell script using AWS CLI
- Authentication: S3 API keys stored in
deply/settings.txt
The deployment script requires AWS CLI to be installed:
macOS:
brew install awscliLinux:
pip install awscliVerify installation:
aws --versionEnsure your S3 credentials are properly configured in deply/settings.txt:
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_BUCKET_NAME=capacity-calculator
AWS_REGION=ru-central1
AWS_ENDPOINT_URL=https://s3.mds.yandex.net
Note: If AWS_ENDPOINT_URL is not specified, the script will use the default: https://s3.mds.yandex.net
deply/settings.txt to version control. See gitignore-recommendations.md for details.
To deploy the application, simply run:
./deploy.shThe script will:
- ✓ Validate AWS CLI is installed
- ✓ Load credentials from
deply/settings.txt - ✓ Verify all required files exist
- ✓ Upload files to S3 with correct content types
- ✓ Display the website URL
The following files are uploaded to the S3 bucket:
index.html # Main application entry point
css/
├── styles.css # Application styles
└── ydb-tech.css # YDB technical styles
js/
├── calculator.js # Main calculator logic
└── core.js # Core calculation functions
images/
└── cthulhu.png # Warning illustration
LICENSE # Apache 2.0 license
README.md # Project documentation
The script automatically sets correct MIME types:
.html→text/html.css→text/css.js→application/javascript.png→image/png.md→text/markdown
All files are uploaded with public-read ACL to enable website hosting.
After deployment, verify the application:
- Open the website: https://capacity-calculator.s3-website.mds.yandex.net
- Check functionality:
- Calculator loads without errors
- All CSS styles are applied
- JavaScript functions work correctly
- Images display properly
- Browser console: Verify no errors in developer console
Error: AWS CLI not found
# Install AWS CLI (see Prerequisites)
brew install awscli # macOS
pip install awscli # LinuxError: Settings file not found
# Verify settings file exists
ls -la deply/settings.txt
# Check file contents (without displaying credentials)
head -n 1 deply/settings.txtError: Upload failed
- Verify credentials are correct
- Check network connectivity
- Ensure bucket exists and you have write permissions
403 Forbidden Error
- Verify bucket has public read access
- Check file ACLs are set to
public-read
404 Not Found
- Verify files were uploaded successfully
- Check bucket name in URL matches settings
Styles/Scripts Not Loading
- Clear browser cache
- Verify content types are set correctly
- Check browser console for specific errors
Instead of deply/settings.txt, you can use environment variables:
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_BUCKET_NAME="capacity-calculator"
export AWS_REGION="ru-central1"
export AWS_ENDPOINT_URL="https://s3.mds.yandex.net"
./deploy.shTo test the deployment without actually uploading:
# Add --dryrun flag to AWS commands in deploy.sh
# (requires manual script modification)To deploy only specific files, modify the files array in deploy.sh:
# Edit deploy.sh, line ~130
local files=(
"index.html"
"css/styles.css"
# ... add or remove files as needed
)name: Deploy to S3
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install AWS CLI
run: pip install awscli
- name: Deploy to S3
run: ./deploy.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET_NAME: capacity-calculator
AWS_REGION: ru-central1- ✅ Never commit credentials to version control
- ✅ Use
.gitignoreto excludedeply/settings.txt - ✅ Rotate credentials regularly
- ✅ Use IAM roles in CI/CD pipelines instead of access keys
- ✅ Limit permissions to only what's needed (S3 write access)
See gitignore-recommendations.md for detailed security guidelines.
- Deployment Plan - Detailed architecture and strategy
- GitIgnore Recommendations - Security guidelines
- README.md - Project overview
For issues or questions:
- Check the troubleshooting section above
- Review the deployment plan document
- Verify all prerequisites are met
- Check AWS CLI and S3 bucket configuration