Introducing AWS App Runner
Learn how to get started using AWS App Runner with Pulumi.
AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale.
With Pulumi you can use your favorite programming language to define, deploy and manage resources on any cloud.
Presenters
- Lee ZenVP of Engineering, Pulumi
Show video transcript
Hello, welcome to another episode of Modern Infrastructure Wednesday, I am your host, Lee Zen, and today we’re going to be covering how easy it is to use Pulumi to deploy an application using AWS App Runner. App Runner is a new service from Amazon that lets you deploy a container image or a source code repository as an application without having to do too much around configuring anything. You don’t have to configure load balancers. You don’t have to configure any of that stuff you would typically have to configure. So here you can see I’m running the main.go file. It’s going to create all the necessary resources along with finally the App Runner service. And we’re going to go into all the source code to explain how all this works, but right now you can see what is happening is we’re actually doing the Docker build that’s going to publish. We’re doing the Docker build and then that after the Docker build completes, it’s pushing the image into our ECR repository. And then finally you can see here the update succeeds, and then we actually get the service URL. And so now let’s go take a look at our service and while the service is updating, you can see that it takes a little bit of time not too much, but just a little bit of time to get going here. We’re going to see how our code actually works.
All right. So what’s actually happening here? Let’s look at our deployment.go file which main.go actually calls. So we actually built an Automation API based program and you can see, you know, in the outputs we create this image, we create, you know, these various things, so let’s look at the code. So the first thing we do is we create an ECR repository and here we use auto naming, so it just creates the name. And then next we create a role so that App Runner can actually go ahead and pull the image from our repository. And so we create the role, we give it the correct policy. And then after that, we basically publish our image. You can see here, we have the image resource, and there we actually just feed it the repository credentials. So let’s take a quick look at the Dockerfile of the thing we’re building. It’s just copying that index.html file over. It’s a very simple file. So that’s really all there is to the infrastructure. It’s super simple. So if we look at the Automation API side of things, all we’re doing is doing the usual Automation API stuff. We’re setting up a stack we’re deploying our program and after we pointed out the part where we’re deploying the program right up here and as soon as we are complete as soon as we finished deploying the program we’re going to use the outputs of that program. So namely the image URL and the access rule, and we’ll feed that to App Runner. And that’ll, we’ll basically invoke the create service API call here, and that’s actually what’s going to do the work. So let’s go back to the console and you can see here, we have the app running and voila exactly what we expect to see. So hopefully you enjoyed this demo and really, yeah, like I said, just so easy to get everything running with App Runner and just a few simple lines of code in Pulumi, thanks for watching and have a great day.