Monday, January 14, 2019

AWS Developer Associate - 2

S3 - Simple Storage Service

  1. for files/images/web pages
  2. Fundamentals
    1. Key
    2. Value
    3. Version
    4. Metadata
    5. Subresources - bucket specific configuration
      1. Policies, ACL
      2. CORS - Cross Origin Resource Sharing
      3. Transfer Acceleration
  3. object based, not block storage
  4. HA, DR
  5. file size: 0bytes to 5 TB
  6. Unlimited Storage
  7. HTTP 200 on successful upload
  8. Data Consistency
    1. Read after Write for PUTS of new objects
    2. Eventual consistency for overwrite PUTS
  9. Amazon guarantees 99.9% availability
  10. Amazon guarantees 99.(11 9s) % durability
  11. Tiers/Classes
    1. Regular - can sustain the loss of 2 facilities concurrently
    2. Infrequent Access - low fee, but charged for retrieval
    3. OneZone - 99.5% availability, 20% less cost than regular
    4. Reduced Redundancy Storage: 99.99% durability, ex for thumbnails, may be deprecated
    5. Glacier: Cheap, optimized for infrequent access, takes 3-5 hours to restore data, archives
    6. Intelligent Tiering - unknown access patterns, data not accessed for 30+ days, moved to infrequent, after access, moved to frequent tier, optimized cost
      1. Frequent
      2. Infrequent
  12. Charged for:
    1. Storage/GB
    2. Requests
    3. Storage mgmt - inventory/analytics/tags
    4. Data mgmt - data taken out of S3
    5. Transfer acceleration


AWS Developer Associate - 1

Amazon does not launch new services in all regions.
Normally services are first launched in US-East i.e. North Virginia region

Identity and Access Management

In here you get a custom link for your login(contains random numbers), which you can customize to any unused word you want.

Minimum security that AWS recommends:
  1. Delete root access keys
  2. Enable MFA
  3. Create IAM users
    1. Root account should not be used for anything
    2. Restrict access to users and give them access to what they need
  4. Use Groups to assign permissions
    1. We can also give permissions directly to users
  5. Apply password policy


User creation:
You get username and password for console login and access key and secret access  key for API


EC2

Elastic compute cloud
Provides resizable compute capacity
Payment:
  1.  On Demand - fixed rate by hour (linux by second) - no commitment, no upfront payment, good for learning
  2.  Reserved - commitment for 1 or 3 year, discounted hourly rate, 
    1. Standard RI: cost can be 75% off on demand
    2. Convertible RI: 
    3. Scheduled RI:
  3. Spot - allows you to bid, good for flexible timings, price goes above bid, AWS will terminate and not charge, if you terminate, will be charged
  4. Dedicted hosts - usefull if you have server bound software licenses, regulatory requirement for no multi-tenancy


EC2 Instance types:
FIGHTDRMCPX

EBS

virtual disk
elastic block storage - attach to EC2
is replicated

EBS Types:

General purpose SSD: 10K IOPS burst upto 30K IOPS
Provisioned IOPS SSD: DB, extreme performance, >10K IOPS

Throughput optimized HDD (ST1) : no root volumne, data warehouseing, log processing
Cold HDD (SC1): file server, lowest cost, bootable

To connect to EC2, we use SSH for linux and RDP for windows

Load Balancers: Application(layer 7)/Network(most expensive/perf)/Classic(layer 7 or 4)

504 error is gateway timeout, app did not respond

Use header X-Forwarded-For to find out who the load balancer forwarded ipv4

Route53: DNS service

AWS CLI

aws configure
aws s3 ls
aws s3 mb s3://bucket
aws s3 cp hello.txt s3://bucket

User with CLI access might not need console access, dont give it
Always create groups
Secret access key will be shown only once

Dont use access key, use roles instead

RDS

ElastiCache : in-memory cache, faster than DB
Supported engines:

  1. Memcached
  2. Redis
Backup
  1. Automated
    1-35 days recovery, stored on S3, free
  2. Snapshot
    manually, stored after RDS is deleted
Restoring - is a new RDS instance

Multi AZ - disaster recovery, sync
Read replicas - improve performance, async replication, scaling