📕
Dan Fitz's Notes
  • README
  • Ai
    • Supervised Machine Learning
      • Introduction To Machine Learning
      • Regression With Multiple Input Variables
      • Classification
  • Csharp
    • C Sharp Advanced
      • Generics
      • Delegates
      • Lambda Expressions
      • Events
    • C Sharp Fundamentals
      • Intro To C
      • Primitive Types And Expressions
      • Non Primitive Types
      • Control Flow
      • Arrays And Lists
      • Working With Dates
      • Working With Text
      • Working With Files
      • Debugging Applications
    • C Sharp Intermediate
      • Classes
      • Association Between Classes
      • Inheritance
      • Polymorphism
      • Interfaces
  • Java
    • Inheritance Data Structures Java
      • Inheritance Polymorphism Using Overriding And Access Modifiers
      • Abstract Classes And Debugging
      • File I O And Exceptions
      • Collections Maps And Regular Expressions
    • Intro To Java
      • Introduction To Java Classes And Eclipse
      • Unit Testing Arrays And Array Lists
      • Static Variables Methods And Polymorphism Using Overloading
  • Javascript
    • Algorithms Data Structures
      • Big O Notation
      • Analyzing Performance Of Arrays And Objects
      • Problem Solving Approach
      • Problem Solving Patterns
      • Recursion
      • Searching Algorithms
      • Bubble Selection And Insertion Sort
      • Merge Sort
      • Quick Sort
      • Radix Sort
      • Data Structures Introduction
      • Singly Linked Lists
      • Doubly Linked Lists
      • Stacks And Queues
      • Binary Search Trees
      • Tree Traversal
      • Binary Heaps
    • Complete Nodejs
      • Understanding Node.js
      • REST AP Is And Mongoose
      • API Authentication And Security
      • Node.js Module System
      • File System And Command Line Args
      • Debugging Node.js
      • Asynchronous Node.js
      • Web Servers
      • Accessing API From Browser
      • Application Deployment
      • Mongo DB And Promises
    • Complete React Native
      • Working With Content
      • Building Lists
      • Navigating Users Between Screens
      • State Management
      • Handling Screen Layout
      • Setting Up An App
      • More On Navigation
      • Advanced Statement Management With Context
      • Building A Custom Express API
      • In App Authentication
    • Epic React
      • React Fundamentals
      • React Hooks
      • Advanced React Hooks
      • Advanced React Patterns
      • React Performance
    • Fireship Firestore
      • Firestore Queries And Data Modeling Course
      • Model Relational Data In Firestore No SQL
    • Functional Light Javascript
      • Intro
      • Function Purity
      • Argument Adapters
      • Point Free
      • Closure
      • Composition
      • Immutability
      • Recursion
      • List Operations
      • Transduction
      • Data Structure Operations
      • Async
    • Js Weird Parts
      • Execution Contexts And Lexical Environments
      • Types And Operators
      • Objects And Functions
      • Object Oriented Java Script And Prototypal Inheritance
      • Defining Objects
    • Mastering Chrome Dev Tools
      • Introduction
      • Editing
      • Debugging
      • Networking
      • Auditing
      • Node.js Profiling
      • Performance Monitoring
      • Image Performance
      • Memory
    • React Complete Guide
      • What Is React
      • React Basics
      • Rendering Lists And Conditionals
      • Styling React Components
      • Debugging React Apps
      • Component Deep Dive
      • Building A React App
      • Reaching Out To The Web
      • Routing
    • React Testing
      • Intro To Jest Enzyme And TDD
      • Basic Testing
      • Redux Testing
      • Redux Thunk Testing
    • Serverless Bootcamp
      • Introduction
      • Auction Service Setup
      • Auction Service CRUD Operations
      • Auction Service Processing Auctions
    • Testing Javascript
      • Fundamentals Of Testing
      • Static Analysis Testing
      • Mocking Fundamentals
      • Configuring Jest
      • Test React Components With Jest And React Testing Library
    • Typescript Developers Guide
      • Getting Started With Type Script
      • What Is A Type System
      • Type Annotations In Action
      • Annotations With Functions And Objects
      • Mastering Typed Arrays
      • Tuples In Type Script
      • The All Important Interface
      • Building Functionality With Classes
    • Web Performance With Webpack
      • Intro
      • Code Splitting
      • Module Methods Magic Comments
  • Other
    • Algo Expert
      • Defining Data Structures And Complexity Analysis
      • Memory
      • Big O Notation
      • Logarithm
      • Arrays
      • Linked Lists
      • Hash Tables
      • Stacks And Queues
      • Strings
      • Graphs
      • Trees
    • Aws Solutions Architect
      • AWS Fundamentals IAM EC 2
    • Fundamentals Math
      • Numbers And Negative Numbers
      • Factors And Multiples
      • Fractions
    • Mysql Bootcamp
      • Overview And Installation
      • Creating Databases And Tables
      • Inserting Data
      • CRUD Commands
      • The World Of String Functions
      • Refining Our Selections
      • The Magic Of Aggregate Functions
    • Random Notes
      • Understanding React Hooks
  • Python
    • Data Analysis Using Python
      • Loading Querying And Filtering Data Using The Csv Module
      • Loading Querying Joining And Filtering Data Using Pandas
      • Summarizing And Visualizing Data
    • Intro To Python
      • Course Introduction Intro To Programming And The Python Language Variables Conditionals Jupyter Notebook And IDLE
      • Intro To Lists Loops And Functions
      • More With Lists Strings Tuples Sets And Py Charm
      • Dictionaries And Files
