- EC2 - Elastic Compute Cloud
- Resizable compute capacity
- Pricing models
- On demand
- Low, flexible, no upfront cost
- Suitable for short term spike
- Reserved
- Suitable for steady state
- Pricing
- Standard reserved instance - 75% cheaper
- Convertible reserved instances - 54% cheaper
- Scheduled reserved instances
- SPOT
- For application have low compute usage
- Upto 90 % cheaper compared to on DEMAND
- Flexible start and end time
- You are not charged for the hour if AWS terminates your instance but are charged if you terminate the instance
- Suitable for fault tolerant or HPC application where downtime on short notice is acceptable. You get 2 minutes notice before an instance is terminated
- SPOT blocks stops an instance from being terminated if the spot pice goes above your max price and you can set this between 1 and 6 hours
- SPOT Fleet is collection of SPOT instance and optionally on demand instances
- Dedicated
- Regulated environment
- Licensing restrictions e.g. oracle doesn't allow multi tenant
- On EBS backed instance, by default Root volume are deleted when instances are terminated but any additional volumes are not
- Termination protection is off by default, you must turn it ON
- Root volumes and additional volumes can be encrypted
- Security groups
- A rule change on a security group takes place immediately
- Security groups are stateful i.e if you all http port 80 in by default it allows port 80 out
- Network access control list (NACL) are state less - you have to explicitly allow in bound and outbound
- Security group you can only allow access but not block access unlike NACL
- Security group everything is blocked by default
- You can attack more than one security group to a EC2 instance
- EBS - Elastic Block Storage
- Persistent block storage volume for use with EC2
- Automatically replicated within the AZ to protect from component failure and offer high availability and durability
- Types
- General purpose SSD
- Provisioned IOPS SSD
- Throughput optimised HDD
- Cold HDD
- Magnetic
- Tip: EBS Volumes should be in same AZ as EC2
- Snapshots point in time copies on S3
- To take snapshot of volumes that serve root, you should stop the instance
- You can create AMI from snapshots
- Virtualisation type -?
- HVM - Hardware assisted virtualisation
- PV - Para virtualisation
- AMI Types -
- Instance store - Ephemeral store
- Cannot be stopped. If underlying storage fails, you loose the data
- EBS backed volume
- Can be stopped. You will not loose the data
- You can reboot both
- ENI vs ENA vs EFA
- ENI Elastic Network Interface - like a virtual network card
- ENA - Ehanced Network
- Elastic Fabric Adapter
- N/W device attached to Ec2 to provide High Performance Computing
- Encrypt a EBS root volume if you didn't encrypt at the time of creating EC2
- Create a snapshot
- Copy the snapshot and enable encryption
- Create an AMI from encrypted snapshot
- Create a EC2 from new AMI
- Hibernate
- RAM contents are persisted on root volume
- Root volume must be encrypted
- Provides a quick boot compared to STOP as OS does not need to be loaded
- Instance id is preserved
- Instance RAM must be less than 150GB
- Instance can't be hibernated for more than 60 days
- Available for on demand and reserved instances
- AWS CloudWatch
- Monitors services and applications performance
- Monitors host level metrics - cpu, disk, status
- Cloud watch monitors performance where CloudTrail monitors api calls in the AWS platform
- CloudWatch with EC2 will monitor events every 5 minutes
- 1 minute interval by turning detailed monitoring
- CloudWatch alarms to trigger notifications
- Roles
- More secure than storing Access keys on EC2
- Easy to manage
- Roles are universal and can be used in any region
- Can be assigned to EC2 after the instance has been created using command line or console
- Metadata
- Using endpoint http://169.254.269.254/latest/meta-data/<property> e.g mac or use /latest/user-data]
- EBS vs EFS (Elastic file System)
- EFS can be shared across multiple EC2 instances
- Storage grows and shrinks automatically up to petabytes
- Pay for the storage you use
- Can support thousands of concurrent NFS connections
- Data is stored across Multiple Azs in a region
- Read after Write concurrency
- FSx for Windows
- Native file system for windows.
- Windows file server for Windows applications like SQL Server, IIS ,Active Directory
- FSx for Lusture
- Managed file system for compute intensive workload like machine learning
- Can store data on S3 as well
- Placement groups
- Name of placement group must be unique within your EC2 account
- You cannot merge placement groups
- You can move instance between placement group through CLI or SDK only. Instance must be in stopped state
- AWS recommends to have homogenous instance in clustered groups
- Clustered
- EC2 instance places in same AZ for low latency and high throughput
- Only certain instance can be launched in clustered
- Spread
- Separate racks, with distinct underlying hardware
- Opposite of clustered
- Partition
- Multiple instance in a partition
- Each partition is on different hardware e.g. racks
- HPC - High Performance Compute
- Data transfer options
- Snowball and Snowmobile
- Datasync - agent on VM to sync data on from data centre into S3, FSA, FSX etc
- DirectConnection - Dedicated Private connection between on prem and AWS
- Compute and Networking
- CPU Or GPU optimised
- Spot instances fleets
- Placement groups
- Enhanced Network adapters
- Enhanced Networking
- Enhanced Fabric adapters
- Storage
- Instance attached
- EFS
- Ephemeral
- Network storage
- S3
- EFS
- FSx for Lusture
- Orchestration and automation
- AWS Batch - to run batch jobs
- AWS Parallel cluster - managed parallel HPC clusters
- AWS WAF - Web Application Firewall
- Monitors HTTP/s traffic to CloudFront, ALB and API Gateway
- Application layer - or layer 7 aware firewall
- Behaviour
- Allow all except the one you specify
- Block all except the one you specify
- Passive mode - count the request that match properties
Comments