ЁЯПл The SchoolтА║ЁЯкк AWSтА║ЁЯЫ╡ рдзрдбрд╛ 08 тАФ Types & pricing: scooters, trucks, рдЖрдгрд┐ standby seats
ЁЯЦ╝я╕П See the drawing + lab ЁЯПа Course home ЁЯМ┐ Branch on GitHub тЬПя╕П View source
ЁЯЦ╝я╕П рдЖрдХреГрддреА рдЖрдгрд┐ labThe drawing + lab рдкреВрд░реНрдг рдкрд╛рдирд╛рд╡рд░ рдЙрдШрдбрд╛ тЖЧOpen full page тЖЧ

ЁЯЫ╡ рдзрдбрд╛ 08 тАФ Types & pricing: scooters, trucks, рдЖрдгрд┐ standby seats

ЁЯУН рддреБрдореНрд╣реА рдЗрдереЗ рдЖрд╣рд╛рдд: 12 рдкреИрдХреА рдзрдбрд╛ 08 ┬╖ рдорд╛рдЧреЗ: lesson-07-what-is-ec2 ┬╖ рдкреБрдвреЗ: lesson-09-connecting


ЁЯУж рдпрд╛ рдмреНрд░рдБрдЪрдордзреНрдпреЗ рдХрд╛рдп рдЖрд╣реЗ

рдзрдбреЗ 01тАУ07, рдЖрдгрд┐ рддреНрдпрд╛рд╕реЛрдмрдд: instance-type рдЪреА рдирд╛рд╡реЗ рд╕рд╣рдЬ рд╡рд╛рдЪрдгреЗ рдЖрдгрд┐ payment plan рдирд┐рд╡рдбрдгреЗ тАФ рдкреНрд░рддреНрдпреЗрдХ AWS bill рдорд╛рдЧрдЪреЗ рджреЛрди рдирд┐рд░реНрдгрдп.

ЁЯзТ 5 рд╡рд░реНрд╖рд╛рдВрдЪреНрдпрд╛ рдореБрд▓рд╛рд▓рд╛ рд╕рдордЬрд╛рд╡рд▓реНрдпрд╛рд╕рд╛рд░рдЦреЗ

рд╡рд╛рд╣рди рдирд┐рд╡рдбрдгреЗ ЁЯЪЧ тАФ рднрд╛рдбреНрдпрд╛рдЪреНрдпрд╛ рдХрд╛рдЙрдВрдЯрд░рдЪреЗ garage, рдХрд╛рдорд╛рдиреБрд╕рд╛рд░:

рдирд╛рд╡ рд╡рд╛рдЪрдгреЗ: t3.micro = family t, generation 3, size micro. рдореЛрдард╛ size = рдиреЗрдордХрд╛ рджреБрдкреНрдкрдЯ: large тЖТ xlarge тЖТ 2xlargeтАж

Payment plan рдирд┐рд╡рдбрдгреЗ ЁЯТ│ тАФ рддреЛрдЪ рдмрд╛рдХ, рддреАрди рдХрд┐рдорддреА:

ЁЯЧ║я╕П рдЖрдХреГрддреА

flowchart TB
    subgraph garage["ЁЯЪЧ pick the vehicle"]
        t["ЁЯЫ╡ t3 - scooter<br/>bursty ┬╖ dev ┬╖ labs"]
        m["ЁЯЪЧ m - sedan<br/>balanced ┬╖ default"]
        c["ЁЯПОя╕П c - race car<br/>CPU-heavy"]
        r["ЁЯЪЪ r - truck<br/>RAM-heavy ┬╖ DBs"]
    end
    subgraph lanes["ЁЯТ│ pick the plan"]
        od["on-demand<br/>flexible ┬╖ priciest"]
        sp["ЁЯОл savings plan<br/>1-3yr promise ┬╖ -70%"]
        spot["ЁЯОЯя╕П spot<br/>-90% ┬╖ 2-min reclaim"]
    end
    rule["ЁЯза steady base тЖТ season ticket<br/>spiky extra тЖТ on-demand<br/>movable work тЖТ spot"]
    garage --> rule
    lanes --> rule

тЭУ рдХрд╛рдп

