aws meetup 2017-02-09-role-auto-scaling

105
AWS Meetup February 09, 2017 Michael Baker Yeung Siu

Upload: yeung-siu

Post on 14-Apr-2017

62 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Aws meetup 2017-02-09-role-auto-scaling

AWS MeetupFebruary 09, 2017

Michael Baker

Yeung Siu

Page 2: Aws meetup 2017-02-09-role-auto-scaling

Introduction

●AWS access and security

●Autoscaling

●Why cloud computing!

●Demos

●Slides to be posted

Page 3: Aws meetup 2017-02-09-role-auto-scaling

Introduction

●Yeung Siu

○DevOps engineers

○AWS Associate Solution Architect certified

●Michael Baker

○Lead Software Engineer

Page 4: Aws meetup 2017-02-09-role-auto-scaling

AWS Credentials

Page 5: Aws meetup 2017-02-09-role-auto-scaling

Identity & Access ManagementIAM

Page 6: Aws meetup 2017-02-09-role-auto-scaling

Access Keys demo

Page 7: Aws meetup 2017-02-09-role-auto-scaling

IAM User Issue

●No Active Directory domain association.

●No Web Federation

○Google, Facebook, Amazon retail

●Quarterly credential rotation

○Application down time

●Hardcode in source control

Page 8: Aws meetup 2017-02-09-role-auto-scaling

Open Source AWS

Page 9: Aws meetup 2017-02-09-role-auto-scaling

Open Source AWS

Page 10: Aws meetup 2017-02-09-role-auto-scaling

Open Source AWS

Page 11: Aws meetup 2017-02-09-role-auto-scaling

AWS knows

Page 12: Aws meetup 2017-02-09-role-auto-scaling

Rise of the Bots

1. If AWS can find your keys then guess who

else can?

2. AWS keys mining

3. Use your AWS account to do other mining

Page 13: Aws meetup 2017-02-09-role-auto-scaling

IAM Role

Page 14: Aws meetup 2017-02-09-role-auto-scaling

IAM RoleTrust Relationships

Page 15: Aws meetup 2017-02-09-role-auto-scaling

EC2 IAM Role

Page 16: Aws meetup 2017-02-09-role-auto-scaling

Cloudberry

Page 17: Aws meetup 2017-02-09-role-auto-scaling

IAM Role demo

Page 18: Aws meetup 2017-02-09-role-auto-scaling

IAM Role

●No keys embedded into code.

●No need for credential rotation.

●Access to other AWS services.

●Allow secure external 3rd party access.

●Active Directory Federation.

●Web Identity Federation.

○Facebook, Google, Amazon retail

●Cross AWS account accesses

○Control multiple AWS accounts from one central AWS account with AD.

●Can only be associated at EC2 after creation.

○As of Feb. 09 AWS update its service to allow attaching role existing machine.

○Doesn’t work outside of the AWS.

●Application Architecture implementation

Important factors

Page 19: Aws meetup 2017-02-09-role-auto-scaling

AWS Access Control Recommendations

●Use AWS Role as much as you can.

●If not AWS Role then use AWS KMS.

●Recommendation to use HashiCorp Vault.

Page 20: Aws meetup 2017-02-09-role-auto-scaling

Questions?

Page 21: Aws meetup 2017-02-09-role-auto-scaling

AutoScaling

●AWS

●Azure

Page 22: Aws meetup 2017-02-09-role-auto-scaling

Motivation

What do you get with one DevOps Engineer in a room?

Page 23: Aws meetup 2017-02-09-role-auto-scaling

Motivation

What do you get with one DevOps Engineer in a room?

Alone with a 2:00am pager saying a site is down.

Page 24: Aws meetup 2017-02-09-role-auto-scaling

Why Cloud Computing

●No hardware to purchase and refresh

●On demand model

●Easy to scale

Page 25: Aws meetup 2017-02-09-role-auto-scaling

Legacy Cloud

“The first rule of any technology used in a business is that automation applied to

an efficient operation will magnify the efficiency. The second is that automation

applied to an inefficient operation will magnify the inefficiency. ”

