in this lecture on deployment I'm going to look at the concept of infrastructure 2
as code, continuous deployment and continuous application deployment and 3
application and infrastructure deployment look at the options available 4
for updating our applications and our infrastructure and also look at the 5
concept of blue/green deployments 6
infrastructure as code and this is something that you'll hear a lot in any 7
conversation around AWS and that allows our infrastructure to you managed in the 8
same way as we would software code for example we might have a cloud formation 9
template and that is simply a JSON text file and we can manage that we virtually 10
try as we would any other code so example of that of course a cloud 11
formation template as I've said is a good example of that but also the cloud 12
formation designer and that's another really good tool that not only has cloud 13
formation templates but also has a graphical user interface that allows for 14
drag-and-drop creation of flowcharts that define our cloud formation template 15
we can also look at having a version control around our am is so continuous 16
deployment of our application now that is around the automated delivery of 17
production ready code and it allows rapid deployment and rollback if 18
necessary so examples of continuous deployment include code commit which is 19
AWS as a git repository or git repository service we have code pipeline 20
which is another very very good tool for developers which allows you to define a 21
pipeline of stages for releases and what is required for a release to progress to 22
the next stage through to a production release we have elastic Beanstalk which 23
allows for very rapid deployment of any updated code 24
you the infrastructure that is a find on elastic Beanstalk 25
we have opsworks which uses chef recipes to define our application and we also 26
have elastic container services which use docker containers we can also have 27
continuous deployment of both our application and our infrastructure and 28
examples of that again our code pipeline kokum int elastic Beanstalk because we 29
can actually make changes in elastic Beanstalk to our infrastructure as well 30
as changes to our application code and chef recipes in opsworks can define our 31
infrastructure as well as our application and of course containers in 32
the docker containers in the ECS service we can also have hybrid 33
deployments and that is quite common where we would separate our 34
database from our application layer or parts of our application our 35
infrastructure deployments and that will create a hybrid deployment and would 36
really focus on continuous deployment of those areas that are changing and really 37
keeping stable our areas that are not necessarily changing that often such as 38
our database so the options available for us for updating our application so 39
we can look at pre-baking AMIs and that's that's certainly an option but 40
not a great option where you would just keep creating another ami every time 41
your application code up updates it's a slow way of doing that and the 42
expensive way of doing that we can look at an in-place up upgrades where we use 43
live ec2 instances and we apply updated code to those live ec2 instances and we 44
could also look at disposable upgrades and they're quite handy because we can 45
roll out new ec2 instances with our new code and then when that is up and 46
running and stable then we can terminate our older instances and that allows for 47
a more staged deployment and allows us to progress slowly across until we've 48
got all of our ec2 instances upgraded to our our new code 49
another concept that we need to be aware of is Bluegreen deployments and they are 50
staged rollouts from an existing blue environment while testing a new green 51
environment it uses the main name service it will use route 53 to entry to 52
increase traffic to a green environment from a blue environment in a staged 53
process so what that means is if we look at the diagram there we can start off 54
with ninety percent of our traffic going to the blue existing environment and 55
then just put ten percent of our traffic over to the new green environment and 56
then slowly shift that over from you know we might make it eighty then 20 and 57
then seventy years thirty until such a point that we've got all of our traffic 58
going over to our green environment and that is very good from a risk management 59
perspective because we're not exposing us 100% at our at our end-users to any 60
problems but it does require doubling up on our resources so it is expensive from 61
expect from the point of that at a certain point in time or for a certain 62
period of time we need to have two environments running at the same time so 63
that brings us at the end of our lecture on deployment I'll see you in the next 64
lectures