DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Building a Serverless Application on AWS With AWS SAM
  • Terraform Best Practices: The 24 Practices You Should Adopt
  • Keep Your Application Secrets Secret
  • Apache Ranger and AWS EMR Automated Installation and Integration Series (5): Windows AD + Open-Source Ranger

Trending

  • How to Format Articles for DZone
  • Strategies for Securing E-Commerce Applications
  • Optimizing Serverless Computing with AWS Lambda Layers and CloudFormation
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Uploading File To AWS S3 Using AWS CLI

Uploading File To AWS S3 Using AWS CLI

Take a look at the first steps to using AWS S3 with this tutorial on uploading your files with the native CLI.

By 
Faisal Pathan user avatar
Faisal Pathan
·
Mar. 19, 19 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
28.9K Views

Join the DZone community and get the full member experience.

Join For Free

Today, in this article, we are going to learn how to upload a file(s) or project to Amazon S3 using AWS CLI. To start with, first, we need to have an AWS account.

What is Amazon S3?

Amazon S3 stands for Amazon Simple Storage Service. It helps the developer community make computing scalable and more simple. Amazon S3 provides a platform where developers can store and download the data from anywhere and at any time on the web. Amazon S3 is a very fast and reliable storage infrastructure.

You can create a free AWS account or log into your account from here. Once you are logged into your AWS account, the next step is to create security credentials for your account, which includes an access key.

To get your credentials, follow the below steps.

1. Click Account name > My Security Credentials.
Uploading File To AWS S3 Using AWS CLI


2. Select "Users" from the left panel.
Uploading File To AWS S3 Using AWS CLI


3. Click on the username.

Uploading File To AWS S3 Using AWS CLI


4. Now, from the screen shown below, you can set permissions and create your credentials by clicking on the "Create access key" button.


Uploading File To AWS S3 Using AWS CLI


5. Copy your credentials or download the crendetials.csv to use later.

Uploading File To AWS S3 Using AWS CLI


6. Download and install AWS CLI. You can install AWS CLI for any major operating system: macOS, Linux, or Windows.

Here, we are using Windows OS so you can download the installer for Windows from here.

7. Once you successfully install the AWS CLI, open command prompt and execute the below commands.

  1. First, execute  aws configure to configure your account (This is a one-time process) and press Enter (this is a one-time process).

  2. Now, it will ask for an AWS access key ID, key, region name, and output format. Enter all the inputs and press Enter.

Uploading File To AWS S3 Using AWS CLI

Your AWS account is configured with your workstation.

8. Now, it is time to create an S3 bucket.

        1. To create a bucket, execute this command:
            

aws s3 mb s3://{YOUR-BUCKET-NAME}


See the example here: (aws s3 mb s3://my-first-csharp-bucket)
Uploading File To AWS S3 Using AWS CLI


Check the AWS S3 account to see if your bucket is created.

Uploading File To AWS S3 Using AWS CLI

9. Now, it's time to upload the files.


To upload the files or project, execute the below command in CMD.

 aws s3 sync "{YOUR-LOCAL-PATH}" s3://{YOUR-BUCKET-NAME}


Uploading File To AWS S3 Using AWS CLI




10. If the path and bucket name are valid, then your files/project are successfully uploaded.

Uploading File To AWS S3 Using AWS CLI




Output

Uploading File To AWS S3 Using AWS CLI

AWS Command-line interface

Opinions expressed by DZone contributors are their own.

Related

  • Building a Serverless Application on AWS With AWS SAM
  • Terraform Best Practices: The 24 Practices You Should Adopt
  • Keep Your Application Secrets Secret
  • Apache Ranger and AWS EMR Automated Installation and Integration Series (5): Windows AD + Open-Source Ranger

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!