From the course: Complete Guide to Serverless Web App Development on AWS
The importance of infrastructure as code - Amazon Web Services (AWS) Tutorial
From the course: Complete Guide to Serverless Web App Development on AWS
The importance of infrastructure as code
- [Instructor] Infrastructure as code is one of the fundamental practices you need when working with serverless applications in productions at scale. It's not just a nice to have, it's essential. Let's start by answering a basic question. What is infrastructure as code? Infrastructure as code means using code written in a high-level programming language to control and define your IT infrastructure. When you treat your infrastructure like code, you can apply the same development techniques that you use for your application code, testing, code reviews, automated deployments. Instead of manually configuring resources by clicking through your cloud provider's console, you define everything in a script. This makes your infrastructure replicable, consistent, and far less prone to errors. For example, in infrastructure as code, you define lambda functions, Kinesis streams, and Dynamos tables in code. This could be in JSON, YAML, JavaScript, Python, or another language, depending on your infrastructure as code's framework. With infrastructure as code, you can automate your infrastructure. No more manual steps, no mistakes from forgotten configurations. Replicate environments, easily deploy identical setups for production testing and development environments. Improve collaboration. Store your infrastructure code in the same repository as your application code. Run it through the same review and testing processes. Track changes. Every change to your infrastructure is logged. You know who made a change, when, and why. Speed up development. Reused infrastructure components from previous projects scale faster with more security and fewer bugs. And here is a big one. One engineer can now manage a massive infrastructure with confidence thanks to automation and repeatability. So how do you use infrastructure as code with AWS? If you're working with AWS, you have several options for implementing infrastructure as code. AWS CloudFormation. It's AWS native infrastructure as code service. AWS SAM, serverless application model, a framework that is designed specifically for serverless applications. AWS CDK, Cloud Development Kit, allows you to define infrastructure using real code like JavaScript or Python. This is the tool we'll focus in this course. Third-party tools like Terraform, Serverless Framework, and others also support infrastructure as code. The specific framework doesn't matter as much as the practice itself. The important thing is to use infrastructure as code. As this is the first chapter in this course, you might still wonder why infrastructure as code is essential for serverless. In serverless, infrastructure and code go hand in hand. When you deploy a Lambda function, you are not just deploying code, you are also deploying the infrastructure it depends on. Without infrastructure as code, managing that infrastructure becomes complex, error-prone and time consuming. With infrastructure as code, it becomes repeatable, scalable, and reliable. So as you dive deeper into this course and you start working with AWS CDK, remember, infrastructure as code is not just a tool. It's a mindset that will make your serverless journey smoother, faster, and more efficient.
Contents
-
-
-
The importance of infrastructure as code3m 44s
-
(Locked)
Understanding AWS CDK3m 37s
-
(Locked)
Advantages of AWS CDK3m 53s
-
(Locked)
Installing and configuring AWS CDK6m 19s
-
(Locked)
Building your first project with AWS CDK4m 46s
-
(Locked)
Creating and deploying a Lambda function with API Gateway using CDK7m 7s
-
(Locked)
Challenge: Add and test a function with API to your project1m 10s
-
(Locked)
Solution: Add and test a function with API to your project2m 57s
-
-
-
-
-
-
-
-
-