Deep dive into AWS for developers | Part1 — IAM & EC2

  • IAM has a global-view and its applicable for all the regions.
  • Permissions are governed by policies. IAM also provides pre-defined managed policies.
  • It’s in best interest that, Users should be given minimal permissions that they need to perform their jobs. (Least Privilege Principle).
  • IAM credentials should never be shared and most-importantly, IAM credentials should never be written into the code.
  • First we update all our libraries at the EC2 instance :-
  • Next, we install the ‘httpd’ server :-
  • Next, we start the web-server :-
  • Next, we make sure that, service keeps running, even across instance-restarts.
  • Next, let’s write some static content to the file, that web-server shall be returning upon being invoked.
  • Now, if we want to access this web-server through web-browser, then it would not be allowed to happen, because our security-group only allows the inbound traffic on port 22 at this instance. So, let’s go ahead and allow the http based traffic on port no. 22 as well by modifying the security-groups as below :-

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aditya goel

aditya goel

Software Engineer for Big Data distributed systems