Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Automating AWS
Search
Andrew Best
July 19, 2016
Programming
2
320
Automating AWS
Using Octopus, Cloud Formation and Powershell DSC to build immutable phoenix environments in AWS
Andrew Best
July 19, 2016
Tweet
Share
More Decks by Andrew Best
See All by Andrew Best
The Surprising Truths Behind Good Mentoring
andrewabest
0
7
Learn Authentication The Hard Way
andrewabest
0
270
Finding The Sweet Spot BNE
andrewabest
1
220
Finding The Sweet Spot
andrewabest
0
390
Conventional Wisdom
andrewabest
1
380
DSC a-b-c's
andrewabest
0
120
AWS a-b-c's
andrewabest
3
140
What is Git?
andrewabest
0
210
Client Side Testing
andrewabest
0
54
Other Decks in Programming
See All in Programming
[PHPカンファレンス沖縄2024]「無理なくできるだけ安全に」テストもないレガシーコードをリファクタリングするテクニック
ikezoemakoto
3
130
Modern Angular with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
110
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
140
게임 개발하던 학생이이 세계에선 안드로이드 개발자?
pangmoo
0
110
Cloud Adoption Framework にみる組織とクラウド導入戦略
tomokusaba
2
570
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
260
レイトレ合宿10 レンダラー紹介 / Renderer Introduction, Ray Tracing Camp 10
shocker_0x15
0
570
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
12
1.6k
20241004 モノタロウ式~ドメインモデリングとリアーキテクチャ
monotaro
PRO
2
360
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
220
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
230
Removing Corepack
yosuke_furukawa
PRO
9
1.2k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
43
5.9k
From Idea to $5000 a Month in 5 Months
shpigford
381
46k
Unsuck your backbone
ammeep
668
57k
Into the Great Unknown - MozCon
thekraken
31
1.4k
Become a Pro
speakerdeck
PRO
24
4.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Writing Fast Ruby
sferik
626
60k
We Have a Design System, Now What?
morganepeng
50
7.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
How to Think Like a Performance Engineer
csswizardry
17
1k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.9k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
Automating AWS
Part 1 Automating Infrastructure
Page Birds-eye view / Copyright ©2014 by Readify Pty Ltd
3 Step 1: Deploy infrastructure Step 2: Bootstrap instances Step 3: Deploy software
Page The infrastructure / Copyright ©2014 by Readify Pty Ltd
4
Page / Copyright ©2014 by Readify Pty Ltd 5 Deploy
Infrastructure Bootstrap Instances Register Tentacle Deploy Software Fire Project Trigger Nothing up my sleeve…
Page / Copyright ©2014 by Readify Pty Ltd 6 Deploy
Infrastructure Bootstrap Instances Register Tentacle Deploy Software Fire Project Trigger Nothing up my sleeve…
Page Step 1: Deploy infrastructure › Deploy.ps1 › Package and
upload bootstrapping resources to S3 › Package and upload configuration variables to S3 › Do we need to deploy a new stack? › Yes - New-CFNStack › No - New-CFNChangeSet › CloudFormation resource creation based on template / Copyright ©2014 by Readify Pty Ltd 7
Page / Copyright ©2014 by Readify Pty Ltd 8 Deploy
Infrastructure Bootstrap Instances Register Tentacle Deploy Software Fire Project Trigger Nothing up my sleeve…
Page Step 2: Bootstrap instances › EC2 userdata › cfn-init.exe
› AWS::CloudFormation::Init › Powershell DSC › Octopus tentacle › tentacle.exe --register-with / Copyright ©2014 by Readify Pty Ltd 9
Page / Copyright ©2014 by Readify Pty Ltd 10 Deploy
Infrastructure Bootstrap Instances Register Tentacle Deploy Software Fire Project Trigger Nothing up my sleeve…
Page Step 3: Deploy software › Prior to Octopus 3.4
=> DSC › Octopus 3.4 => Project Triggers › Software is deployed by Octopus via the Project Trigger › DSC polls a local health check endpoint › ASG waits to be signalled before completion › DSC => cfn-signal.exe › fin / Copyright ©2014 by Readify Pty Ltd 11
Page / Copyright ©2014 by Readify Pty Ltd 12 Deploy
Infrastructure Bootstrap Instances Register Tentacle Deploy Software Fire Project Trigger Nothing up my sleeve…
Part 2 Immutable infrastructure
Page Updating CF stacks What updating stacks used to be
like / Copyright ©2014 by Readify Pty Ltd 14 Are you feeling lucky?
Page / Copyright ©2014 by Readify Pty Ltd 15
Page CloudFormation Change Sets › Supply your updated template to
a Change Set via New-CFNChangeSet › AWS diffs the updated template against the current stack › A detailed list of what changes and what doesn’t is provided › Details the dependency chain and how it is effected / Copyright ©2014 by Readify Pty Ltd 16
Page Immutability › Rev infrastructure package => refresh instances ›
CI + CloudFormation can do this for us › Inject version into Launch configuration userdata › Triggers a replacement of the launch configuration › How do we stay HA while our infrastructure refreshes? / Copyright ©2014 by Readify Pty Ltd 17
Page AutoScaleGroup Update Policies › Allows an ASG to stay
HA while undergoing a refresh › Keeps a number of instances in service while terminating stale and creating fresh instances › Works with cfn-signal.exe to ensure updates are successful › Rolls back on failure / Copyright ©2014 by Readify Pty Ltd 18
Part 3 Phoenix environments The really really cool part!
Page Deploying feature branches › The Dream: › Developer checks
in code on a feature branch › The feature branch is built by our CI service of choice › Once complete, our CI service then invokes Octopus and triggers an isolated stack of hardware to be deployed for it › Once the hardware is ready, the feature branch’s payload is automatically deployed to it by Octopus › From check-in to our feature running on new, isolated compute. Ready to test and destroy when we are done / Copyright ©2014 by Readify Pty Ltd 20
Page Octopus 3.4 › Introduces new features that allow us
to work with a tonne more flexibility in elastic environments › Multi-tenancy › Project Triggers / Auto Deploy Overrides › Machine Policies / Copyright ©2014 by Readify Pty Ltd 21
Page Setup › We have built a new feature ryan
on an isolated feature branch! We push the code up to our repository › Our CI service notices this and creates a release for our feature branch package, with a semver version number 1.0.0-ryan0001 / Copyright ©2014 by Readify Pty Ltd 22
Page Octo 3.4 – Multi-tenancy › We created a tenant
ryan0001for our feature branch –we are using the semver from the built package as a naming convention › Allows us to isolate and group sets of machines within an environment › Allows us to configure projects with tenant-specific variables › Allows us to control what software gets deployed to what sets of machines via triggers within an environment / Copyright ©2014 by Readify Pty Ltd 23
Page Octo 3.4 – Auto Deploy Overrides › We created
an auto deploy override for our feature branch tenant ryan0001 for the feature branch package version 1.0.0-ryan0001 › Part of Project Triggers › Auto Deploy Overrides allow us to say ‘when a project trigger fires, and the machine that triggered it is for a given tenant, deploy an explicit version of the project to the machine, not the default’ / Copyright ©2014 by Readify Pty Ltd 24
Page Octo 3.4 – Machine Policies › When our instances
register with Octopus via tentacle.exe, they indicate a machine policy › When we clean up our CloudFormation, how do we ensure Octopus is cleaned up as well? › Old way: AWS Lambda › New way: Octopus Machine Policies › Healthchecks and unavailable machines › Cleanup unavailable machines / Copyright ©2014 by Readify Pty Ltd 25
Page Living The Dream 26
Thank you Andrew Best | @_andrewb |
[email protected]