Skip to content

Commit e0280c2

Browse files
committed
test(golden): add sentinel template directories
Three sentinel cases (SAM, CFN, LE-foreach) used by the harness in the next commit. Each case carries metadata.yaml + README.md + src/app.py. Pinned outputs (expected.*.yaml) are generated by update_goldens.py once the harness is in place.
1 parent 6562529 commit e0280c2

13 files changed

Lines changed: 72 additions & 0 deletions

File tree

tests/golden/__init__.py

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# foreach_static_zip
2+
3+
Sentinel LE case. `Fn::ForEach` over a static collection with all expanded
4+
functions sharing the same `CodeUri`. Locks the expanded-template shape
5+
(`AlphaFunction`, `BetaFunction` inlined as siblings, ForEach key gone)
6+
and the post-package shape (each function's `CodeUri` rewritten to the
7+
same `s3://golden-bucket/<sha256>`).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language_extensions: true
2+
description: "Sentinel: Fn::ForEach over static collection, shared CodeUri."
3+
issue_refs: []
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def handler(event, context):
2+
return {"ok": True}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Transform:
3+
- AWS::LanguageExtensions
4+
- AWS::Serverless-2016-10-31
5+
6+
Resources:
7+
Fn::ForEach::Workers:
8+
- WorkerName
9+
- - Alpha
10+
- Beta
11+
- ${WorkerName}Function:
12+
Type: AWS::Serverless::Function
13+
Properties:
14+
Handler: app.handler
15+
Runtime: python3.11
16+
CodeUri: ./src/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# lambda_function_zip
2+
3+
Sentinel non-SAM case. Raw `AWS::Lambda::Function` with `Code: ./src/`. Locks
4+
the post-package output shape after the CFN-resource-list packageable walker
5+
rewrites `Code` to `s3://golden-bucket/<sha256>`.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language_extensions: false
2+
description: "Sentinel: raw AWS::Lambda::Function with local Code path."
3+
issue_refs: []
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def handler(event, context):
2+
return {"ok": True}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
3+
Resources:
4+
HelloFunction:
5+
Type: AWS::Lambda::Function
6+
Properties:
7+
FunctionName: hello
8+
Runtime: python3.11
9+
Handler: app.handler
10+
Role: arn:aws:iam::123456789012:role/lambda-role
11+
Code: ./src/
12+
MemorySize: 128
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# serverless_function_zip
2+
3+
Sentinel SAM case. Vanilla `AWS::Serverless::Function` with local `CodeUri`
4+
pointing at a ZIP-packaged source dir. Locks the post-build `template.yaml`
5+
shape (artifact path normalized to `<<BUILT_ARTIFACT>>`) and post-package
6+
shape (CodeUri rewritten to `s3://golden-bucket/<sha256>`).

0 commit comments

Comments
 (0)