Accessing S3 bucket through EC2 instance using IAM role

In this blog, we will show you the Steps to accessing S3 bucket through EC2 instance using the IAM role.

 

ENVIRONMENT OVERVIEW

 

  • An IAM role is an AWS identity that contains permission policies that can be assigned to a specific AWS user.
  • We have already created a few buckets under our subscription for this demo.

Accessing S3 bucket through EC2 instance using IAM role

 

  • Also, we have created an EC2 instance for this testing purpose.

CREATING IAM ROLE

 

  • Go-to IAM Management.

Accessing S3 bucket through EC2 instance using IAM role

 

  • Click on the Roles link.

 

  • Click on the create role button.

 

  • Select on EC2 service and click on Next for permission Window.

 

  • Search for S3 related permissions. We chose AmazonS3FullAccess for this demo.

 

  • No tags are given for this role. Then click on the Next button to review the selected settings.

 

  • Provide the name and description for your role and click on the Create Role button.

 

  • A new role has been created successfully.

 

 

ASSIGNING THE IAM  ROLE TO AN INSTANCE

 

  • Select the EC2 Instance and click on Actions.

Accessing S3 bucket through EC2 instance using IAM role

 

  • Go to Instance settings and click on Attach/Replace IAM Role option.

 

  • Select the IAM role from the drop-down list and click on Apply.

Accessing S3 bucket through EC2 instance using IAM role

 

  • The role has been attached successfully.

Accessing S3 bucket through EC2 instance using IAM role

 

VERIFICATION

 

  • Login into the EC2 instance and make sure that you have installed AWS CLI on that machine.

Accessing S3 bucket through EC2 instance using IAM role

 

 

  • Open the command prompt and list the available S3 buckets using below command.

aws s3 ls

Accessing S3 bucket through EC2 instance using IAM role

 

Thanks for reading this blog. We hope it was useful for you to learn about accessing the S3 bucket from an EC2 instance through IAM role.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage I am back with another blog to provide the useful script to the Freebsd users to determine the zpool and

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support