-: Infrastructure as Code. 2 2
In this lesson, we're going to talk about 3 3
infrastructure as code, 4 4
which is used for automation and orchestration. 5 5
So let's talk about this IAC or infrastructure as code. 6 6
Essentially infrastructure as code is the ability 7 7
to manage and provision the infrastructure through code 8 8
instead of through manual processes. 9 9
The term infrastructure here is also rather generic. 10 10
It can refer to virtual machines 11 11
that contain servers or clients 12 12
or virtual devices like switches, routers, firewalls, 13 13
and other security appliances. 14 14
To use infrastructure as code effectively, 15 15
we need to also use scripted automation and orchestration. 16 16
Now scripted automation and orchestration 17 17
are used in cloud computing all of the time. 18 18
This allows our development security and operations teams 19 19
or the dev sec ops team 20 20
to rapidly deploy things like a new router, switch 21 21
or even an entire network, 22 22
complete with servers and security devices. 23 23
The best part of all of this is that it is less error prone, 24 24
and it's a lot faster than having our network technicians 25 25
or system administrators building out these things manually. 26 26
The great thing here is that if we use scripted automation, 27 27
we're relying on a computer script 28 28
to do most of the hard work. 29 29
And once you have a well-written script, 30 30
it can be reused over and over again, 31 31
and it will never make a mistake. 32 32
So this allows us 33 33
to get a lot of our deployments done faster 34 34
and in a much more secure way. 35 35
Now, when we're talking about infrastructure as code or IAC, 36 36
it really comes down to three key areas 37 37
when you're doing your implementation. 38 38
This is scripting, security templates and policies. 39 39
Now scripting will let you perform a series of actions 40 40
in a particular order or sequence, 41 41
and it can even include some basic logic 42 42
to ensure the right things are being deployed 43 43
based on the current conditions, 44 44
security templates and policies 45 45
are then going to be deployed, 46 46
and these contain a series of configuration files 47 47
that are applied to the different devices 48 48
being deployed in your environment. 49 49
These might include network settings, 50 50
access control lists, group policies, or permissions. 51 51
Now automation is great, 52 52
but where infrastructure as code really excels 53 53
is through the use of orchestration. 54 54
Orchestration is the process of arranging or coordinating 55 55
the installation and configuration of multiple systems. 56 56
In most implementations, 57 57
it really comes down to running the same task 58 58
on a bunch of different servers or devices 59 59
all at the same time, 60 60
but not always on every single server or device. 61 61
This is where machine learning and logic 62 62
are going to come into play. 63 63
If you're using some robust orchestration, 64 64
that's been properly configured and tested, 65 65
you can lower your overall IT costs, 66 66
speed up your deployments and increase your security. 67 67
So it really becomes a win-win-win for our organizations. 68 68
Now, as an aspiring network technician, 69 69
you might be worried that infrastructure as code 70 70
might put you at a job someday, 71 71
but really it's just being used to automate 72 72
the most boring and tedious portions of your job. 73 73
It is designed to ease your burden 74 74
and allow you to focus on more higher level tasks 75 75
instead of just installing 76 76
a hundred more virtual switches or routers 77 77
using some boring checklist. 78 78
So don't worry, have no fear, 79 79
there is nothing but goodness here 80 80
when it comes to infrastructure as code. 81 81
Also infrastructure as code is the basis of everything we do 82 82
in horizontal scaling or scaling out 83 83
within our cloud environments 84 84
when we need to use elasticity. 85 85
So it is really important to embrace it. 86 86
Now, one of the things you have to be careful of though, 87 87
is that when you're using infrastructure as code, 88 88
people in your organization who believe they might have 89 89
some kind of a special project, 90 90
I like to call these the special snowflakes. 91 91
Remember with infrastructure as code, 92 92
we're trying to embrace standardization, 93 93
templates and scripts. 94 94
So when you have people 95 95
who think they have a special snowflake, 96 96
this can lead to trouble. 97 97
After all, if they have a special snowflake project, 98 98
they believe they have to be able to go 99 99
and create their own infrastructure 100 100
to support their project 101 101
instead of relying on the standard infrastructure 102 102
that you provide to everyone else through IAC. 103 103
These people don't really care about your standardization 104 104
and all of your scripting and all the efficiencies 105 105
that you've already gained by embracing 106 106
infrastructure as code using orchestration. 107 107
Instead, they want to create something as a one-off system. 108 108
And when that happens, 109 109
you end up with this special snowflake 110 110
and these special snowflake systems are any system 111 111
that is different from the standard configuration template 112 112
that's used within your organization's 113 113
infrastructure as code architecture. 114 114
Now, the problem with this is that it adds risk 115 115
to your overall security posture. 116 116
And it also adds a lot of configuration problems 117 117
and long-term supportability problems for you 118 118
because it's a one-off system. 119 119
The lack of consistency that you're going to find 120 120
in a special snowflake system 121 121
is going to lead to a lot of issues for you down the road, 122 122
especially in terms of security 123 123
and your ability to support it 124 124
after it's moved into production. 125 125
This is because you have a one-off system 126 126
and it is by definition unique, 127 127
and it doesn't look or act like 128 128
every other system that you support. 129 129
Think about it this way. 130 130
Pretend you're in a large environment, 131 131
that's operating in the cloud 132 132
and you have thousands upon thousands of virtual machines. 133 133
Now, out of all those virtual machines, 134 134
we have just one that's different. 135 135
When somebody calls up and says 136 136
something isn't working properly. 137 137
Now you have to figure out, 138 138
is it something with that special machine 139 139
that's causing the problem, 140 140
or is this a bigger problem across your entire cloud? 141 141
This is now a really big support issue 142 142
for you and your team 143 143
and it can lead to a lot of security headaches 144 144
in the long run. 145 145
For this reason, I always want to eliminate 146 146
these special snowflakes 147 147
because we want everything to be consistent. 148 148
By keeping things consistent 149 149
and using carefully developed and tested scripts 150 150
we can end up using orchestration 151 151
extremely efficiently and securely, 152 152
which maintains a good, solid baseline for our networks.