Check out a free preview of the full Introducing DevOps for Developers course
The "Service Directory" Lesson is part of the full, Introducing DevOps for Developers course featured in this preview video. Here's what you'd learn in this lesson:
Erik demonstrates utilizing the previously created technical design document to build a service directory to manage and update resources. A brief walk through of setup instructions and a brief overview of Pulumi are also covered in this segment.
Transcript from the "Service Directory" Lesson
[00:00:00]
>> So what I wanna do now is just I want to as the other part of DevOps, take this, and build something out of it that actually shows us how we get to what we need. So to do that, [LAUGH] we're gonna have to basically go to the command line, and this is where we get to start working [LAUGH].
[00:00:19]
So there's gonna be a couple of things that I wanna kinda start with here, and the first one is just going to be a directory, a place where I can put all of this. Now I'm in a folder right now in a repository, where I have all of my slides and everything like that.
[00:00:38]
But inside of this, I have now created two new directories. My first directory I'm calling service directory, and the second one I'm calling service templates. Don't worry about service templates, we'll get to that in a second, but let's focus on service directory. Just out of curiosity by the name itself, can anyone maybe give me an idea of what this might do?
[00:01:03]
We talked about needing a way of standardizing services, so that we have the ability of giving off-shelf solutions to front-ends and back-ends. And if we're talking about a directory, what we're talking about is, is a location where we can configure everything in one space, and then those things will get deployed throughout all of our infrastructure.
[00:01:23]
And so we call this a service directory. Now, for anyone from my company watching this, it's a generic term, so don't get mad at me [LAUGH]. But it is, this is literally what I use at my current job at Hippo. We have a centralized place where we tell developers you go here, you add what you want, and then it will be deployed for you.
[00:01:46]
And as a matter of fact, that's another big thing we need to add to this is, we need a way for developers, not DevOps, to create cloud resources. No more asking for buckets in Slack. If this happens, you tell them no [LAUGH]. The main reason for that is this, because we have opinions around this specific thing, right?
[00:02:20]
Our front-ends are to get a bucket, I need a bucket. Friend has already got one, don't worry about it. I need two buckets, why? Right? That's the kind of conversations we wanna be able to have. So, first thing I'm gonna need all of you guys to do is basically just create a directory.
[00:02:39]
Just create a directory where we can kind of start working, and start putting all of our files. One other thing is we will need node, so we will need Node.js, does everyone here have node on their computers? All good, cool. Okay. The next thing that you might not have is a Pulumi.
[00:03:03]
And it's actually very easy to get started with, let me go to the documentation here, but we are gonna use Pulumi for automation and i will explain why in a second here. But, if you can, where's the, there's like a downloading of the CLI tool, I don't know why I don't have it.
[00:03:24]
I'll just google, download CLI. Here we go. Cool. So, if you can, do me a favor and download the Pulumi CLI onto your computer please. We will need this, because we are going to make one basic opinionation which is that we're gonna use Pulumi for automation. So yeah, the easiest way to do that is just go to pulumi.com, forward slash docs, forward slash reference, forward slash CLI.
[00:03:58]
And then you can download and install it. If you have Brew, you can just do Brew install Pulumi, you can also download the binary if you want. I would recommend if you're using Brew just to do it the Brew way, that's pretty easy. All right, so, while that's downloading, let's talk really quickly about Pulumi, and kind of what it is, and why we're using it.
[00:04:19]
So Pulumi is basically automation software just like Terraform, or anything similar to it that you might have heard before. The reason why we are using Pulumi instead of something like Terraform is mostly because of what we said right here. We need simple interfaces that allow us to pull off off-the-shelf deployments for a specific service type, right?
[00:04:46]
So what we literally wanna do is we literally wanna use code to describe what these interfaces are gonna look like. Just like a function or a object of some sort with parameters, right? Because what we want to do is this, we want to give the developers that interface to work with, and only that interface to work with.
[00:05:06]
So that when they come in here to add a new front-end, it can easily be done, and we don't have to worry about it. They'll use the interfaces that we decide to them, and then they can just add their block of code that they need to. So, Terraform can do this, I'm not saying that it can't.
[00:05:23]
We actually do this at Hippo with Terraform, except for, one of the reasons why I like Pulumi is that it includes all of it because it's a language. If you were to do this with something like Terraform, you'd find yourself in a scenario where you have to do a lot of auto-generation, because Terraform is not really a language.
[00:05:41]
It's a DSL or a Domain Specific Language, and so there are things that you just can't achieve with it, right? We want to lean on a generic language to be able to start creating these interfaces that we need. So we're gonna do that, and you might need to do one other thing, which is you might need to do an npm install -g for typescript, and then I believe it's tsc.
[00:06:05]
So make sure that you do run that as well so that you do have typescript, because we are technically using typescript here.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops