AWS Builder Center

Don't Live With Broken Windows

How ignoring small problems hurts our systems and applications in the long term. Based on the "Broken Window Theory" from The Pragmatic Programmer.

Fullstack Developer
In their book, The Pragmatic Programmer, Andy Hunt and Dave Thomas introduce a concept borrowed from criminal psychology. When a window in a building is broken and left unrepaired, it sends a message that no one is monitoring or concerned with the structure. This invitation to break more windows quickly transforms into a spiral of neglect, marked by increasing instances of vandalism and structural decay.
The same applies to software, specifically cloud infrastructure.
  • A poorly written, difficult-to-understand piece of code.
  • A lax IAM policy that offers excessive permissions.
  • A workaround created with the intention of addressing it later that never gets touched.
Each of these situations is a broken window, capable of initiating a cascade of degradation. Once they begin to pile up, it's easy to fall into a mode of resigned apathy: "This entire system is a mess; why should I even bother trying to make it better?"
Your approach should be simple: see a broken window, fix it. If you're unable to make a complete and proper repair right away, at least patch it up temporarily—comment out the faulty code, add a helpful "To be implemented" note, or otherwise take action to prevent further damage.



Broken Windows in AWS

Here are a few concrete examples of broken windows you might encounter in an AWS environment:
The Broken Window
The Natural Consequence
S3 bucket set to "public" for "testing"
Other teams and individuals infer that security is optional; they replicate the behavior.
Console manual change instead of code
Infrastructure configuration drift. Nobody can be sure what's actually deployed.
IAM policy copy with  *  permissions
"It's just easier for now." This creates an obvious security hole.
Unpatched AMI (Amazon Machine Image)
"We'll get to it soon." The maintenance is deferred indefinitely.
Complex, undocumented CloudFormation stack
"If it ain't broke, don't touch it." Until, inevitably, it breaks and becomes unfixable.
Each of these represents a broken window that, left unchecked, will proliferate. Team effort declines, and quality erodes.



How to Combat Broken Windows

Fix it immediately. If you identify a broken window, do your best to repair it. If a proper fix isn't feasible in the moment, focus on mitigating the damage—comment code, add TODO tags, note the issue.
Don't be the one who makes the first scratch. Before introducing a change, take a moment to ask if you're adding a broken window yourself. Discipline starts at the individual level.
Write infrastructure as code. Period. Every manual change made in the AWS console is a broken window begging to be smudged by another.
Implement guardrails. Use AWS Organizations' Service Control Policies (SCPs) and AWS Config Rules to proactively prevent many broken windows from appearing in the first place.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article