Chapter 6 - Elastic Compute Cloud (EC2) Flashcards
What is EC2 what are it’s basic parameters?
EC2 is like a VM (Virtual Machine) hosted in AWS instead of your own data center.
Select the capacity you need right now.
Grow and shrink when you need.
Pay for what you use.
Wait minutes, not months.
What are the basic EC2 pricing options?
On-Demand
Pay by the hour or the second, depending on the type of instance you run.
Reserved
Reserved capacity for 1 or 3 years. Up to 72% discount on the hourly charge.
Spot
Purchase unused capacity at a discount of up to 90%. Prices fluctuate with supply and demand.
Dedicated
A physical EC2 server dedicated for your use. The most expensive option.
What is the AWS Command Line?
The AWS Command Line is the CLI (command line interface) for Amazon Linux.
What distributions of Linux is Amazon Linux based upon?
Amazon Linux 1 & 2 = Combination of Red Hat & Fedora
Amazon Linux 2022 = Fedora with SELinux
AL2022 will have SELinux enabled and enforced by default.
What are some fundamental Amazon Linux commands?
aws configure
Configure the CLI to interact with AWS
ls = list
Example: aws s3 ls
cd = change directory
Example: cd Downloads
chmod 400 filename = change the file’s permissions
Example: chmod 400 MyNVKP.pem
mb = make bucket
Example: aws s3 mb s3://bucketname
What is the basic formatting of Amazon Linux commands?
Format:
aws servicename command
Example:
aws s3 ls
This command would list all the buckets in S3 in an account.
AWS Command Line / Linux Best Practices & Compatibility
The Principle of Least Privilege
Always give your users the minimum amount of access required to do their job.
Use Groups
Create IAM groups and assign your users to groups.
Secret Access Key
You will only see this once! If you lose it, you can delete the access key and secret key and regenerate them. You will need to run the aws configure again.
Don’t Share Key Pairs
Each developer should have their own access key ID and secret access key. Just like passwords, they should not be shared.
Supports Linux, Windows, MacOS
You can install the CLI on your Mac, Linux or Windows PC. You can also use it on EC2 instances.
What is an IAM Role?
A role is an identity you can create in IAM (Identity and Access Management) that has specific permissions.
A role is similar to a user, as it is an AWS identity with permission policies that determine what the identity can and cannot do in AWS.
However, instead of being uniquely associated with one person, a role is intended to be assumable by anyone who needs it.
Are Roles Temporary?
Yes. A role does not have the standard long-term credentials the same way passwords or access keys do. Instead, when you assume a role, it provides you with temporary security credentials for your role session.
What Else Can Roles Do?
Roles can be assumed by people, AWS architecture, or other system-level accounts.
Roles can allow cross-account access. This allows one AWS account the ability to interact with resources in other AWS accounts.
What is the Linux Communication Protocol & Network Port?
SSH = Secure Shell
Port 22
What is the Windows Communication Protocol & Network Port?
RDP = Remote Desktop Protocol
Port 3389
What is the Unencrypted Web Browsing Protocol & Network Port?
HTTP = Hypertext Transfer Protocol
Port 80
What is the Encrypted Web Browsing Protocol & Network Port?
HTTPS = Secure Hypertext Transfer Protocol
Port 443
What is a Security Group in AWS?
Security groups are virtual firewalls for your EC2 instance.