EC2 Flashcards
Here are some EC2 configuration options:
OS: Linux, Windows or MAC OS
CPU: compute power and cores
RAM: how much memory
Storage space: Network-attached (EBS & EFS) or hardware (EC2 Instance Store)
Network card: speed of the card, public IP address
Firewall rules: security group
Bootstrap script (configure at first launch): EC2 User Data
Using an EC2 User Data script you can ____ the instances, meaning you can launch commands when the machine starts.
The script is run as the root user.
bootstrap
The EC2 user data script is only run once when the instance is ____.
first started
EC2 user data is used to automate boot tasks such as:
installing updates
installing software
downloading common files from the internet
just about anything else
AWS instance naming convention - m5.2xlarge
m: instance class
5: generation
2xlarge: size within the instance class
Which EC2 instance type is described below:
- great for a diversity of workloads such as web servers or code repositories.
- balance between compute, memory and networking
general purpose
Which EC2 instance type is described below:
- great for compute-intensive tasks that require high performance, such as:
- batch processing workloads
- media transcoding
- high performance web servers
- high performance computing (HRC)
- scientific modeling and machine learning
- dedicated gaming servers
compute optimized
Which EC2 instance type is described below:
- fast performance for workloads that process large data sets in memory
- use cases:
- high performance, relational/non-relational databases
- distributed web scale cache stores
- in-memory databases optimized for BI
- applications performing real-time processing of big unstructured data
memory optimized
Which EC2 instance type is described below:
- great for storage-intensive tasks that require high, sequential read and write access to large data sets on local storage
- use cases:
- high frequency online transaction processing (OLTP) systems
- relational and NoSQL databases
- cache for in-memory databases (for example, Redis)
- data warehousing applications
- distributed file systems
storage optimized
____ are fundamental to network security in AWS.
They control how traffic is allowed into or out of EC2 instances.
Security groups
Security groups only contain ____ rules.
allow
Security group rules can reference by ____ or by ____.
IP
security group
Security groups act as a ____ on EC2 instances.
They regulate:
- access to ports
- authorized IP ranges - IPv4 and IPv6
- control of inbound network
- control of outbound network
firewall
Security groups can be attached to ____ instances.
multiple
Security groups are locked down to a ____ combination.
region/VPC
If you move to a different Region or VPC, you have to recreate the security group.
Security groups live ____ the EC2, so if traffic is blocked the EC2 instance will not see it.
outside
Best practice is to maintain a separate security group for ____ access.
SSH
If your application is not accessible (time out), then it’s a ____ issue.
If your appication gives a “connection refused” error; then its an ____ issue or its not launched.
security group
application
All EC2 inbound traffic is ____ by default.
All EC2 outbound traffic is ____ by default.
blocked
allowed
Security groups referencing other security groups example.
Identify the port number used for each scenario below:
__ - SSH to log into a Linux instance
__ - FTP to upload files into a file share
__ - SFTP to upload files using SSH
__ - HTTP to access unsecured websites
__ - HTTPS to access secured websites
__ - RDP (Remote Desktop Protocol) to log into a Windows instance
22
21
22
80
443
3389
Never enter your personal aws access id/keys (aws configure) into an EC2 instance.
Other users of your AWS account can retrieve those credentials.
Attach an IAM role to the EC2 instance instead.
Then you can run aws commands from the instance.
EC2 instance purchase options overview:
On-Demand - short workload, predictable pricing, pay by second
Reserved (1 & 3 years)
- Reserved Instances - long workloads
- Convertible Reserved Instances - long workloads with flexible instances
Savings Plans (1 & 3 years) - commitment to an amount of usage, long workload
Spot Instances - short workloads, cheap, can lose instances (less reliable)
Dedicated Hosts - book an entire physical server, control instance placement
Dedicated Instances - no other customers will share your hardware
Capacity Reservations - reserve capacity in a specific AZ for any duration
Which EC2 instance type is described below:
Pay for what you use:
- Linux or Windows - billing per second, after the first minute
- All other operating systems - billing per hour
Has the highest cost but no upfront payment
No long-term commitment
Recommended for short-term and un-interrupted workloads, where you can’t predict how the application will be behave
On-Demand