<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9" -->

---
title: adam bien's blog | daily.dev
description: A structured approach to organizing AWS CDK v2 projects using the BCE (Boundary-Control-Entity) pattern, implemented as an AIrails skill. The core principle...
canonical: https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: adam bien's blog | daily.dev
og:description: A structured approach to organizing AWS CDK v2 projects using the BCE (Boundary-Control-Entity) pattern, implemented as an AIrails skill. The core principle...
og:url: https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9
og:image: https://api.daily.dev/og/posts/9IJZp9Dm9.png
og:image:alt: adam bien's blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# adam bien's blog

**[Adam Bien](https://daily.dev/sources/adam-bien)** · 2 min read · 0 upvotes · 0 comments

## Summary

A structured approach to organizing AWS CDK v2 projects using the BCE (Boundary-Control-Entity) pattern, implemented as an AIrails skill. The core principle separates stacks (boundary) from constructs (control) and immutable data (entity), mirroring how business applications are structured. Key conventions include: packages named after AWS capabilities, a single CDKApp entry point using typed Java records, pinned regions via a central interface, stack independence via resource interfaces, least-privilege IAM via grant* methods, and deterministic synthesis for reliable testing against CloudFormation templates.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://adambien.blog/roller/abien/entry/aws_cdk_infrastructure_as_business_components_bce_ecb_with>

## Questions this post answers

### How should I structure a Java AWS CDK v2 project to avoid it becoming a flat pile of resources?

Organize the project using the Boundary-Control-Entity pattern: stacks live in boundary and decide which resources deploy together, constructs live in control as stateless reusable factories (preferably interfaces with static methods), and entities hold immutable typed configuration data like build specs. Packages are named after the AWS capability they provision, such as s3, cloudfront, or cognito.

_daily.dev surfaces patterns like this for developers structuring their own CDK codebases._

### How should stacks pass resources to each other in AWS CDK to keep them independent?

A producing stack should pass resource interfaces, such as IBucket or ITable, to consuming stacks rather than passing stack instances directly. This keeps stacks decoupled from one another's internal implementation. Combined with a single entry point that wires stacks in dependency order using typed configuration records, this avoids stacks reading CDK context or environment variables directly.

_following IaC architecture patterns like this helps teams keep CDK codebases maintainable on daily.dev._

### How can I test AWS CDK infrastructure code deterministically without snapshot tests?

Keep synthesis side-effect free, with no SDK calls, timestamps, or randomness during construction, then assert directly on the synthesized CloudFormation template instead of relying on snapshot tests. This makes CDK synthesis reproducible and testable like ordinary application logic rather than opaque infrastructure output.

_developers refining CDK testing strategies can track approaches like this on daily.dev._

## Similar posts on daily.dev

- [From Java EE to Quarkus and LLMs: Adam Bien’s Playbook for Boring, Future‑Proof Systems](https://daily.dev/posts/from-java-ee-to-quarkus-and-llms-adam-bien-s-playbook-for-boring-future-proof-systems-0metu7xbn) · InfoQ · 16 upvotes · 0 comments
- [From clickops to governed IaC: CloudFormation drift detection in practice](https://daily.dev/posts/from-clickops-to-governed-iac-cloudformation-drift-detection-in-practice-velwpwbmh) · AWS · 1 upvotes · 1 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#java](https://daily.dev/tags/java), [#iac](https://daily.dev/tags/iac)

[View this post on daily.dev](https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"adam bien's blog","url":"https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9"},"datePublished":"2026-08-02T06:31:11.890Z","dateModified":"2026-09-13T21:20:38.020Z","description":"A structured approach to organizing AWS CDK v2 projects using the BCE (Boundary-Control-Entity) pattern, implemented as an AIrails skill. The core principle...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d365e8cabb5d95ba36aaa092c23f211d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d365e8cabb5d95ba36aaa092c23f211d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Adam Bien","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Adam Bien","logo":"https://media.daily.dev/image/upload/s--CInnAL-q--/f_auto,q_auto/v1773644276/logos/adam-bien?_a=BAMAMiiu0","url":"https://daily.dev/sources/adam-bien"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"aws,java,iac","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Adam Bien","item":"https://daily.dev/sources/adam-bien"},{"@type":"ListItem","position":3,"name":"adam bien's blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/adam-bien-s-blog-9ijzp9dm9#faq","mainEntity":[{"@type":"Question","name":"How should I structure a Java AWS CDK v2 project to avoid it becoming a flat pile of resources?","acceptedAnswer":{"@type":"Answer","text":"Organize the project using the Boundary-Control-Entity pattern: stacks live in boundary and decide which resources deploy together, constructs live in control as stateless reusable factories (preferably interfaces with static methods), and entities hold immutable typed configuration data like build specs. Packages are named after the AWS capability they provision, such as s3, cloudfront, or cognito. daily.dev surfaces patterns like this for developers structuring their own CDK codebases."}},{"@type":"Question","name":"How should stacks pass resources to each other in AWS CDK to keep them independent?","acceptedAnswer":{"@type":"Answer","text":"A producing stack should pass resource interfaces, such as IBucket or ITable, to consuming stacks rather than passing stack instances directly. This keeps stacks decoupled from one another's internal implementation. Combined with a single entry point that wires stacks in dependency order using typed configuration records, this avoids stacks reading CDK context or environment variables directly. following IaC architecture patterns like this helps teams keep CDK codebases maintainable on daily.dev."}},{"@type":"Question","name":"How can I test AWS CDK infrastructure code deterministically without snapshot tests?","acceptedAnswer":{"@type":"Answer","text":"Keep synthesis side-effect free, with no SDK calls, timestamps, or randomness during construction, then assert directly on the synthesized CloudFormation template instead of relying on snapshot tests. This makes CDK synthesis reproducible and testable like ordinary application logic rather than opaque infrastructure output. developers refining CDK testing strategies can track approaches like this on daily.dev."}}]}
```

