This project creates a single, self-contained Bash CLI tool to manage a simple cloud file storage system using Amazon S3 and the AWS CLI.
The tool handles both the initial storage deployment and all subsequent file management operations (upload, download, list, delete).
- Cloud Provider: Amazon Web Services (AWS)
- Storage Service: Amazon Simple Storage Service (S3)
- Tools: AWS CLI, Bash
- Automation: GitHub Actions (for automated deployment)
| File Name | Description | Role |
|---|---|---|
cloud_storage_cli.sh |
The single Bash script handling Deployment (Task 1) and all File Management (Task 2) operations. | Core Functionality |
storage_activity.log |
Records every action (upload, download, list, delete) performed by the script. | BONUS: Logging |
.github/workflows/deploy.yml |
GitHub Actions workflow to automate the initial storage deployment. | Automation |
- AWS Account: You need an active AWS account.
- AWS CLI: The AWS CLI must be installed and configured with IAM credentials that have permissions to manage S3 (create buckets and apply policies). Run
aws configureto set this up.
The first time you run the script, use the deploy command to create the S3 bucket and configure public read access.
# Make the script executable
chmod +x cloud_storage_cli.sh
# Run the deployment command
./cloud_storage_cli.sh deploy
⚠️ CRUCIAL STEP: Configuration UpdateThe deployment will output the unique name of the S3 bucket it created. You must copy this name and paste it into the
S3_BUCKET_NAMEvariable at the top of thecloud_storage_cli.shfile to enable file operations.
Once configured, use the script as a CLI tool for file operations.
| Command | Description | Example |
|---|---|---|
list |
Lists all files currently stored in the S3 bucket. | ./cloud_storage_cli.sh list |
upload |
Uploads a local file to the cloud storage. | ./cloud_storage_cli.sh upload report.txt |
download |
Downloads a file from the cloud storage to a local directory. | ./cloud_storage_cli.sh download report.txt ./downloads/ |
delete |
Permanently deletes a file from the cloud storage. | ./cloud_storage_cli.sh delete report.txt |
All operations are recorded with a timestamp and status in the storage_activity.log file, fulfilling the logging bonus requirement.
The provided GitHub Actions workflow (deploy.yml) allows you to automate the initial deployment process.
To enable this automation:
- Go to your repository Settings > Secrets and variables > Actions.
- Add two repository secrets that hold your access credentials:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
This workflow runs the ./cloud_storage_cli.sh deploy command using your provided credentials whenever you push changes, ensuring your cloud storage is set up automatically.