ЁЯдФ рдХрд╛

Instance рдирд┐рд╡рдб рдореНрд╣рдгрдЬреЗрдЪ cost engineering: рди рдЬреБрд│рдгрд╛рд▒реНрдпрд╛ types рдЖрдгрд┐ рдорд╛рд░реНрдЧрд╛рдВрд╡рд░ рддреЗрдЪ workload 5├Ч рдЬрд╛рд╕реНрдд рдЦрд░реНрдЪрд┐рдХ рд╣реЛрдК рд╢рдХрддреЗ. рдЖрдгрд┐ spot рд╣реА cloud-native рд╢рд┐рд╕реНрддреАрдЪреА рдкреНрд░рд╛рдорд╛рдгрд┐рдХ рдкрд░реАрдХреНрд╖рд╛ рдЖрд╣реЗ тАФ 2 рдорд┐рдирд┐рдЯрд╛рдВрдЪреНрдпрд╛ рд╕реВрдЪрдиреЗрд╡рд░ рдмрд╛рдХ рдЧрдорд╛рд╡рдгреЗ рддреБрдордЪреЗ app рд╕рд╣рди рдХрд░реВ рд╢рдХрдд рдирд╕реЗрд▓, рддрд░ k8s course рдЪреНрдпрд╛ рдзрдбреЗ 02тАУ03 рдордзреНрдпреЗ рддреБрдордЪреНрдпрд╛рд╕рд╛рдареА рдЧреГрд╣рдкрд╛рда рдЖрд╣реЗ.

ЁЯзк рдХрд░реВрди рдкрд╛рд╣рд╛ (рдореЛрдлрдд тАФ рдлрдХреНрдд рджреБрдХрд╛рдирд╛рдд рдкрд╛рд╣рдгреЗ)

# what does a t3.micro actually give you?
aws ec2 describe-instance-types --instance-types t3.micro t3.small m5.large \
  --query 'InstanceTypes[].{type:InstanceType,vcpu:VCpuInfo.DefaultVCpus,memMiB:MemoryInfo.SizeInMiB}' --output table

# today's spot discount in your region (compare with on-demand ~$0.01/hr for t3.micro):
aws ec2 describe-spot-price-history --instance-types t3.micro \
  --product-descriptions "Linux/UNIX" --max-items 3 \
  --query 'SpotPriceHistory[].{az:AvailabilityZone,price:SpotPrice}' --output table

# your account's current desk count (should be 0 after lesson 07's destroy!):
aws ec2 describe-instances --query 'Reservations[].Instances[].State.Name' --output text | sort | uniq -c

тЬЕ рддрдкрд╛рд╕рд╛ тАФ рддреБрдореНрд╣рд╛рд▓рд╛ рдХрд╛рдп рджрд┐рд╕рд╛рдпрд▓рд╛ рд╣рд╡реЗ

aws ec2 describe-spot-price-history --instance-types t3.micro console рдордзреНрдпреЗ рджрд┐рд╕рдгрд╛рд▒реНрдпрд╛ on-demand рдХрд┐рдорддреАрдЪреНрдпрд╛ рдХрд╛рд╣реА рдЕрдВрд╢рд╛рд╡рд░ spot рджрд╛рдЦрд╡рддреЛ.

ЁЯз╣ рд╕рд╛рдлрд╕рдлрд╛рдИ тАФ рдХрд╛рд╣реАрд╣реА рдЪрд╛рд▓реВ рдареЗрд╡реВ рдирдХрд╛

рд╕рд╛рдл рдХрд░рдгреНрдпрд╛рд╕рд╛рд░рдЦреЗ рдХрд╛рд╣реА рдирд╛рд╣реА тАФ рд╣рд╛ рдзрдбрд╛ рдореЛрдлрдд рдЖрд╣реЗ ЁЯОЙ

тЪая╕П рдиреЗрд╣рдореАрдЪреНрдпрд╛ рдЪреБрдХрд╛

тПня╕П рдкреБрдвреЗ

