Masterpoint stands with Ukraine. Here’s how you can help Ukraine with just a few clicks. >
Cursor engineers having a team whiteboard discussion about AI agent architecture.
Cursor logo
Masterpoint logo
CASE STUDY SUCCESS STORY

How Cursor Rebuilt Its Terraform Workflow with Masterpoint: 5x Faster Plans, 2x More Deployments

5x
Faster plan time
10 min → 2 min
2.6x
More infrastructure PRs shipped
194 → 500+ per week
91%
Reduction in blast radius
54 → 5 average cloud resources modified per deployment
6x
More Terraform workspaces, now self-service

Executive Summary

Cursor is an applied research AI lab, with products used by over half of the Fortune 500. Cursor’s AWS cloud infrastructure had outgrown the monolithic Terraform architecture it was built on: plans & deployments took 10+ minutes, diffs were noisy and unreadable, and engineers had stopped trusting the system. Masterpoint audited the infrastructure, decomposed the terralith, built an Infrastructure as Code platform with a new scalable architecture, migrated to Spacelift & OpenTofu, and embedded AI agent guardrails so the new architecture sticks, along with a series of platform improvements detailed in the story below. Plans now run 5x faster and engineers ship 2.6x more infrastructure changes every week, all with a 91% reduction in blast radius.

The Problem

Infrastructure That Couldn't Keep Up

By late 2025, Cursor’s Infrastructure as Code (IaC) setup had become one of the biggest friction points in the engineering org. Cursor manages its Amazon Web Services (AWS) infrastructure entirely with Terraform, and that footprint had grown fast. Cursor is no longer just a code editor: the product now extends well beyond the IDE into cloud and background coding agents, automations, agentic workflows, and the training and serving of Cursor’s own frontier models, the Composer family. All of it runs on AWS at massive scale, serving engineering teams of every size, including more than half of the Fortune 500, among them Nvidia, Stripe, Salesforce, PayPal, and Wayfair. Keeping that infrastructure reliable and fast-moving is now core to the business. But like many fast-growing startups, the code behind it had been written quickly and then scaled by copy-paste rather than careful design.

Those early Terraform patterns were replicated at machine speed as engineers dogfooded Cursor. They were copied and instantiated hundreds of times without the architectural guardrails needed to keep the system manageable. The result was a classic terralith: critical infrastructure was managed as a single monolithic production Terraform workspace with over 7,000 resources in one state file.

And because that workspace was so large, it was too slow.

But the problem wasn’t just the lack of speed. It was a lack of engineering confidence in the Infrastructure as Code system. Issues included:

  • The AWS console was used to manually make changes during incidents and these fixes were never rolled into Terraform, and so were later inadvertently reverted.
  • Managing ECS deployments through Terraform caused constant drift in the production terralith, flooding PR diffs with hundreds of unrelated changes.

Over time, the team stopped trusting the system, let alone reading the diffs.

This confusion caused downtime, such as a network firewall change that caused a 10-minute outage that was lost in the noise of Terraform drift.

The existing platform, Terraform Cloud, introduced some friction too:

  • Workspace management relied on manual ClickOps configuration for each new workspace.
  • The SSO experience was inconsistent.
  • TFC’s resource-under-management (RUM) pricing model made it daunting to scale.
The Engagement

What Masterpoint Did

Masterpoint came in for a systematic overhaul, working across the architecture, platform, and developer workflows.

November 2025 - Audit and High Leverage Fixes

The engagement opened with Masterpoint’s audit of Cursor’s infrastructure:

  • cloud environments
  • Infrastructure as Code (IaC) & Terraform architecture
  • CI/CD pipelines
  • networking
  • observability

Within a week, Masterpoint delivered an audit report, a best practices checklist, and a security scan. The findings included IAM duplication accounted for 70% of the production Terraform state and noisy plan diffs caused engineer review fatigue.

