Embracing Application-Centric Infrastructure in the Cloud 1

Embracing Application-Centric Infrastructure in the Cloud 1

In the world of cloud computing, managing infrastructure and applications has often been a tale of two philosophies. On one side, we have tools like AWS CloudFormation, born from an engineering mindset focused on certainty and consistency. CloudFormation excels at defining infrastructure as code, ensuring predictable deployments and automated rollbacks. On the other side, Kubernetes emerged from the operations world, emphasizing ad-hoc operations and mitigation for dynamic, containerized applications. While Kubernetes is unparalleled in container orchestration, it traditionally lacked the broader infrastructure management capabilities of CloudFormation.

This divergence has led to toolchain sprawl, inconsistencies, and operational complexities. However, as the definition of “application” evolves to encompass a wider range of tightly coupled resources, a new paradigm is emerging: Application-Centric Infrastructure. This approach, enabled by tools like AWS Cloud Development Kit (CDK), aims to unify infrastructure and runtime management, bringing consistency, manageability, and a domain-driven perspective to cloud deployments.

CloudFormation vs. Kubernetes: Two Philosophies in Action

To understand the shift towards application-centric infrastructure, it’s crucial to appreciate the foundational differences between CloudFormation and Kubernetes:

CloudFormation: Engineering Certainty and Automated Rollback

Kubernetes: Operational Flexibility and Resilience

These contrasting approaches reflect their origins and primary use cases: CloudFormation for foundational infrastructure and Kubernetes for application runtime management.

The Modern “Application”: Vertical Slices as Bounded Contexts

“Traditionally, an ‘application’ in the cloud might have been viewed as a set of containers orchestrated by Kubernetes. However, modern applications are vertical slices of business functionality, often comprising:

  • Containers: Microservices, application logic packaged in containers.
  • Databases: Managed databases like RDS or serverless options like DynamoDB.
  • Storage: Object storage (S3 buckets), block storage (EBS).
  • Networking: VPCs, load balancers, DNS, CDNs.
  • Serverless Functions: Lambda functions for event-driven logic.
  • API Gateways: For managing and securing APIs.
  • Crucially, Security and Least Privilege: Modern applications demand robust security architectures built on the principle of least privilege. This means defining granular roles and permissions to ensure each component of the application only has access to the minimum resources necessary to perform its function. Security is not an afterthought, but a fundamental aspect of application design and deployment.”

Defining an “application” narrowly as just containers ignores its domain-driven scope becomes limiting. A more accurate and useful definition encompasses all tightly coupled logical resources as a bounded context—a self-contained vertical slice with all resources needed to deliver a business capability, regardless of their physical location or type.

Application-Centric Infrastructure: A Domain-Driven Approach

This broader definition of “application” leads to Application-Centric Infrastructure Design. This paradigm shifts the focus from managing individual resources in isolation to organizing infrastructure around logical application boundaries. Key principles include:

Benefits:

This application-centric approach resonates deeply with the philosophy of Domain-Driven Design (DDD). Just as DDD organizes software around bounded contexts and domain logic, application-centric infrastructure organizes cloud resources around logical application domains. This alignment brings clarity, consistency, and a stronger focus on business value to infrastructure management.

AWS CDK: Unifying Infrastructure and Runtime Management

AWS Cloud Development Kit (CDK) emerges as a powerful enabler for application-centric infrastructure. CDK abstracts away the complexities of traditional Infrastructure as Code, allowing you to define both infrastructure and runtime orchestration in a single, unified codebase using familiar programming languages.

By using CDK, teams can move beyond fragmented tools and hybrid approaches, embracing a truly unified stack definition for their applications.

The Evolution of Deployment Tooling

The landscape of cloud infrastructure management has undergone a significant evolution, driven by the increasing complexity of modern applications and the need for more efficient and consistent deployment strategies. Initially, organizations navigated a fragmented ecosystem of specialized tools, leading to operational overhead and inconsistencies. The following below traces the evolution of cloud deployment tooling through three distinct phases, culminating in the emergence of unified stack approaches exemplified by AWS Cloud Development Kit (CDK).

Phase 1: Fragmented Tools – The Era of Specialization, and Silos

In the early days of cloud adoption, organizations often relied on disparate, specialized tools, each addressing a specific aspect of the cloud environment. Two prominent examples were AWS CloudFormation and Kubernetes, each originating from different operational philosophies:

The Result: Toolchain Sprawl and Operational Friction

This fragmented approach led to several challenges:

Phase 2: Hybrid Approaches – Bridging the Divide with Complexity

Recognizing the limitations of fragmented tooling, organizations began adopting hybrid approaches to bridge the gap between infrastructure and application management. A common pattern involved combining:

The Limitations of Hybrid Approaches:

While hybrid approaches offered improvements over fully fragmented tooling, they introduced new complexities:

Phase 3: Unified Stacks with CDK – The Convergence of Infrastructure and Runtime

The current evolution points towards unified stack approaches, where infrastructure and runtime management converge into a single, cohesive codebase. AWS Cloud Development Kit (CDK) exemplifies this Phase 3, offering a powerful framework for defining and managing entire application stacks, from foundational infrastructure to runtime orchestration, within a single, developer-friendly environment.

AWS CDK: Unifying Infrastructure and Runtime Management

AWS CDK acts as an abstraction layer on top of AWS CloudFormation, but fundamentally changes the development experience by:

The Advantages of Unified Stacks with CDK:

(Note: The following seems like specific implementation notes or links)

https://github.com/ondemandenv/odmd-eks/…/simple-k8s-manifest.ts#L10

This single stack will manage the lifecycle and dependencies of all resources inside and out of the EKS cluster, making it a self-contained “stack” that includes all its necessary resources – infrastructure and runtime components. This stack becomes the single source of truth for the application’s environment, mirroring the “bounded context” concept from Domain-Driven Design (DDD).

AWS CloudFormation will maintain the dependencies among all resources in the stack, making sure they are deployed and rolled back in order/sequence to be in a transaction.

THIS IS REAL CODE, With little coding abstraction by parameterization like:

//what branch I am on
const br = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
//configuration based on branch
const imgAndVer = StringParameter.valueForStringParameter(this, '/my-app/' + br );

you can have IDENTICAL CODE on different branches generate and deploy to multiple environments (IDENTICAL LOGIC/FUNCTION manifests with branch specified configure values) for further experimentation, discovery, testing or production with HIGH CONSISTENCY, code comparison by branching, and unit testing, which knocks GitOps out of space!

Above is the root philosophy for https://ondemandenv.dev, which support one more layer abstraction: connecting VPCs across multiple accounts so that each account can deploy k8s manifest thru private subnets with dynamic value/token resolution.