Files
acdl/modules/l1/ecs-cluster
Jon Chery 031887ec56 refactor(P57): contract surface redesign + rename + .yml repo-wide
Contract surface redesign:
- New top-level fields: id (3-6 char acronym → stack.name), name (full → stack.title),
  infrastructure (map keyed by module name, replaces module:)
- Drop uses: field (dead reference; version pin lives in CI workflow uses: line)
- Drop top-level module/inputs (now nested under infrastructure map)
- Per-module optional version (defaults to latest published from registry)
- Multi-module contracts: one file deploys N modules in one pipeline run,
  resource IDs namespaced with module name to avoid collisions
- stack.schema.json: add optional title field for display name

Rename:
- pipelines/deploy.yaml → pipelines/contract.yml (declarative spec, not a pipeline)
- pipelines/ci.yaml → pipelines/ci.yml
- All 44 .yaml files → .yml repo-wide (contracts, module examples, kyverno policies)
- .acdl/contract.yaml → .acdl/contract.yml

Resolver (core/contract_resolver.py):
- Rewrite resolve() to loop infrastructure map, default version to latest,
  merge module fragments into one stack with namespaced resource IDs
- _latest_version() picks highest non-deprecated from registry
- _namespace_resources() prefixes IDs + rewrites ref: expressions for multi-module
- Single-module path: unprefixed IDs (backward compatible)

Verification:
- 494 tests pass (0 contract-shape failures)
- Local E2E passes (contract → resolver → adapter → local ECS HTTP 200 → outbox)

---ci---
project: acdl
phase: 57
milestone: v1.10.2
status: execute
---/ci---
2026-07-27 21:37:40 +00:00
..

ecs-cluster — ECS Fargate cluster

Module kind: primitive | Version: 1.0.0

An ECS Fargate cluster. The simplest ECS module — one resource, two inputs, two outputs. The cluster is the container orchestration boundary that ecs-service references for task placement.

Resources

Resource Type Purpose
cluster aws_ecs_cluster The ECS Fargate cluster

Inputs

Name Type Required Default Description
name string yes The ECS cluster name
region string yes AWS region the cluster is created in

Outputs

Name Type Description
cluster_arn arn The ECS cluster ARN
cluster_id string The ECS cluster id (name)

Usage

{
  "id": "cluster",
  "type": "aws:ecs:cluster",
  "module": "ecs-cluster@1.0.0",
  "inputs": {
    "name": "acdl-microservice",
    "region": "us-east-1"
  }
}

The cluster_arn output is referenced by ecs-service as its cluster_arn input.

Compliance extension points

  • Container Insights — add configuration { container_insights = "enabled" } for observability (SOC2 CC7.3, DORA ICT risk monitoring).
  • CloudWatch Logs — add a log group with retention policy for cluster-level audit logs (SOX, SOC2 CC7.2.
  • Encryption — add settings { name = "containerInsights", value = "enabled" } and KMS-based encryption for container data (GDPR Art.32).

Examples

Validated example contracts are in examples/. The platform-test pipeline validates them against schemas/contract.schema.json.

Simple

A minimal deployment:

examples/simple.yml

environment: dev
id: clus
infrastructure:
  ecs-cluster:
    inputs:
      name: my-cluster
      region: us-east-1
    version: 1.0.0
name: ecs-cluster

Complex

A production deployment with optional inputs:

examples/complex.yml

environment: dev
id: clus
infrastructure:
  ecs-cluster:
    inputs:
      name: my-production-cluster
      region: us-east-1
    version: 1.0.0
name: ecs-cluster

Versioning

1.0.0 — interface MAJOR, behavior MINOR, lifecycle PATCH. MAJOR bumps require a new registry entry (immutable publication); old entries enter a 12-month deprecation window.