The audit phase targeted the highest-leverage fixes first: IAM resource deduplication, workspace trigger and path filter corrections so plans only ran when relevant code changed, and initial breaking up of the monolithic Terraform workspace to begin isolating Staging and Machine Learning infrastructure.

Just one week later, Masterpoint had resolved the IAM duplication, with significant results:

  • Resource Count
    Before8,480
    After4,59345.8% reduction in duplication
  • Mean plan time
    Before488s (8.1 min)
    After296s (4.9 min)39.3% faster
  • P50 plan time (median)
    Before423s (7.1 min)
    After272s (4.5 min)35.7% faster
  • P95 plan time
    Before749s (12.5 min)
    After414s (6.9 min)44.7% faster

This was accomplished without touching the workspace structure, and without any downtime. At the speed and scale Cursor operates, downtime simply isn’t an option. Every improvement had to land safely while the platform kept growing underneath it: even as Masterpoint deduplicated and trimmed resources, Cursor was continuously adding new ones. There was still more the systems could improve on.

December 2025 - Spacelift Migration Begins

With the first phase complete, Masterpoint turned to the platform.

As mentioned above, TFC’s ClickOps workspace management, SSO troubles, and resource-under-management pricing were all inhibiting Cursor’s velocity and growth.

Masterpoint recommended a move to Spacelift to address these issues.

The team kicked off the Spacelift migration in mid-December, starting with the groundwork:

  • naming and tagging standards
  • AWS multi-account IAM role architecture
  • Okta SSO configuration

Rather than migrating everything at once, a low-risk pilot Spacelift stack (the equivalent of a TFC workspace) was used to validate the approach. The end-to-end fully automated pilot project was completed within days.

Masterpoint also began evaluating a full migration from the Terraform runtime to OpenTofu.

January to February 2026 - Bulk Migration & Decomposition of the Monolithic Terraform Workspace

With a plan covering a migration of dozens of TFC workspaces across four phases, the team worked systematically. By late January, the bulk of workspaces had been migrated to Spacelift stacks with no operational downtime for the Cursor engineering organization.

By February, the migration was done. All workspaces had been moved from TFC to Spacelift and the runtime was converted from Terraform to OpenTofu. Migrating to OpenTofu freed Cursor from licensing constraints and unlocked capabilities unavailable or paywalled in Terraform, such as state encryption, OpenTelemetry support, and provider iteration.

In parallel, Masterpoint also continued to decompose the Terraform monolith into more product and domain scoped root modules.

February to May 2026 - AI Agent Guardrails And Additional Improvements

After the migration was completed, Masterpoint continued to improved system usability and speed by:

  • restructuring Route53 DNS API requests into optimized, dedicated Terraform modules to address AWS’ hardcap of 5 requests/second (further reducing critical infrastructure plan time from roughly 5 minutes to under 2 minutes)
  • continuing to break up large state files into narrower root modules, allowing for faster plans and decreased blast radius
  • implementing child module versioning with OCI registries to enable staged rollouts and safer change control of critical TF resources
  • resolving the ECS drift issue by using the “Task Definition Template Pattern”
  • implementing OpenTofu’s OTel tracing to find other performance bottlenecks and set up the Cursor team for longterm visibility into their IaC throughput

Because Cursor’s engineering team uses Cursor to write Terraform, Masterpoint embedded architectural knowledge directly into the codebase as AI agent skills and rules.

This AI context encodes the decisions that AI models cannot anticipate on their own:

  • when to create a new root module vs. extend an existing one
  • how to scope blast radius in a root module
  • how to break up a high blast radius monolithic root module
  • data source patterns and optimizations
  • security practices, such as cloud networking and Terraform/OpenTofu module SHA pinning
  • debugging performance bottlenecks, through methods such as logging and OpenTelemetry traces
  • …and more

Every IaC optimization Masterpoint delivered was paired with instructions to prevent anti-patterns from being reintroduced.

The Results

The Results