Bill Gates

●Do the same thing on a different platform

●Do you use your smartphone to just make phone calls?

Page 26: Aws meetup 2017-02-09-role-auto-scaling

AWS Principal

“Build for failure”

Page 27: Aws meetup 2017-02-09-role-auto-scaling

AWS Vocabulary

●EC2 (Elastic Computing Instances) = Virtual Machines

●ELB (Elastic Load Balancer) = Load Balancer

●Lambda = Serverless compute

●RDS (Relational Database Service) = MySQL, Microsoft SQL server, Oracle,

Aurora, Postgresql

●Route53 = DNS

●S3 (Simple Storage Service) = object storage

●SNS (Simple Notification Service) = Messaging

●More at https://www.expeditedssl.com/aws-in-plain-english

Page 28: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 29: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 30: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 31: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 32: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 33: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 34: Aws meetup 2017-02-09-role-auto-scaling

Traditional Application

Page 35: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless app

Page 36: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless app

Page 37: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless app

Page 38: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless app

Page 39: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless appAWS Terms

Page 40: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless appAWS Terms

Page 41: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless appAWS Terms

Page 42: Aws meetup 2017-02-09-role-auto-scaling

Immutable, Stateless appAWS Terms

Page 43: Aws meetup 2017-02-09-role-auto-scaling

AWS Regions

Page 44: Aws meetup 2017-02-09-role-auto-scaling

AWS Region vs Availability Zones (AZs)

Page 45: Aws meetup 2017-02-09-role-auto-scaling

AWS Region vs Availability Zones (AZs)

Page 46: Aws meetup 2017-02-09-role-auto-scaling
Page 47: Aws meetup 2017-02-09-role-auto-scaling
Page 48: Aws meetup 2017-02-09-role-auto-scaling
Page 49: Aws meetup 2017-02-09-role-auto-scaling
Page 50: Aws meetup 2017-02-09-role-auto-scaling
Page 51: Aws meetup 2017-02-09-role-auto-scaling
Page 52: Aws meetup 2017-02-09-role-auto-scaling
Page 53: Aws meetup 2017-02-09-role-auto-scaling
Page 54: Aws meetup 2017-02-09-role-auto-scaling
Page 55: Aws meetup 2017-02-09-role-auto-scaling
Page 56: Aws meetup 2017-02-09-role-auto-scaling
Page 57: Aws meetup 2017-02-09-role-auto-scaling
Page 58: Aws meetup 2017-02-09-role-auto-scaling
Page 59: Aws meetup 2017-02-09-role-auto-scaling
Page 60: Aws meetup 2017-02-09-role-auto-scaling
Page 61: Aws meetup 2017-02-09-role-auto-scaling
Page 62: Aws meetup 2017-02-09-role-auto-scaling
Page 63: Aws meetup 2017-02-09-role-auto-scaling
Page 64: Aws meetup 2017-02-09-role-auto-scaling
Page 65: Aws meetup 2017-02-09-role-auto-scaling
Page 66: Aws meetup 2017-02-09-role-auto-scaling
Page 67: Aws meetup 2017-02-09-role-auto-scaling
Page 68: Aws meetup 2017-02-09-role-auto-scaling
Page 69: Aws meetup 2017-02-09-role-auto-scaling
Page 70: Aws meetup 2017-02-09-role-auto-scaling
Page 71: Aws meetup 2017-02-09-role-auto-scaling

AutoscalingDetails

Page 72: Aws meetup 2017-02-09-role-auto-scaling

AutoscaleScale Policies

Page 73: Aws meetup 2017-02-09-role-auto-scaling

AutoscaleNotification

Page 74: Aws meetup 2017-02-09-role-auto-scaling

AutoscaleInstances

Page 75: Aws meetup 2017-02-09-role-auto-scaling

AutoscalingActivity History

Page 76: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling Load Testing

●Bee with Machine

○https://github.com/newsapps/beeswithmachineguns

●Siege

○https://github.com/JoeDog/siege

●GOAD

○https://goad.io/

Page 77: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 78: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 79: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 80: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 81: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 82: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 83: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 84: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

