Hi folks! Today, I will be showing how to sync up an EC2 instance with S3 bucket.
Steps to be covered
- Step 1: Create an IAM user
- Step 2: Create EC2 instance and Login to the created instance
- Step 3: Create an S3 Bucket
- Step 4: Start Syncing up with S3 bucket from EC2 instance
Create an IAM User
- Log in to your AWS account and search for IAM in services or use the URL -> https://console.aws.amazon.com/iam/
- In the navigation pane, choose Users and then choose "Add User".
- Provide a username (Here, I named it ‘Demo User’) and selected the Programmatic access and clicked on "Next".

- Now, select the option ‘Attach existing policy’ and search for ‘AdministratorAccess and AmazonEC2FullAccess’ and click "Next".
- This page will show you the type of Policy and Username which was created by you and reviewed. Click on "Create User".

- Now, download the CSV file and save in your local path.

Create an EC2 Instance and Login to Instance
- Now, we will create an EC2 instance.

- Here, I have chosen Amazon Linux Machine and log on to the machine once the instance is up.

- Now, type the command aws configure where it will ask for AccessKey and Secret Key. Provide the necessary information from the CSV file which we downloaded in step 6 under "Create IAM user".

- I have used the region as US-East-2 (Provide the region name depends upon our EC2 instance runs) and output format as JSON file and hit Enter.
- Install the HTTPD service in our EC2 instance and make sure you are in the root account to install any services.
- sudo -i - Change to the root account from the normal user.
- yum install httpd - To install the HTTPD service.

- Once the execution is successful, create a PHP file with the following HTML.









Join the conversation! Your thoughts help the community grow.