diff --git a/modules-ir/l1/l1-s3/README.md b/modules-ir/l1/l1-s3/README.md new file mode 100644 index 0000000..23b3cb8 --- /dev/null +++ b/modules-ir/l1/l1-s3/README.md @@ -0,0 +1,40 @@ +# l1-s3 — S3 bucket primitive + +The first real L1 module for the v1.1 spike. Single-purpose, +substrate-agnostic (the IR type is `aws:s3:bucket`, not a Terraform +resource type). + +## Interface (the IR-typed contract) + +See `interface.json`: inputs `bucket_name` + `region` (strings), outputs +`bucket_arn` (arn) + `bucket_name` (string), NFR `versioning` (bool, +default true). + +## IR → Terraform mapping (performed by the adapter) + +The Terraform adapter (`adapters/terraform/adapter.py`) translates this +L1's IR shape to Terraform: + +| IR | Terraform | +|----|-----------| +| `resource.type = aws:s3:bucket` | `resource "aws_s3_bucket" "" { ... }` | +| `resource.inputs.bucket_name` | `bucket = ` arg | +| `resource.inputs.region` | `provider "aws" { region = }` | +| `resource.outputs.bucket_arn` | `output "bucket_arn" { value = aws_s3_bucket..arn }` | +| `resource.outputs.bucket_name` | `output "bucket_name" { value = aws_s3_bucket..id }` | + +The adapter is a thin layer (ARCHITECTURE.md §12.2); it does not own L1 +content — it only translates. + +## Spike instance + +`spike_instance.json` is a concrete stack instance (with values +`bucket_name=acdl-spike-bucket`, `region=us-east-1`) that validates +against `schemas/ir.schema.json`. The adapter consumes this instance +(not the interface contract) to emit Terraform. + +## Versioning (W3.D) + +`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. \ No newline at end of file diff --git a/modules-ir/l1/l1-s3/interface.json b/modules-ir/l1/l1-s3/interface.json new file mode 100644 index 0000000..f215495 --- /dev/null +++ b/modules-ir/l1/l1-s3/interface.json @@ -0,0 +1,36 @@ +{ + "name": "l1-s3", + "version": "1.0.0", + "kind": "l1", + "type": "aws:s3:bucket", + "description": "S3 bucket primitive (substrate-agnostic IR type aws:s3:bucket; the Terraform adapter translates to aws_s3_bucket).", + "inputs": { + "bucket_name": { + "type": "string", + "description": "Globally-unique S3 bucket name.", + "required": true + }, + "region": { + "type": "string", + "description": "AWS region the bucket is created in.", + "required": true + } + }, + "outputs": { + "bucket_arn": { + "type": "arn", + "description": "The S3 bucket ARN." + }, + "bucket_name": { + "type": "string", + "description": "The bucket name (echoes the input)." + } + }, + "nfrs": { + "versioning": { + "type": "boolean", + "description": "Enable S3 versioning (default true).", + "default": true + } + } +} \ No newline at end of file diff --git a/modules-ir/l1/l1-s3/spike_instance.json b/modules-ir/l1/l1-s3/spike_instance.json new file mode 100644 index 0000000..6046920 --- /dev/null +++ b/modules-ir/l1/l1-s3/spike_instance.json @@ -0,0 +1,23 @@ +{ + "version": "1.0.0", + "stack": { + "name": "l1-s3", + "kind": "l1", + "depth": 1 + }, + "resources": [ + { + "id": "s3", + "type": "aws:s3:bucket", + "module": "l1-s3@1.0.0", + "inputs": { + "bucket_name": "acdl-spike-bucket", + "region": "us-east-1" + }, + "outputs": { + "bucket_arn": {"type": "arn", "description": "The S3 bucket ARN."}, + "bucket_name": {"type": "string", "description": "The bucket name."} + } + } + ] +} \ No newline at end of file diff --git a/modules-ir/registry.json b/modules-ir/registry.json new file mode 100644 index 0000000..9c480bd --- /dev/null +++ b/modules-ir/registry.json @@ -0,0 +1,9 @@ +{ + "l1-s3": { + "1.0.0": { + "interface": "modules-ir/l1/l1-s3/interface.json", + "published_at": "2026-07-21T19:00:00Z", + "deprecated": false + } + } +} \ No newline at end of file