Page 85: Aws meetup 2017-02-09-role-auto-scaling

Bee Hive

Page 86: Aws meetup 2017-02-09-role-auto-scaling

Bee With Machine Guns

●Lambda Demo

Serveless style

Page 87: Aws meetup 2017-02-09-role-auto-scaling

Demo

Page 88: Aws meetup 2017-02-09-role-auto-scaling

What happened?CloudWatch Metrics

Page 89: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Take an instance out of the autoscaling group

●Works with Microsoft Windows Servers

○Even Windows 2008 R2 with IIS

●Bootstrap script

●Event driven

○Network

○Disk I/O

●Schedule driven

Things you can do

Page 90: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Treat servers as lives stocks and not pets.

○Servers are commodity and should be short lived.

●High Availability.

○Outage vs lower performance.

●Handle peak traffic.

●Cost

○One big server cost vs little servers.

●AWS Reserved instances and Spot instances cost savings.

Benefits

Page 91: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●On Demand instance

○$0.12 per hour

●Reserved instances

○One year = $0.008 per hour ~ 33% savings

○Three year = $0.005 per hour ~ %58 savings

●Spot instances

○User puts a price and wait for market to match it

○Good message queue or worker nodes

○Can be $0.0031 per Hour

Cost Saving T2.micro

Page 92: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Autoscale configuration

○2 minimum

○6 maximum

●Purchase 2 reserved instances for the 2 minimum.

●Place bids for 2 spot instances.

●Use on demand instances for the last 2.

Cost Saving scenario

Page 93: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Websites

○REST APIs

●RabbitMQ (AMQP) message queue

●MySQL cluster

○Master/slave

●Autoscale of One

Use Cases

Page 94: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Application Performance Monitoring

○DataDog

○NewRelic

○SolarWind

○splunk

●Monitoring

○AlertLogic

●Logging

○ElasticSearch

○AWS X-ray

○CloudWatch

Automation Requirements

Page 95: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●AWS Cloudformation

○JSON

○YAML

●HashiCorp Terraform

Deployment

Page 96: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

1.Create a new base Amazon Machine Image

(AMI)

○Use HashiCorp Packer.io

2.Update Autoscaling configuration to the new

AMI

3.Turn off existing EC2 instances one by one

OS Patch

Page 97: Aws meetup 2017-02-09-role-auto-scaling

AutoscalingEvolution

Page 98: Aws meetup 2017-02-09-role-auto-scaling

Autoscaling

●Elastic Beanstalk

Evolution

Page 99: Aws meetup 2017-02-09-role-auto-scaling
Page 100: Aws meetup 2017-02-09-role-auto-scaling
Page 101: Aws meetup 2017-02-09-role-auto-scaling
Page 102: Aws meetup 2017-02-09-role-auto-scaling

How To Start With AWS

●CloudGuru

○Udemy $10 course

●Monthly AWS webinars

○https://aws.amazon.com/about-aws/events/monthlywebinarseries/

●AWS Associate Solution Architect Certification study guide

○Get AWS certification

●AWS Professional Partner Service

●Daily AWS updates/releases https://aws.amazon.com/new/

●Go to AWS re:invent

●Drawing done at https://cloudcraft.co/

Page 104: Aws meetup 2017-02-09-role-auto-scaling

Links

●Getting Started: https://aws.amazon.com/getting-started

●General Reference: http://docs.aws.amazon.com/general/latest/gr

●Global Infrastructure: https://aws.amazon.com/about-aws/global-infrastructure/

●FAQs: https://aws.amazon.com/faqs

●Documentation: https://aws.amazon.com/documentation/

●Architecture: https://aws.amazon.com/architecture

●Whitepapers: https://aws.amazon.com/whitepapers

●Security: https://aws.amazon.com/security

●Blog: https://aws.amazon.com/blogs

●SlideShare: http://www.slideshare.net/AmazonWebServices

●Github: https://github.com/aws and https://github.com/awslabs

Page 105: Aws meetup 2017-02-09-role-auto-scaling

Happy Ever “Appter”