This document outlines the steps to configure AWS CLI and upload files and folders to an S3 bucket, specifically to the bucket abufatimatuzahratravelandtour.com
.
Before starting, ensure you have the following:
- 🔑 AWS Access Key ID and Secret Access Key
- 🖥️ AWS CLI installed
- 🪣 S3 bucket name (
abufatimatuzahratravelandtour.com
)
If the AWS CLI is not already installed, follow these steps:
-
For Linux/MacOS:
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" sudo installer -pkg AWSCLIV2.pkg -target /
-
For Windows, download the AWS CLI MSI installer from AWS Documentation.
✅ To verify installation:
aws --version
Once AWS CLI is installed, configure it using your provided AWS Access Key ID and Secret Access Key:
aws configure
You will be prompted to enter:
- 🔑 AWS Access Key ID: Enter the access key provided.
- 🔒 AWS Secret Access Key: Enter the secret key provided.
- 🌍 Default region name: Enter the region where your bucket is located (e.g.,
us-east-1
). - 📝 Default output format: Enter
json
(default format).
After configuring, you can verify the AWS credentials by running:
aws sts get-caller-identity
This command returns the account information and confirms the AWS CLI is configured correctly.
To upload individual files or entire folders to the S3 bucket abufatimatuzahratravelandtour.com
, follow these steps.
Use the following command to upload a single file to the bucket:
aws s3 cp /path/to/your/file.txt s3://abufatimatuzahratravelandtour.com/
To upload a folder with multiple files recursively to the S3 bucket:
aws s3 cp /home/qazifaisal/Desktop/abu-fatima-zohra s3://abufatimatuzahratravelandtour.com/ --recursive
This will upload the folder /abu-fatima-zohra
and all of its contents to the S3 bucket.
You can list the contents of the bucket to ensure your files have been successfully uploaded:
aws s3 ls s3://abufatimatuzahratravelandtour.com/
If you encounter errors during the upload, common issues might include:
- ❌ Incorrect bucket name
- 🔒 Missing permissions (ensure your AWS credentials allow
s3:PutObject
actions). - 🌍 Region mismatch: Ensure you are operating in the correct region. If not set correctly during configuration, you can add the region flag in commands like so:
aws s3 cp /home/qazifaisal/Desktop/abu-fatima-zohra s3://abufatimatuzahratravelandtour.com/ --recursive --region us-east-1
-
Download a File:
aws s3 cp s3://abufatimatuzahratravelandtour.com/file.txt /local/path/file.txt
-
Delete a File from the Bucket:
aws s3 rm s3://abufatimatuzahratravelandtour.com/file.txt
This documentation provides a guide to configuring the AWS CLI and uploading files and folders to your S3 bucket. If you have additional questions or run into issues, feel free to reach out.