Skip to content
Dashboard

Framework-defined infrastructure

CTO, Vercel

Programmatic framework understanding for automatic infrastructure provisioning

Copy link to headingContextualizing infrastructure as code (IaC)

Copy link to headingWhat is framework-defined infrastructure?

Copy 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.

Copy 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

Copy 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.

Copy 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.

Copy link to headingAcknowledgements

Copy link to headingFrameworks, not primitives

Ready to deploy?