Numbers That Matter #

  • Plan time (production)
    Before10 min
    After2 min5x faster
  • Infrastructure PRs shipped per week
    Before194
    After500+2.6x more frequent, up +157%!
  • Median resources affected per Terraform run
    Before54
    After591% reduction in blast radius

Plan time went from 10+ minutes to 2 minutes #

The production workspace plan time dropped from over 10+ minutes, with spikes to 15 minutes, during the November baseline to around 2 minutes by mid-2026.

Deploy time before and after: average plan + apply took 10+ minutes before, 2 minutes now — 5x faster per Terraform run

Deployment frequency increased #

Weekly merged PRs against infrastructure as code went from approximately 194 per week to over 500 a week, a 157% increase. They’ve only accelerated since then.

2.6x more PRs shipped: from 194 changes per week in October 2025 to 500+ in May 2026, a 157% jump in deployment frequency

The productivity lift was significant #

This gain wasn’t from growing the engineering organization in headcount: a controlled same-cohort analysis of 34 engineers active both before and after the Masterpoint engagement found that PR throughput grew by 121%.

  • Cohort throughput
    Pre-engagement63 PRs/wk
    End of Engagement140 PRs/wk+121%
  • Per-active-week cadence
    Pre-engagement5.37 PRs/author/wk
    End of Engagement9.19 PRs/author/wk+71%

Infrastructure became democratized #

Previously, workspace creation required manual ClickOps and admin access. Today, engineers create and manage their own stacks. The number of separately managed modules went from 21 to 100+. Engineers are now creating their own product/domain-scoped infrastructure, with guardrails, instead of jumbling it in the primary monolithic workspace.

Terraform root module workspaces grew from 21 in October 2025 to 141 in May 2026 — up 571% — as self-service workspaces replaced monolithic antipatterns
The Results

What Changed for the Team

Engineers know what an IaC Terraform change will touch #

Before the engagement, engineers couldn’t predict what a change would actually touch in a workspace. A database might live in a workspace named for networking infrastructure, so even finding where something was managed required tribal knowledge. Dependencies between workspaces were just as opaque: touching one piece of infrastructure could ripple into systems that had nothing to do with the change or surface long-standing unrelated drift. Plans intended for one system would silently queue in unrelated workspaces, waiting for the next person to find them with no context on where they came from or whether they were safe to apply.

With smaller, focused stacks, plans are scoped to the change at hand. The median Terraform run now touches just 5 resources instead of 54 — a 91% smaller blast radius — so engineers know precisely what a plan will affect before they run it.

91% reduction in blast radius: a median Terraform run once touched 54 resources, now it averages just 5

Architectural flexibility enables the business and product delivery #

Before the engagement, the terralith made architectural changes expensive and risky. Touching one piece of infrastructure meant disrupting unconnected components.

Now, with narrow stacks each owning a focused piece of infrastructure, the Cursor engineering team moves faster: plan and apply deployments complete faster, reviews are lighter & quicker, and a change to one system carries no risk of breaking another.

New services, providers, and cloud targets can be added as their own stacks, which is a foundation that directly enables expansion into multi-cloud infrastructure as Cursor continues to scale.

Cursor’s agents are set up for future success #

Since Cursor’s engineers rely on Cursor to write their own Terraform, Masterpoint embedded the new architecture into AI agent rules and skills that sit directly within the codebase.

These rules capture the patterns and decisions that LLMs can’t figure out on their own, setting the team up to consistently ship high-quality infrastructure code, now and as the system evolves.

👋 Curious if Masterpoint could help your team too? We partner with engineering organizations across the full spectrum — from unicorn startups to Fortune 500 enterprises — to deliver infrastructure systems and patterns that truly scale. Get in touch and we'll walk through your environment, your roadmap, and see where we can help.

Get a standardized, predictable, and efficient infrastructure management process

Skip the stress and let us organize the mess. Reach out today for a free assessment.

Schedule Your Free Assessment →