Security Group
Security group controls incoming and outcoming traffic to the resources which are associated with that security group such as your virtual machine, your database, or your load balancer with a firewall. It acts as a virtual firewall
- A resource can associated with multiple security group
- A security group can assigned to multiple resources
- income source can be ip, and it can be security group
If get connection timeout,it may be caused by security group. Check the security group associated with that resource.
SSH to EC2 Instance
Connect to EC2 instance. Click the connect tab of that instance to find public ip address and user name. issue the below. That pem file is generated when
you create the EC2 instance. When create a EC2 instance, it will ask if you want to generate key pair.
If key pair is lost, you can not recover it because AWS does not store a copy of it. If you can only find a private ip, it is inside a vpc. Therefore, need to
vpn to that network and use private ip to connect.
//see bad permission. chmod 400 mykey.pem to fix it
ssh -i EC2-tutorial.pem ec2-user@54.189.138.151
IAM Role
We can attach a IAM role to instance. We can perform some actions after log into the instance based on permissions assigned to that IAM role. Never do aws config inside instance directly
- To see RAM role attached, click security tab
- To attache RAM role, select action drop down and select security option. Then choose Modify RAM role
Instance Types
- General Purpose
- Compute Optimized
- Memory Optimized
- Accelerated Computing
- Storage Optimized ( great for workloads requiring high, sequential read/write access to large data sets on local storage)