Files
acdl/modules/l1/vpc/interface.json
T
Jon Chery a4b17d0f26 fix(P26): resolve multi-resource L1 ref ids in contract resolver
---ci---
project: acdl
phase: 26
milestone: v1.7
status: execute
---/ci---

The microservice pattern (and any L2 referencing multi-resource L1s like
vpc) failed at the adapter stage because the resolver emitted refs using
the child id (e.g. 'vpc') instead of the expanded sub-resource id (e.g.
'vpc-subnet'). The adapter's type_by_id table only knows the sub-resource
ids, so ref:vpc.subnet_ids was an unknown resource id.

Fix:
- contract_resolver.py: child_outputs now maps {outputName -> resourceId}
  instead of just the interface outputs dict. For multi-resource L1s, the
  ref uses the sub-resource id that produces the output. For single-resource
  L1s, the resourceId == childId (unchanged behavior).
- vpc interface.json: the subnet sub-resource output is 'subnet_ids'
  (matching the interface-level output name) instead of 'subnet_id'.
- adapter.py OUTPUT_MAP: aws:ec2:subnet now maps both 'subnet_ids' and
  'subnet_id' to 'id'.

Verification:
  - microservice pattern check-only: PASS (11 resources)
  - static-assets pattern check-only: PASS (4 resources)
  - platform check-only: PASS
  - full test suite: 266 passed
2026-07-22 20:15:59 +00:00

64 lines
1.7 KiB
JSON

{
"name": "vpc",
"version": "1.0.0",
"kind": "l1",
"type": "aws:ec2:vpc",
"description": "VPC primitive (substrate-agnostic stack types aws:ec2:vpc + aws:ec2:subnet + aws:ec2:routetable; the Terraform adapter translates to aws_vpc/aws_subnet/aws_route_table).",
"inputs": {
"cidr": {
"type": "string",
"description": "VPC CIDR block, e.g. 10.0.0.0/16.",
"required": true
},
"azs": {
"type": "string",
"description": "Comma-separated availability zones, e.g. us-east-1a,us-east-1b.",
"required": true
},
"name": {
"type": "string",
"description": "Name tag for the VPC and child resources.",
"required": true
},
"region": {
"type": "string",
"description": "AWS region the VPC is created in.",
"required": true
}
},
"outputs": {
"vpc_id": {
"type": "string",
"description": "The VPC id."
},
"subnet_ids": {
"type": "string",
"description": "Comma-separated subnet ids."
}
},
"nfrs": {},
"resources": [
{
"type": "aws:ec2:vpc",
"description": "The VPC itself.",
"inputs": ["cidr", "name"],
"outputs": ["vpc_id"]
},
{
"type": "aws:ec2:subnet",
"description": "One subnet per availability zone (azs split on comma).",
"inputs": ["cidr", "az", "vpc_id", "name"],
"outputs": ["subnet_ids"]
},
{
"type": "aws:ec2:routetable",
"description": "Route table bound to the VPC with an internet gateway + default route.",
"inputs": ["vpc_id"],
"outputs": []
}
],
"intra_refs": [
{"from": "aws:ec2:subnet.vpc_id", "to": "aws:ec2:vpc.vpc_id"},
{"from": "aws:ec2:routetable.vpc_id", "to": "aws:ec2:vpc.vpc_id"}
]
}