Skip to main content

Posts

Showing posts from November, 2019

How to set up AWS CLI to Upload/Download Files - CENTOS 7

We used the AWS SDK to upload files using Java in the previous post and everything worked perfectly, but I needed to upload a database backup in .gz format with a size of 18GB,  and using the AWS SDK did not allow me to do it so that it just allows upload in a maximum put of 5GB, so using AWS CLI allows us to upload until 160GB in just one put, and now let's see how we can use set it up in Centos 7 and use it: Note: get ready yourself going to  Identity and Access Management (IAM),  creating a new user or using an existing one which has got access to the group  AmazonS3FullAccess , so once you've got an  AWS Access Key ID with the AWS Access Key ID keep doing the process. There a lot of ways to install it, let's do it like so: curl " https://s3.amazonaws.com/aws-cli/awscli-bundle.zip " -o "awscli-bundle.zip" unzip awscli-bundle.zip cd awscli-bundle/ sudo . /install -i /usr/local/aws -b /usr/local/bin/aws Check it with: aws --versi

How to upload files to Amazon S3 Bucket with Java

This is going to be a piece of code really useful for many purposes for uploading anything you want to your S3 Bucket, as MySql or PostgreSql backups, or anything else. the first thing we need to do after created the bucket you are going to set the data, go to AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. Let’s create such user. Go to Services -> IAM. In the navigation pane, choose Users and then choose Add user. Enter user’s name and check Access type ‘Programatic access’. Press next button. We need to add permissions to this user. Press ‘Attach existing policy directly’, in the search field enter ‘s3’ and among found permissions choose AmazonS3FullAccess. Then press next and ‘Create User’. If you did everything right then you should see an Access key ID and a Secret access key for your user. There is also ‘Download .csv’ button for downloading these keys, so please click on it in order