You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Project defaults live in `scripts/aws_env.sh`. It pins the AWS region to `us-east-1` and sets default names
73
78
for the S3 bucket, setup stack, SAR applications, and the S3 prefix used for SAR artifacts. These defaults
74
79
are used by `make aws-check`, `make aws-setup`, and `make release`.
75
-
`./scripts/package_layer.sh`keeps the SAR application names in the templates aligned with these defaults; rerun it after changing the app name settings.
80
+
`./scripts/package_layer.sh`renders `dist/template-*.yaml` with SAR application names aligned with these defaults; rerun it after changing the app name settings.
76
81
Set `ENV=dev` to switch to the dev defaults (the `*_DEV` values).
77
82
78
83
Override any of the defaults by exporting:
@@ -100,11 +105,10 @@ S3_BUCKET=your-bucket make release
100
105
101
106
It:
102
107
- builds and packages both architectures
103
-
-updates the templates'`SemanticVersion` to the bundled AWS CLI v2 version
108
+
-generates `dist/template-*.yaml` with`SemanticVersion` set to the bundled AWS CLI v2 version
104
109
- checks for an existing Git tag
105
-
- if missing, commits the templates, tags the repo, and creates a GitHub release with versioned artifacts
106
110
- publishes the SAR applications with `sam package`/`sam publish`
107
-
-updates `template.yaml` with the arm64/amd64 ApplicationIds and publishes the wrapper application
111
+
-renders the wrapper template with the arm64/amd64 ApplicationIds and publishes the wrapper application
108
112
- uploads SAR artifacts under `S3_PREFIX/<version>/<arch>`
109
113
110
114
To check whether a release is needed without building anything, run:
@@ -189,7 +193,7 @@ To run in GitHub: Actions -> Release -> Run workflow.
189
193
190
194
Manual fallback:
191
195
1. Ensure `ARCH=all ./scripts/package_layer.sh` has been run so the versioned artifacts are created.
192
-
2. Tag the release in Git. Use the AWS CLI version as the tag to match the templates' `SemanticVersion`.
196
+
2. Tag the release in Git. Use the AWS CLI version as the tag to match the generated templates' `SemanticVersion`.
193
197
194
198
## Publish to SAR
195
199
@@ -208,17 +212,17 @@ To publish all three SAR applications (arm64, amd64, wrapper) in order:
208
212
make publish-all
209
213
```
210
214
211
-
`publish-all`requires the wrapper ApplicationIds to be populated in `template.yaml`.
215
+
`make publish-wrapper` and `make publish-all`generate the wrapper template with the correct ApplicationIds automatically.
212
216
213
-
To publish the wrapper application after updating the ApplicationIds, run:
217
+
To publish the wrapper application, run:
214
218
215
219
```sh
216
220
make publish-wrapper
217
221
```
218
222
219
-
If you want the raw SAM commands instead:
223
+
If you want the raw SAM commands for the per-arch apps:
220
224
221
-
1. Build and package the layer (this updates the templates'`SemanticVersion`to match the bundled AWS CLI version):
225
+
1. Build and package the layer (this generates `dist/template-*.yaml` with`SemanticVersion`set to the bundled AWS CLI version):
222
226
223
227
```sh
224
228
./scripts/build_layer.sh
@@ -229,53 +233,35 @@ If you want the raw SAM commands instead:
229
233
230
234
```sh
231
235
sam package \
232
-
--template-file template-arm64.yaml \
236
+
--template-file dist/template-arm64.yaml \
233
237
--s3-bucket "$S3_BUCKET" \
234
238
--s3-prefix "sar/<version>/arm64" \
235
-
--output-template-file packaged-arm64.yaml
239
+
--output-template-file dist/packaged-arm64.yaml
236
240
237
241
sam package \
238
-
--template-file template-amd64.yaml \
242
+
--template-file dist/template-amd64.yaml \
239
243
--s3-bucket "$S3_BUCKET" \
240
244
--s3-prefix "sar/<version>/amd64" \
241
-
--output-template-file packaged-amd64.yaml
245
+
--output-template-file dist/packaged-amd64.yaml
242
246
```
243
247
244
248
3. Publish to SAR:
245
249
246
250
```sh
247
-
sam publish --template packaged-arm64.yaml
248
-
sam publish --template packaged-amd64.yaml
251
+
sam publish --template dist/packaged-arm64.yaml
252
+
sam publish --template dist/packaged-amd64.yaml
249
253
```
250
254
251
-
4.Update the wrapper template with the architecture application IDs and publish it:
255
+
4.Publish the wrapper application (it is rendered with the architecture application IDs):
Copy file name to clipboardExpand all lines: README.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,14 @@
17
17
-`layer/opt`: staged layer contents for the host architecture
18
18
-`scripts/`: build, package, and smoke test scripts
19
19
-`docker/Dockerfile`: build image for Amazon Linux 2023 (arm64, x86_64)
20
-
-`template.yaml`: SAR wrapper application (arm64 + amd64)
21
-
-`template-arm64.yaml`, `template-amd64.yaml`: SAR application templates (SAM)
20
+
-`template/template.yaml`: source SAR wrapper template (arm64 + amd64)
21
+
-`template/template-arm64.yaml`, `template/template-amd64.yaml`: source SAR application templates (SAM)
22
+
-`template/aws-setup.yaml`: CloudFormation stack for SAR setup
23
+
-`dist/template-*.yaml`: generated publish/release templates (ignored in git)
24
+
-`USAGE.md`: runtime contract and manual publishing
25
+
-`DEVELOPMENT.md`: build and release workflow
22
26
-`SAR_README.md`: SAR application README shown to end users
23
-
-`runtime-tutorial/`: minimal handler example
24
-
-`docs/`: usage and development notes
27
+
-`examples/`: minimal handler example
25
28
26
29
## Build the layer
27
30
@@ -39,7 +42,9 @@ The build image uses `curl-minimal` to keep dependencies small. If the AWS CLI d
39
42
40
43
The outputs are `dist/lambda-shell-runtime-arm64.zip` and `dist/lambda-shell-runtime-amd64.zip`, each containing
41
44
`bootstrap`, `bin/`, `aws-cli/`, and `lib/` at the zip root (Lambda mounts them under `/opt`).
42
-
`./scripts/package_layer.sh` also writes versioned artifacts named `dist/lambda-shell-runtime-<arch>-<aws-cli-version>.zip` and updates the `SemanticVersion` in both templates to match the bundled AWS CLI v2 version.
45
+
`./scripts/package_layer.sh` also writes versioned artifacts named `dist/lambda-shell-runtime-<arch>-<aws-cli-version>.zip`
46
+
and generates `dist/template-*.yaml` with `SemanticVersion` set to the bundled AWS CLI v2 version and `ContentUri` pointing
47
+
at the packaged zips.
43
48
44
49
## Smoke test
45
50
@@ -53,7 +58,7 @@ The outputs are `dist/lambda-shell-runtime-arm64.zip` and `dist/lambda-shell-run
53
58
- Architecture: `arm64` or `x86_64`
54
59
- Handler: `function.handler` (script stored as `function.sh` in your function package)
55
60
56
-
See [SAR_README.md](SAR_README.md) for end-user SAR installation and quick start, [docs/USAGE.md](docs/USAGE.md) for manual publishing and the runtime contract, [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for build and release workflow, and [runtime-tutorial/README.md](runtime-tutorial/README.md) for a deployable example.
61
+
See [SAR_README.md](SAR_README.md) for end-user SAR installation and quick start, [USAGE.md](USAGE.md) for manual publishing and the runtime contract, [DEVELOPMENT.md](DEVELOPMENT.md) for build and release workflow, and [examples/README.md](examples/README.md) for a deployable example.
57
62
58
63
## Publish to SAR
59
64
@@ -66,22 +71,22 @@ Set `S3_BUCKET` to an S3 bucket in your account and run:
66
71
67
72
```sh
68
73
sam package \
69
-
--template-file template-arm64.yaml \
74
+
--template-file dist/template-arm64.yaml \
70
75
--s3-bucket "$S3_BUCKET" \
71
76
--s3-prefix "sar" \
72
-
--output-template-file packaged-arm64.yaml
77
+
--output-template-file dist/packaged-arm64.yaml
73
78
74
-
sam publish --template packaged-arm64.yaml
79
+
sam publish --template dist/packaged-arm64.yaml
75
80
76
81
sam package \
77
-
--template-file template-amd64.yaml \
82
+
--template-file dist/template-amd64.yaml \
78
83
--s3-bucket "$S3_BUCKET" \
79
84
--s3-prefix "sar" \
80
-
--output-template-file packaged-amd64.yaml
85
+
--output-template-file dist/packaged-amd64.yaml
81
86
82
-
sam publish --template packaged-amd64.yaml
87
+
sam publish --template dist/packaged-amd64.yaml
83
88
```
84
89
85
90
Each SAR application publishes a single layer output (`LayerVersionArn`) for its architecture.
86
-
`./scripts/package_layer.sh` updates the templates' `SemanticVersion` to match the bundled AWS CLI v2 version; review and commit the change for each release.
87
-
The wrapper application in `template.yaml` references both architecture-specific apps; `make release` and `make aws-setup` publish it after the per-arch apps.
91
+
Generated templates live under `dist/` and are not committed; the source templates stay static.
92
+
The wrapper application is rendered at publish time with the current per-arch ApplicationIds; `make release` and `make aws-setup` publish it after the per-arch apps.
0 commit comments