Skip to content
Dashboard

Framework-defined infrastructure

CTO, Vercel

Programmatic framework understanding for automatic infrastructure provisioning

Link to headingContextualizing infrastructure as code (IaC)

Link to headingWhat is framework-defined infrastructure?

Link to headingApplying framework-defined infrastructure

Flowchart showing the process from user code to automatically inferred infrastructure.Flowchart showing the process from user code to automatically inferred infrastructure.
Flowchart showing the process from user code to automatically inferred infrastructure.
pages/blog/index.tsx
export default function BlogPosts({ posts }) {
return posts.map(post => <BlogPost key={post.id} post={post} />)
}
export async function getServerSideProps() {
const posts = await getBlogPosts();
return {
props: { posts }
}
}

Example of a dynamically-rendered page in Next.js.

pages/blog/index.tsx
export default function BlogPosts({ posts }) {
return posts.map(post => <BlogPost key={post.id} post={post} />)
}
export async function getStaticProps() {
const posts = await getBlogPosts();
return {
props: {posts}
}
}

The change of getServerSideProps to getStaticProps now generates the HTML at build time.

Link to headingServerless in an IaC world

resource "aws_lambda_function" "my_lambda" {
filename = "lambda_function_payload.zip"
function_name = "lambda_function_name"
role = aws_iam_role.iam_for_lambda.arn
handler = "index.test"
source_code_hash = filebase64sha256("lambda_function_payload.zip")
runtime = "nodejs16.x"
environment {
variables = {
foo = "bar"
}
}
}

Creating a Lambda function leveraging HashiCorp Terraform

Link to headingSolving the local development problem for serverless

Comparison of local dev environment with and without framework-defined infrastructure. Comparison of local dev environment with and without framework-defined infrastructure.
Comparison of local dev environment with and without framework-defined infrastructure.

Link to headingFramework-defined infrastructure and immutable deployments

Each commit gets an immutable deployment and generates virtual infrastructure.Each commit gets an immutable deployment and generates virtual infrastructure.
Each commit gets an immutable deployment and generates virtual infrastructure.

Link to headingAcknowledgements

Link to headingFrameworks, not primitives