рддреБрдореНрд╣реА рдмрд╛рдХ рднрд╛рдбреНрдпрд╛рдиреЗ рдШреЗрддрд▓рд╛ тАФ рдЖрддрд╛ рддреНрдпрд╛рдЪреНрдпрд╛рдЬрд╡рд│ рдЬрд╛: key pairs, SSH, рдЖрдгрд┐ рдЙрдШрдбреЗ рджрд╛рд░ рдирд╕рд▓реЗрд▓рд╛ рдЖрдзреБрдирд┐рдХ рдорд╛рд░реНрдЧ (SSM).

git checkout lesson-09-connecting

ЁЯЫ╡ Lesson 08 тАФ Types & pricing: scooters, trucks, and standby seats

ЁЯУН You are here: Lesson 08 of 12 ┬╖ Previous: lesson-07-what-is-ec2 ┬╖ Next: lesson-09-connecting


ЁЯУж What's in this branch

Lessons 01тАУ07, plus: reading instance-type names fluently and choosing a payment plan тАФ the two decisions behind every AWS bill.

ЁЯзТ Explain like I'm 5

Picking the vehicle ЁЯЪЧ тАФ the rental counter's garage, by errand:

Reading a name: t3.micro = family t, generation 3, size micro. Bigger size = exactly doubled: large тЖТ xlarge тЖТ 2xlargeтАж

Picking the payment plan ЁЯТ│ тАФ same desk, three prices:

ЁЯЧ║я╕П Diagram

flowchart TB
    subgraph garage["ЁЯЪЧ pick the vehicle"]
        t["ЁЯЫ╡ t3 - scooter<br/>bursty ┬╖ dev ┬╖ labs"]
        m["ЁЯЪЧ m - sedan<br/>balanced ┬╖ default"]
        c["ЁЯПОя╕П c - race car<br/>CPU-heavy"]
        r["ЁЯЪЪ r - truck<br/>RAM-heavy ┬╖ DBs"]
    end
    subgraph lanes["ЁЯТ│ pick the plan"]
        od["on-demand<br/>flexible ┬╖ priciest"]
        sp["ЁЯОл savings plan<br/>1-3yr promise ┬╖ -70%"]
        spot["ЁЯОЯя╕П spot<br/>-90% ┬╖ 2-min reclaim"]
    end
    rule["ЁЯза steady base тЖТ season ticket<br/>spiky extra тЖТ on-demand<br/>movable work тЖТ spot"]
    garage --> rule
    lanes --> rule

тЭУ What

ЁЯдФ Why

Instance choice IS cost engineering: the same workload can cost 5├Ч more on mismatched types and lanes. And spot is the honest test of cloud-native discipline тАФ if your app can't survive losing a desk with 2 minutes' notice, lessons 02тАУ03 of the k8s course have homework for you.

ЁЯзк Try it (free тАФ window shopping)

# what does a t3.micro actually give you?
aws ec2 describe-instance-types --instance-types t3.micro t3.small m5.large \
  --query 'InstanceTypes[].{type:InstanceType,vcpu:VCpuInfo.DefaultVCpus,memMiB:MemoryInfo.SizeInMiB}' --output table

# today's spot discount in your region (compare with on-demand ~$0.01/hr for t3.micro):
aws ec2 describe-spot-price-history --instance-types t3.micro \
  --product-descriptions "Linux/UNIX" --max-items 3 \
  --query 'SpotPriceHistory[].{az:AvailabilityZone,price:SpotPrice}' --output table

# your account's current desk count (should be 0 after lesson 07's destroy!):
aws ec2 describe-instances --query 'Reservations[].Instances[].State.Name' --output text | sort | uniq -c

тЬЕ Verify тАФ what you should see

aws ec2 describe-spot-price-history --instance-types t3.micro shows spot at a fraction of the on-demand price you see in the console.

ЁЯз╣ Clean up тАФ do not leave running

nothing to clean up тАФ this lesson is free ЁЯОЙ

тЪая╕П Common mistakes

тПня╕П Next

You rented the desk тАФ now walk up to it: key pairs, SSH, and the modern no-open-door way (SSM).

git checkout lesson-09-connecting
тЖР Previouswhat is ec2Next тЖТconnecting

This page is the lesson's README from the lesson-08-types-pricing branch, shown here so the whole School stays on one site. Code files open on GitHub at the same branch.