Powered by GitBook
On this page
  • AWS Regions and Availability Zones
  • AWS regions
  • Availability zones
  • IAM (Identity and Access Management)
  • Users, groups, roles, and policies
  • IAM Federation
  • Random pro tips
  • Hands-on walkthrough
  • EC2
  • How to launch an EC2 instance
  • SSH into your EC2 instance
  • Security Groups
  • Allow, inbound, and outbound rules
  • Deeper dive
  1. Other
  2. Aws Solutions Architect

AWS Fundamentals IAM EC 2

PreviousAws Solutions ArchitectNextFundamentals Math

Last updated 3 years ago

With IAM, we will learn how to create users, groups, and policies. Then we will look into EC2, one of the most widely used services in AWS.

AWS Regions and Availability Zones

AWS regions

AWS regions are clusters of data centers.

Important: Most AWS services are region-scoped--meaning whatever services you set up in one region must be separately set up in another region.

  • IAM is global

  • EC2 is region-scoped

Pro tip: Not all services are found in your preferred region. Use this to find out what services you have access to.

Availability zones

Every region has multiple AWS availability zones (or AZ). These are discrete data centers, each with their own power. networking, and connectivity. As a result, each AZ is separate from one another: a disaster in one won't affect the others.

Note: Even though each AZ is isolated, they're still connected through high bandwidth, ultra-low latency networking.

IAM (Identity and Access Management)

IAM is the heart of your security. It consists of

  • Users

  • Groups

  • Roles

Unlike every other service, IAM is global. Whatever you set up in IAM applies to every region, not just the one you're currently on.

The first account you will ever use when setting up AWS is your root account. This account has every privilege possible.

Pro tip: Only use the root account for initial setup. Then never use it again! It has too much control.

Pro tip: It's a good idea to give users the minimal amount of permissions required to do their job. This is known as the least privilege principle.

Users, groups, roles, and policies

Users map to physical people (of course).

Groups are clusters of users that inherit the permissions you apply to those groups; they're usually grouped by functions (e.g. DevOps) or teams (e.g. engineering).

Roles are permissions we give to a machine. It's internal to usage within AWS resources. (This will probably make more sense later.)

Finally, policies apply definitions of what users, groups, and roles can and cannot do. They're written in JSON.

Note: IAM has managed policies, which are like predefined policies to make your life easier.

