Skip to content

s3 bucket hosting through ( CLI ) method for a ( static web hosting ).

Notifications You must be signed in to change notification settings

mHadi1091/s3-bucket-hosting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Abu Fatima Zohra Travel and Tours S3 Upload Documentation

📄 Introduction

This document outlines the steps to configure AWS CLI and upload files and folders to an S3 bucket, specifically to the bucket abufatimatuzahratravelandtour.com.

🛠️ Prerequisites

Before starting, ensure you have the following:

  • 🔑 AWS Access Key ID and Secret Access Key
  • 🖥️ AWS CLI installed
  • 🪣 S3 bucket name (abufatimatuzahratravelandtour.com)

📜 Step-by-Step Guide

1️⃣ Install AWS CLI

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

2️⃣ Configure AWS CLI

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).

3️⃣ Verify the AWS Configuration

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.

4️⃣ Uploading Files and Folders to S3 Bucket

To upload individual files or entire folders to the S3 bucket abufatimatuzahratravelandtour.com, follow these steps.

📂 a. Upload a Single File

Use the following command to upload a single file to the bucket:

aws s3 cp /path/to/your/file.txt s3://abufatimatuzahratravelandtour.com/

📁 b. Upload an Entire Folder

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.

5️⃣ Verify Upload

You can list the contents of the bucket to ensure your files have been successfully uploaded:

aws s3 ls s3://abufatimatuzahratravelandtour.com/

6️⃣ Error Handling ⚠️

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

7️⃣ Additional Commands 🛠️

  • 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

🎉 Conclusion

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.

About

s3 bucket hosting through ( CLI ) method for a ( static web hosting ).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published