IAM Federation

Big enterprises that already have their own user database can set up logins using their company credentials. This is IAM Federation.

It uses the SAML standard.

Random pro tips

  • IAM is where you set up multi-factor authentication

Hands-on walkthrough

When in IAM, there is a checklist to complete.

  1. Activate multi-factor authentication on the root account

  2. Create an IAM user. This will give you a credentials table where you can save or send their sensitive security information.

    • Pro tip: Create a user with AdministratorAccess policy permissions.

  3. You can then define groups and assign permissions. It's a good idea to apply those groups to the users you create.

  4. You can then set a password policy that even forces a password reset every X days.

  5. Finally, you want to log into that admin user you created. Stop using the root account.

EC2

EC2 was the foundational service that Amazon started with. Nowadays, Amazon's more cutting-edge offerings are serverless, but EC2 is still fundamental to understanding how the cloud works.

EC2 basically allows you to rent virtual machines. There are sub-services though that go along with it:

  • EBS stores data on virtual drives

  • ELB provides load balancing across machines

  • ASG helps scale your service using an auto-scaling group

How to launch an EC2 instance

  1. Go to EC2 using the search bar.

  2. Click "Launch Instance".

  3. You will be asked to choose an AMI: an Amazon Machine Image.

    • Recommended: Choose the newest Amazon Linux, as it comes with Amazon-specific tools

  4. Select the Instance Type: how powerful you want the machine to be. For us, we'll choose whatever is free.

  5. Once you're in Configure Instance, this is where you set up the network, group, behaviour, etc. of the instance. (Most of this is usually fine as default.)

  6. Next, you will add storage. Once again, defaults are usually all fine here.

  7. Next you can add tags. These values are whatever you want them to be. They're just ways of organizing your instances and will appear in the instance's UI.

  8. Finally, you can set up Security Group: this is like the firewall for your instance.

    • Important: You want to make sure you have SSH set up here.

  9. When you launch your instance, you'll be asked to create a key pair, which provides you with a secret key to be able to SSH into your instance.

SSH into your EC2 instance

SSH allows you to control a remote machine or server using the terminal.

To SSH into your EC2 instance, run the following command:

ssh -i path/to/pem ec2-user@INSTANCE_PUBLIC_IP
  • -i path/to/pem is simply the path to where you stored the .pem file when you created a new key pair.

  • INSTANCE_PUBLIC_IP can be found in the dashboard of EC2.

Note: If you run this command though, you will receive the following error:

Permission 0644 for 'EC2.pem' are too open.
It is required tha your private key files are NOT accessible by others.

To solve this, you need to update the permissions for that file.

chmod 0400 path/to/pem

Bonus: To connect to your EC2 instance in the browser, you can simply run *EC2 Instance Connect by right-clicking the instance. Behind the scenes, this functionality adds a temporary key to your instance for easy connection.

Security Groups

Security groups are the fundamental of network security in AWS. They control how the inbound and outbound traffic allowed in EC2 machines.

Allow, inbound, and outbound rules

When you click into Security Groups under "Network & Security" in EC2 and then click into any security group, you can edit its inbound and outbound rules.

These rules define how access is defined for your EC2 instance (inbound) and how traffic out of the machine is handled (outbound). By default, anyone with your secret key can SSH into your instance and outbound traffic is 100% enabled.

Exercise: If you want to see how to mess up inbound traffic, you can delete all your inbound rules. Now if you SSH into your EC2 instance, the request will hang and then time out.

Deeper dive

Think of security groups are firewalls that regulate

  • Access to ports

  • Authorized IP ranges

  • Control of inbound traffic

  • Control of outbound traffic

Things to know about security groups:

  • Multiple EC2 instances can share the same security group

  • Security groups are always within the scope of your region

  • Security groups live outside of EC2, so if traffic is blocked, the EC2 instance won't be aware of why

Pro tip: It's a good idea to create a separate security group for SSH access. It's usually the most complex security group you'll set up

region table