@srobroek/pi-aws-guidance 0.0.0-stage → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/LICENSE +202 -0
- package/README.md +98 -2
- package/package.json +27 -4
- package/skills/aws-guidance/SKILL.md +15 -0
- package/skills/aws-guidance/references/cdk.md +149 -0
- package/skills/aws-guidance/references/lambda.md +80 -0
- package/skills/aws-guidance/references/service-clients.md +74 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
## aws [0.9.1](https://github.com/srobroek/harness-plugins/compare/aws--v0.9.0...aws--v0.9.1) (2026-11-23)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **whats-new:** grant MCP tools to the whats-new research agent ([8ae7fe0](https://github.com/srobroek/harness-plugins/commit/8ae7fe05c65e2df2f53ebf944c8f9bd5b7625cf9))
|
|
6
|
+
|
|
7
|
+
## aws [0.9.0](https://github.com/srobroek/harness-plugins/compare/aws--v0.8.1...aws--v0.9.0) (2026-11-23)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **project:** port content plugins to Pi ([5b0d32a](https://github.com/srobroek/harness-plugins/commit/5b0d32abbe2faf67934ca1d8e3b53f9eca0cee01))
|
|
12
|
+
|
|
13
|
+
## aws [0.8.1](https://github.com/srobroek/harness-plugins/compare/aws--v0.8.0...aws--v0.8.1) (2026-11-23)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* make every plugin agent's OMP form correct ([96b7bfe](https://github.com/srobroek/harness-plugins/commit/96b7bfea3c35017b34a28f59e81fb059f6c68a24))
|
|
18
|
+
|
|
19
|
+
## aws [0.8.0](https://github.com/srobroek/harness-plugins/compare/aws--v0.7.1...aws--v0.8.0) (2026-11-22)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **delivery:** ship the orchestrator agent ([#121](https://github.com/srobroek/harness-plugins/issues/121)) ([53f33c0](https://github.com/srobroek/harness-plugins/commit/53f33c016315732220a7c87066267931ee87f514))
|
|
24
|
+
|
|
25
|
+
## aws [0.7.1](https://github.com/srobroek/harness-plugins/compare/aws--v0.7.0...aws--v0.7.1) (2026-11-21)
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **code-challenge:** close dogfood friction in skill, schema and validation ([043a8b3](https://github.com/srobroek/harness-plugins/commit/043a8b39057ec8fca54d09adebb0532c2154e330))
|
|
30
|
+
|
|
31
|
+
# Changelog
|
|
32
|
+
|
|
33
|
+
## [0.7.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.6.0...aws--v0.7.0) (2026-11-20)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* plugin scan fixes, wider agent access and the plugin-audit plugin ([9c71525](https://github.com/srobroek/opencode-plugins/commit/9c7152559776aaf80cfed9626d78bafdd845fa9a))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* **aws:** route repository secrets to project-secrets ([d3f2e51](https://github.com/srobroek/opencode-plugins/commit/d3f2e5171218cc9bd674f16d5fbfb5db6349f9f0))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Refactors
|
|
47
|
+
|
|
48
|
+
* **lib:** one MCP tool grant table for the tools option ([f8cc1d8](https://github.com/srobroek/opencode-plugins/commit/f8cc1d817d62b211b712d1889200f7c91f049c89))
|
|
49
|
+
|
|
50
|
+
## [0.6.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.5.0...aws--v0.6.0) (2026-11-19)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* **toolchain:** prescriptive testing and quality concerns for every language ([2cbcb66](https://github.com/srobroek/opencode-plugins/commit/2cbcb66c2e4589eccf2553d324d83680744cd6d7))
|
|
56
|
+
|
|
57
|
+
## [0.5.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.4.0...aws--v0.5.0) (2026-11-12)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* **quality:** OpenFeature flags with a flags.yaml, SSM or AppConfig provider; code and storage guidance ([20baffa](https://github.com/srobroek/opencode-plugins/commit/20baffae842836d814f1f5c3e2cd410c5bde0dd4))
|
|
63
|
+
* **quality:** research-first engineering standards and per-language library standards for every coding agent ([09e8d46](https://github.com/srobroek/opencode-plugins/commit/09e8d461bb2b7654788a588ef6932929ff564d28))
|
|
64
|
+
|
|
65
|
+
## [0.4.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.3.0...aws--v0.4.0) (2026-11-10)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Features
|
|
69
|
+
|
|
70
|
+
* **aws:** pool the aws-pricing MCP server across directories ([64f77a0](https://github.com/srobroek/opencode-plugins/commit/64f77a05bb15c93ca0672474ed048a0a499b7564))
|
|
71
|
+
|
|
72
|
+
## [0.3.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.2.0...aws--v0.3.0) (2026-10-27)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Features
|
|
76
|
+
|
|
77
|
+
* **aws:** add the pinned AWS MCP servers in AWS projects ([5c1f8cb](https://github.com/srobroek/opencode-plugins/commit/5c1f8cb20d7a7e8668a8f3412169973d058c92e2))
|
|
78
|
+
|
|
79
|
+
## [0.2.0](https://github.com/srobroek/opencode-plugins/compare/aws--v0.1.0...aws--v0.2.0) (2026-10-27)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
* **aws:** add aws-guidance skill and document the AWS MCP servers ([e64c183](https://github.com/srobroek/opencode-plugins/commit/e64c183f33d4395d72222ae79cedfec3afde9a2b))
|
|
85
|
+
* **lib:** carry steps and the model-role header from shipped agent files ([7538ab1](https://github.com/srobroek/opencode-plugins/commit/7538ab1a05b3071564defb2ab11ce356245c3890))
|
|
86
|
+
* **lib:** honour metadata opencode/autoinvoke in shipped SKILL.md files ([881e7df](https://github.com/srobroek/opencode-plugins/commit/881e7df220095d0155b07437e733fdb795d9279b))
|
|
87
|
+
* **lib:** shared review core composed into agents at build time ([d79c79b](https://github.com/srobroek/opencode-plugins/commit/d79c79b48ba09d5770c7586799f856237f3b00af))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Performance
|
|
91
|
+
|
|
92
|
+
* shorten skill descriptions and hide pure reference skills from the listing ([51841bd](https://github.com/srobroek/opencode-plugins/commit/51841bd68ae7fe809711430fe3430b75b63e81c0))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,99 @@
|
|
|
1
|
-
#
|
|
1
|
+
# aws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AWS working guidance as the `aws-guidance` skill, plus the two MCP servers it relies
|
|
4
|
+
on, added in AWS projects.
|
|
5
|
+
|
|
6
|
+
| Skill | When |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| `aws-guidance` | Any AWS task: search the AWS MCP Server for a guided AWS skill first, verify API details against AWS documentation, price with `aws-pricing`, and route secrets through the `project-secrets` skill (AWS Secrets Manager through the `aws-secrets-manager` skill from the AWS MCP Server). Three references: `cdk.md` (testing and quality concerns for CDK apps and construct libraries: assertions, cdk-nag, diff, drift, cost), `lambda.md` (thin handlers, one middleware model per surface, Powertools for AWS Lambda, OpenTelemetry through the ADOT layer, runtime defaults) and `service-clients.md` (when a library beats the raw SDK for DynamoDB, Valkey, S3, SQS, secrets, Cognito, RDS, OpenSearch, Kinesis, MSK and Bedrock) |
|
|
9
|
+
|
|
10
|
+
## MCP servers
|
|
11
|
+
|
|
12
|
+
The plugin adds the servers in [`.mcp.json`](.mcp.json), with pinned versions:
|
|
13
|
+
|
|
14
|
+
| Server | Command | Scope |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| `aws-mcp` | `uvx mcp-proxy-for-aws-cli@2.0.0 https://aws-mcp.us-east-1.api.aws/mcp --read-only --skip-auth` | AWS documentation search, guided AWS skills, regions and regional availability. `--read-only` hides every tool that can change AWS resources; `--skip-auth` lets the documentation and skill tools work without credentials. Queries go to the AWS-hosted endpoint, and authenticated calls appear in CloudTrail for the signing account |
|
|
17
|
+
| `aws-pricing` | `uvx --with botocore[crt] awslabs.aws-pricing-mcp-server@1.1.2`, with `AWS_REGION=us-east-1` | AWS Price List queries in `us-east-1` and Terraform or CDK cost analysis. The `botocore[crt]` extra loads credentials created by `aws login` |
|
|
18
|
+
|
|
19
|
+
In OpenCode both run in Code Mode with a 120 s startup timeout, since the first start
|
|
20
|
+
downloads the `uvx` environment, and `aws-mcp` gets a 100 s execution timeout. `aws-pricing` speaks MCP 2026-07-28 and
|
|
21
|
+
needs no project directory, so it runs from `~` with `pool: true`: on OpenCode 2.2.6 and
|
|
22
|
+
later one process serves every directory. `aws-mcp` negotiates an older protocol and
|
|
23
|
+
stays one per directory.
|
|
24
|
+
|
|
25
|
+
Prerequisites: `uv` on `PATH`, and AWS credentials in the default chain for
|
|
26
|
+
authenticated calls (set `AWS_PROFILE` before starting OpenCode to pick a profile).
|
|
27
|
+
|
|
28
|
+
### When OpenCode adds them
|
|
29
|
+
|
|
30
|
+
By default (`mcp: "auto"`) the plugin adds the servers only where the session's
|
|
31
|
+
directory or its project root looks like AWS work, so a globally installed plugin
|
|
32
|
+
does not start two `uvx` processes in every project. It checks, without recursing:
|
|
33
|
+
|
|
34
|
+
- `cdk.json`, `cdk.context.json`, `samconfig.*`, `.aws-sam/`, `serverless.{yml,yaml,ts}`,
|
|
35
|
+
`amplify/backend.ts`, `amplify/.config`, `copilot/.workspace`, `.chalice/`,
|
|
36
|
+
`buildspec.yml` or `appspec.yml`
|
|
37
|
+
- a `*.tf` file naming the AWS provider, or a CloudFormation or SAM template, at the
|
|
38
|
+
root or in `infra/`, `infrastructure/`, `terraform/`, `iac/`, `deploy/`,
|
|
39
|
+
`cloudformation/` or `cfn/`
|
|
40
|
+
- a Pulumi stack file with `aws:` config
|
|
41
|
+
- an AWS dependency: `aws-cdk-lib`, `@aws-sdk/*`, `@pulumi/aws`, `serverless` or `sst`
|
|
42
|
+
in `package.json`; `boto3`, `aws-cdk-lib` or `pulumi-aws` in `requirements.txt`,
|
|
43
|
+
`pyproject.toml`, `Pipfile` or `setup.py`; the AWS SDK or CDK in `go.mod`
|
|
44
|
+
|
|
45
|
+
The check runs when the plugin loads for a directory; run `/reload` after adding the
|
|
46
|
+
first marker to a new project.
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"plugins": [{
|
|
51
|
+
"package": "github:srobroek/harness-plugins::path:plugins/aws/opencode",
|
|
52
|
+
"options": {
|
|
53
|
+
"mcp": "always", // "auto" (default), "always", or "off" for no servers
|
|
54
|
+
"mcpServers": { "aws-pricing": false } // turn single servers off (or on) by name
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
A server under the same name in your `opencode.json` wins: the plugin leaves it as you
|
|
61
|
+
configured it. Use that to change flags or versions, for example to add `--profile`,
|
|
62
|
+
or set `"disabled": true` to keep it configured but off.
|
|
63
|
+
|
|
64
|
+
### Claude Code
|
|
65
|
+
|
|
66
|
+
The marketplace export ships the same `.mcp.json`, so installing the plugin there
|
|
67
|
+
starts both servers in every project; there is no project check. Disable them per
|
|
68
|
+
project in that harness's MCP settings when they are not wanted. Neither file uses
|
|
69
|
+
`${VAR}` substitution.
|
|
70
|
+
|
|
71
|
+
## Changes from omp
|
|
72
|
+
|
|
73
|
+
- `aws-guidance` was an always-applied rule. It is now a skill, loaded when the
|
|
74
|
+
task is about AWS. To make it always on in an AWS project, copy its body into
|
|
75
|
+
that project's `AGENTS.md`.
|
|
76
|
+
- `aws-skill-first`, a TTSR reminder on the first `aws`, `cdk` or `sam` shell
|
|
77
|
+
command, is folded into the first bullet of `aws-guidance`.
|
|
78
|
+
- The skill says to report checks it could not run when a server is missing.
|
|
79
|
+
- The servers are pinned instead of `@latest` and, in OpenCode, added only in AWS
|
|
80
|
+
projects instead of wherever the plugin is installed.
|
|
81
|
+
|
|
82
|
+
Both omp rules adapted the rules file from
|
|
83
|
+
[Agent Toolkit for AWS](https://github.com/aws/agent-toolkit-for-aws/blob/main/rules/aws-agent-rules.md)
|
|
84
|
+
(Apache-2.0).
|
|
85
|
+
|
|
86
|
+
## Install
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
opencode plugin add 'github:srobroek/harness-plugins::path:plugins/aws/opencode'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Claude Code install the skill and both servers from this repository's
|
|
93
|
+
marketplace:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
claude plugin marketplace add srobroek/harness-plugins
|
|
97
|
+
claude plugin install aws@harness-plugins
|
|
98
|
+
|
|
99
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srobroek/pi-aws-guidance",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.1",
|
|
4
|
+
"description": "AWS working guidance: route AWS tasks through the AWS MCP Server's guided skills, verify against AWS documentation, and price with the AWS Pricing MCP server.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package"
|
|
7
|
+
],
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/srobroek/harness-plugins.git",
|
|
12
|
+
"directory": "plugins/aws/pi"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"CHANGELOG.md",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.md",
|
|
18
|
+
"skills"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public",
|
|
22
|
+
"provenance": true
|
|
23
|
+
},
|
|
24
|
+
"pi": {
|
|
25
|
+
"skills": [
|
|
26
|
+
"./skills"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aws-guidance
|
|
3
|
+
description: Use for any AWS task (CLI, CDK apps and tests, SAM, SDK, IaC, pricing, secrets); routes it through the AWS MCP servers and docs.
|
|
4
|
+
---
|
|
5
|
+
AWS work goes through two MCP servers: `aws-mcp` (the read-only AWS MCP Server) and `aws-pricing`. When either is not connected, say so and state which checks below stayed undone.
|
|
6
|
+
|
|
7
|
+
- Before an AWS task and before its first AWS CLI, `cdk`, or `sam` command, search `aws-mcp` with `mcp__aws_mcp__search_documentation` and `topics: ["agent_skills"]`. Load a match with `mcp__aws_mcp__retrieve_skill`, passing its exact `skill_name`, and follow it over general knowledge.
|
|
8
|
+
- Verify AWS API parameters, permissions, limits, error codes, and regional availability against `aws-mcp` documentation tools. State what stayed unconfirmed.
|
|
9
|
+
- Price estimates with `aws-pricing`, and state the region, usage assumptions, and price-list date.
|
|
10
|
+
- Project instructions win over this guidance, including the project's infrastructure-as-code tool.
|
|
11
|
+
- For secrets in a repository (values, env files, fnox), load the `project-secrets` skill before any secret, credential, API key, token, or password task. For AWS Secrets Manager itself, retrieve the `aws-secrets-manager` skill with `mcp__aws_mcp__retrieve_skill`, passing `skill_name` exactly as the search returned it. Never call `secretsmanager get-secret-value` or `batch-get-secret-value`.
|
|
12
|
+
- Use hyphens, not em dashes, in AWS resource names and descriptions.
|
|
13
|
+
- Before you write or change a Lambda function, read [references/lambda.md](references/lambda.md): thin handlers, one middleware model per surface, Powertools for AWS Lambda over hand-rolled code, OpenTelemetry through the ADOT layer instead of the X-Ray SDK, and runtime defaults.
|
|
14
|
+
- Before you write, test or review AWS CDK apps or construct libraries, read [references/cdk.md](references/cdk.md): assertions tests, cdk-nag, `cdk diff` gates, drift and cost checks.
|
|
15
|
+
- Before you write code that calls an AWS service's data plane (DynamoDB, Valkey, S3, SQS, Secrets Manager, Cognito tokens, RDS, OpenSearch, Kinesis, MSK, Bedrock), read [references/service-clients.md](references/service-clients.md) and use the listed library where it beats the raw SDK.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# AWS CDK testing and quality concerns
|
|
2
|
+
|
|
3
|
+
Checked 2026-11-16.
|
|
4
|
+
|
|
5
|
+
Rows follow the spec in
|
|
6
|
+
[concerns.md](https://github.com/srobroek/harness-plugins/blob/main/plugins/toolchain/common/skills/toolchain-languages/references/concerns.md). Shared
|
|
7
|
+
tools are in
|
|
8
|
+
[shared-tools.md](https://github.com/srobroek/harness-plugins/blob/main/plugins/toolchain/common/skills/toolchain-languages/references/shared-tools.md).
|
|
9
|
+
Rows below assume a TypeScript CDK app, which most projects use; `Inherits: typescript` takes
|
|
10
|
+
that language's tool for the row. In a Python app use pytest with `aws_cdk.assertions`, and in
|
|
11
|
+
a Go app `awscdk/v2/assertions` with `go test`.
|
|
12
|
+
|
|
13
|
+
Versions: `aws-cdk-lib` 2.277.0 (2026-11-13) and CLI `aws-cdk` 2.1148.1 (2026-11-11). The CLI
|
|
14
|
+
is decoupled from the library: keep the CLI at or above the library release and update it
|
|
15
|
+
freely. Pin `aws-cdk-lib` and every `-alpha` package to one version in the project lockfile.
|
|
16
|
+
|
|
17
|
+
## Concerns
|
|
18
|
+
|
|
19
|
+
| Concern | Default | Maintenance | Install | Alternatives | Use both when | Run | Avoid |
|
|
20
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
21
|
+
| `test-runner` | `vitest` with `aws-cdk-lib/assertions` (`Template.fromStack`, `hasResourceProperties`, `Match`, `Capture`, `resourceCountIs`, `Annotations.fromStack`) | >= 5.0.0 · 2026-11-02 · active | `node_modules/.bin/vitest --version` · `npm install --save-dev vitest` | `jest`: the project already runs it, since it is AWS's documented path and ships `aws-cdk-lib/testhelpers/jest-autoclean` | - | every-pr | Synthesizing to the default temp `outdir` under Vitest without cleanup: set an explicit `outdir` or call `CloudAssembly.cleanupTemporaryDirectories()` in `afterAll` |
|
|
22
|
+
| `assertions` | Built-in: `aws-cdk-lib/assertions` (`Template`, `Match`, `Capture`) with the runner's `expect` | - | Built-in | None | - | every-pr | Asserting on the whole template instead of resources by name and property |
|
|
23
|
+
| `watch` | N/A: the synth-and-assert loop uses the TypeScript watch (`Inherits: typescript`) | - | - | None | - | - | - |
|
|
24
|
+
| `property` | Inherits: typescript | - | Inherits | None | - | - | Property tests over whole stacks: synth is slow, so test pure prop-mapping helpers only |
|
|
25
|
+
| `fuzz` | N/A: no untrusted input parser in an IaC app | - | - | None | - | - | - |
|
|
26
|
+
| `fuzz-continuous` | N/A: no untrusted input parser in an IaC app | - | - | None | - | - | - |
|
|
27
|
+
| `mutation` | Inherits: typescript | - | Inherits | None | - | diff-pr + scheduled | Mutating whole stacks: declarative mutants are hard to judge; scope it to pure helpers |
|
|
28
|
+
| `snapshot` | Built-in: the test runner's snapshot of `Template.fromStack(stack).toJSON()` for stable L3 constructs, with asset hashes normalised | - | Built-in | None | - | every-pr | Snapshots as the only test: CDK upgrades change templates; assert IAM, encryption and public access by name first |
|
|
29
|
+
| `component` | N/A: no UI | - | - | None | - | - | - |
|
|
30
|
+
| `concurrency` | N/A: synth is single-process and holds no shared state | - | - | None | - | - | - |
|
|
31
|
+
| `coverage` | N/A: coverage of declarative construct code says little; assertions on the template are the measure | - | - | None | - | - | - |
|
|
32
|
+
| `benchmark` | N/A: infrastructure is not benchmarked | - | - | None | - | - | - |
|
|
33
|
+
| `flaky-order` | N/A: tests share no state beyond the temp-dir cleanup under `test-runner` | - | - | None | - | - | - |
|
|
34
|
+
| `integration` | `@aws-cdk/integ-runner` with `@aws-cdk/integ-tests-alpha` (`integ.*.ts` apps with `IntegTest`, committed `*.snapshot` directories) for construct libraries; apps run a deploy-and-assert pipeline stage | >= 2.207.0 · 2026-11-11 · preview | `node_modules/.bin/integ-runner --version` · `npm install --save-dev @aws-cdk/integ-runner @aws-cdk/integ-tests-alpha` | None | - | scheduled | `--update-on-failed` against a shared or production account: it deploys real stacks, so use a sandbox account |
|
|
35
|
+
| `contract` | N/A: constructs have no independently deployed consumers | - | - | None | - | - | - |
|
|
36
|
+
| `api-schema` | N/A: no API schema | - | - | None | - | - | - |
|
|
37
|
+
| `load` | N/A: infrastructure code is not load tested | - | - | None | - | - | - |
|
|
38
|
+
| `lint` | Inherits: typescript | - | Inherits | `eslint-plugin-awscdk`: you want CDK rules and run ESLint, since the plugin is third-party and ESLint only; `awslint`: you ship a jsii construct library, though it is a developer preview | Biome or the project linter for general rules, `eslint-plugin-awscdk` for CDK rules | every-pr | Adding ESLint only for CDK rules in a Biome project without a reason |
|
|
39
|
+
| `format` | Inherits: typescript | - | Inherits | None | - | every-pr | - |
|
|
40
|
+
| `types` | Inherits: typescript | - | Inherits | `cfn-lint`: you want the synthesized template checked against the CloudFormation spec, see Language-specific | `tsc --noEmit` for the code, `cfn-lint` for `cdk.out` | every-pr | - |
|
|
41
|
+
| `sast` | `cdk-nag` v3 packs on the app (AwsSolutions, HIPAA, NIST 800-53 r4 and r5, PCI DSS 3.2.1, Serverless) | >= 3.0.2 · 2026-08-04 · active | `npm ls cdk-nag --depth=0` · `npm install --save-dev cdk-nag` | `@cdklabs/cdk-validator-cfnguard`: you want Control Tower rules in the synth step, though it is experimental; `cfn-guard`: you write your own Guard rules for the template; `checkov`: you scan `cdk.out` and want one scanner with other IaC | `cdk-nag` for the pack and `cfn-guard` for org rules | every-pr | cdk-nag v3 below `aws-cdk-lib` 2.257 (stay on 2.x); the unscoped `cdk-validator-cfnguard` package, which is stale; several broad scanners at once |
|
|
42
|
+
| `memory-safety` | N/A: no memory model in constructs | - | - | None | - | - | - |
|
|
43
|
+
| `dep-audit` | Inherits: typescript | - | Inherits | `osv-scanner`: you want one scanner across lockfiles of several languages | - | every-pr + scheduled | - |
|
|
44
|
+
| `dead-code` | Inherits: typescript | - | Inherits | None | - | - | - |
|
|
45
|
+
| `unused-deps` | Inherits: typescript | - | Inherits | None | - | - | - |
|
|
46
|
+
| `complexity` | N/A: constructs are declarative | - | - | None | - | - | - |
|
|
47
|
+
| `duplication` | Inherits: typescript | - | Inherits | None | - | - | - |
|
|
48
|
+
| `api-break` | `jsii-diff` against the last published version, for construct libraries | >= 1.142.0 · 2026-10-20 · active | `node_modules/.bin/jsii-diff --version` · `npm install --save-dev jsii-diff` | None | - | every-pr | Running it in an app: apps publish no API; jsii 6 compatibility is unverified |
|
|
49
|
+
| `docs` | `jsii-docgen` for construct libraries; `projen` scaffolds the library | >= 10.12.9 · 2026-11-09 · active | `node_modules/.bin/jsii-docgen --version` · `npm install --save-dev jsii-docgen` | None | - | every-pr | Hand-edited `API.md` |
|
|
50
|
+
| `iac-plan` | Built-in: `cdk diff --method=change-set --fail-on=broadening` through a read-only role, plus `--fail-on=destructive` for stateful stacks | - | Built-in | `cdk-notifier`: you want the diff posted as a PR comment; `cdk refactor`: run with `--unstable=refactor --dry-run` when you move constructs and want the logical-ID mapping checked, though it is experimental | `cdk diff` for the gate, `cdk-notifier` for the comment | every-pr | Moving or renaming a construct without a refactor dry run or `overrideLogicalId`: it replaces the resource |
|
|
51
|
+
| `iac-drift` | Built-in: a scheduled `cdk drift --fail` | - | Built-in | None | - | scheduled | Running it with a role that can write |
|
|
52
|
+
| `iac-cost` | `infracost` on `cdk.out` after `cdk synth` (needs an API key; opt-in) | >= 2.19.1 · 2026-11-12 · active | `infracost --version` · `brew install infracost` | `aws-pricing-mcp`: you want a manual estimate through the `aws-pricing` server | - | on-demand | Enabling it without an account and the owner's consent; the Go CDK is unstated in its docs |
|
|
53
|
+
|
|
54
|
+
## Tradeoffs
|
|
55
|
+
|
|
56
|
+
### test-runner
|
|
57
|
+
|
|
58
|
+
- **vitest**: wins on fast runs, native TypeScript and one runner shared with the rest of a TypeScript repo; costs AWS documents Jest, and the temp-directory leak under Vitest is unverified
|
|
59
|
+
- **jest**: wins on AWS's documented path and `jest-autoclean`; costs a second runner in a Vitest repo
|
|
60
|
+
|
|
61
|
+
### lint
|
|
62
|
+
|
|
63
|
+
- **eslint-plugin-awscdk**: wins on CDK-specific rules; costs ESLint, and a third-party maintainer
|
|
64
|
+
- **awslint**: wins on construct-library conventions; costs a developer preview and jsii libraries only
|
|
65
|
+
|
|
66
|
+
### types
|
|
67
|
+
|
|
68
|
+
- **tsc --noEmit**: wins on type errors in the CDK code; costs it never reads the synthesized template
|
|
69
|
+
- **cfn-lint**: wins on template errors the types miss; costs a Python tool and a synth first
|
|
70
|
+
|
|
71
|
+
### sast
|
|
72
|
+
|
|
73
|
+
- **cdk-nag**: wins on compliance packs and per-construct acknowledgements with a reason; costs v3 needs `aws-cdk-lib` 2.257 or newer
|
|
74
|
+
- **@cdklabs/cdk-validator-cfnguard**: wins on Control Tower rules at synth time; costs it is experimental
|
|
75
|
+
- **cfn-guard**: wins on your own Guard rules for the template; costs you write and own them
|
|
76
|
+
- **checkov**: wins on one scanner for `cdk.out` and other IaC; costs noisy findings that need a baseline
|
|
77
|
+
|
|
78
|
+
### dep-audit
|
|
79
|
+
|
|
80
|
+
- **bun or npm audit**: wins because it needs no extra install; costs one ecosystem
|
|
81
|
+
- **osv-scanner**: wins across several lockfiles; costs less fix guidance
|
|
82
|
+
|
|
83
|
+
### iac-plan
|
|
84
|
+
|
|
85
|
+
- **cdk diff**: wins because it ships with the CLI; costs reviewers read long output
|
|
86
|
+
- **cdk-notifier**: wins on a PR comment with the diff; costs a CI secret for the comment
|
|
87
|
+
- **cdk refactor**: wins on checking construct moves before deploy; costs it is experimental
|
|
88
|
+
|
|
89
|
+
### iac-cost
|
|
90
|
+
|
|
91
|
+
- **infracost**: wins on a cost diff per change; costs an API key and an account
|
|
92
|
+
- **aws-pricing-mcp**: wins on a one-off manual estimate; costs it is not repeatable in CI
|
|
93
|
+
|
|
94
|
+
## Language-specific
|
|
95
|
+
|
|
96
|
+
| Topic | Tool | Note |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| CloudFormation lint | `cfn-lint` (>= 1.60.1 · 2026-11-12, MIT-0) | Run on `cdk.out/*.template.json` after `cdk synth`; install with `pip install cfn-lint` or `mise use pipx:cfn-lint` |
|
|
99
|
+
| Version pinning | `package.json` and lockfile | Pin `aws-cdk-lib` and each `-alpha` package to one version; the CLI is at or above it |
|
|
100
|
+
|
|
101
|
+
### Assertions test
|
|
102
|
+
|
|
103
|
+
Assert resources by name and property, not by the whole template:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { App } from "aws-cdk-lib"
|
|
107
|
+
import { Match, Template } from "aws-cdk-lib/assertions"
|
|
108
|
+
import { test } from "vitest"
|
|
109
|
+
import { BucketStack } from "../lib/bucket-stack"
|
|
110
|
+
|
|
111
|
+
const app = new App({ outdir: "cdk.out.test" })
|
|
112
|
+
const template = Template.fromStack(new BucketStack(app, "Test"))
|
|
113
|
+
|
|
114
|
+
test("bucket is encrypted and blocks public access", () => {
|
|
115
|
+
template.hasResourceProperties("AWS::S3::Bucket", {
|
|
116
|
+
BucketEncryption: Match.objectLike({}),
|
|
117
|
+
PublicAccessBlockConfiguration: Match.objectLike({ BlockPublicAcls: true }),
|
|
118
|
+
})
|
|
119
|
+
template.resourceCountIs("AWS::S3::Bucket", 1)
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
With Vitest set an explicit `outdir` as above, git-ignore it, or call
|
|
124
|
+
`CloudAssembly.cleanupTemporaryDirectories()` in `afterAll`.
|
|
125
|
+
|
|
126
|
+
### cdk-nag v3 wiring
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { App, Validations } from "aws-cdk-lib"
|
|
130
|
+
import { AwsSolutionsChecks } from "cdk-nag"
|
|
131
|
+
|
|
132
|
+
const app = new App()
|
|
133
|
+
Validations.of(app).addPlugins(new AwsSolutionsChecks(app))
|
|
134
|
+
// Per construct, with a reason:
|
|
135
|
+
Validations.of(bucket).acknowledge({ id: "AwsSolutions-S1", reason: "Access logs go to the central log bucket" })
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
v3 replaces `NagSuppressions`. Below `aws-cdk-lib` 2.257 stay on cdk-nag 2.x.
|
|
139
|
+
|
|
140
|
+
### Snapshot normalisation
|
|
141
|
+
|
|
142
|
+
Replace asset hashes before the comparison, so a rebuilt asset does not change the golden file:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
const json = JSON.stringify(template.toJSON()).replace(/[0-9a-f]{64}/g, "HASH")
|
|
146
|
+
expect(JSON.parse(json)).toMatchSnapshot()
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Also normalise `AssetParameters` keys. Snapshot only stable L3 constructs.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# AWS Lambda standards
|
|
2
|
+
|
|
3
|
+
Read before you write or change a Lambda function. Checked 2026-11-12. Per-language packages and handler examples are in `lang-<language>-libraries`, `references/aws.md`.
|
|
4
|
+
|
|
5
|
+
## Handler structure
|
|
6
|
+
|
|
7
|
+
- A handler is a thin adapter: read the event and context, parse and validate, call a business function you can test without Lambda, serialize the result. Initialize SDK clients, configuration and connections outside the handler and reuse them; never keep request data in module state.
|
|
8
|
+
- Cross-cutting concerns go in middleware or decorators, one model per surface:
|
|
9
|
+
|
|
10
|
+
| Workload | Python | TypeScript |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| Event-driven function (SQS, SNS, EventBridge, S3, DynamoDB streams, Kinesis, schedules) | Plain handler with Powertools decorators and utilities; `lambda_handler_decorator` (synchronous only) for custom policy | Plain typed handler with Powertools utilities used directly; Middy 7 only when several ordered lifecycle concerns justify it |
|
|
13
|
+
| HTTP on Lambda only | Powertools Event Handler (REST/HTTP API, ALB, Function URL, VPC Lattice) with its route and global middleware | Hono through `@hono/aws-lambda` (`handle`, `streamHandle`), with Powertools Logger and Metrics in a Hono middleware |
|
|
14
|
+
| Same HTTP API also in containers | FastAPI with Mangum, or with the Lambda Web Adapter | The same Hono app; on Lambda Web Functions (Node 24, arm64) as a native server, else the adapter |
|
|
15
|
+
|
|
16
|
+
- Go: `aws-lambda-go` on `provided.al2023` (`go1.x` is deprecated); reuse a `net/http` handler through the Lambda Web Adapter for HTTP. Rust: `lambda_runtime`, `lambda_http` for an axum router, built with `cargo-lambda` (third party, recommended in AWS docs).
|
|
17
|
+
- Never wrap a web framework in a Lambda middleware engine, and never stack two body parsers, routers, loggers or metrics middlewares.
|
|
18
|
+
|
|
19
|
+
## Powertools for AWS Lambda first
|
|
20
|
+
|
|
21
|
+
Official for Python (major 3), TypeScript (major 2), Java (major 2) and .NET (major 3). There is no official Powertools for Go or Rust; community ports are not AWS-supported.
|
|
22
|
+
|
|
23
|
+
| Concern | Use | Do not hand-roll |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Structured JSON logs with Lambda context, cold start, correlation ids, sampling, buffering | Logger | Your own JSON formatter or context enrichment |
|
|
26
|
+
| Business metrics | Metrics (EMF, asynchronous) | `PutMetricData` per invocation or hand-built EMF |
|
|
27
|
+
| Duplicate suppression | Idempotency, keyed on a stable business key (not the request id) | Check-then-write deduplication |
|
|
28
|
+
| SQS, Kinesis and DynamoDB stream batches | Batch Processing with `ReportBatchItemFailures` enabled in the event source mapping | Whole-batch retries for one bad record |
|
|
29
|
+
| Cached secrets, parameters, AppConfig | Parameters | A fetch per invocation or an unbounded cache |
|
|
30
|
+
| Event parsing and validation | Parser (Pydantic, Zod), Validation (JSON Schema), event source data classes | Ad hoc envelope decoding and casts |
|
|
31
|
+
| Lambda-only HTTP routing (Python), AppSync and Bedrock Agents routing (Python, TypeScript) | Event Handler; TypeScript HTTP uses Hono | Hand-written proxy-event routing |
|
|
32
|
+
| Feature rules (verified in Python only) | Powertools Feature Flags only for its own freeform rules engine over an AppConfig freeform profile | Confusing it with native AppConfig flags or OpenFeature; stacking rule engines |
|
|
33
|
+
| Data masking, large-object streaming, Kafka deserialization | Data Masking, Streaming (Python), Kafka | Masking crypto, whole-object loads, schema-registry decoding |
|
|
34
|
+
|
|
35
|
+
For flags on Lambda, use OpenFeature through one typed flag module and one provider: SSM for simple runtime on/off toggles, or an AppConfig feature flag profile through the Agent Lambda extension for kill switches and gradual rollout. If no maintained provider exists in the language, ask before writing one. See `service-clients.md` for providers and `quality-code-design`'s `feature-flags.md` for code design.
|
|
36
|
+
|
|
37
|
+
## Telemetry on Lambda
|
|
38
|
+
|
|
39
|
+
- AWS X-Ray SDKs and the daemon are in security-fixes-only maintenance since 2026-02-25. Powertools Tracer wraps the X-Ray SDK in every runtime, so new functions do not use it.
|
|
40
|
+
- Python, Node, Java, .NET: the Application Signals-enabled ADOT Lambda layer, pinned in infrastructure code, with `AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument`. Use the upstream OpenTelemetry Lambda layers when the backend is not AWS. Remove X-Ray SDK instrumentation: two SDKs patching the same clients duplicate spans.
|
|
41
|
+
- Go and Rust: OTel SDK with manual instrumentation (`otellambda.InstrumentHandler` in Go; `tracing-opentelemetry` in Rust), the ADOT Collector extension, and a flush at the end of every invocation. The X-Ray OTLP endpoint needs Transaction Search enabled.
|
|
42
|
+
- Keep Powertools Logger and Metrics. Add the active OTel `trace_id` and `span_id` to log entries, keep the Lambda request id as its own field, and set `OTEL_SERVICE_NAME` and `POWERTOOLS_SERVICE_NAME` to the same value. Business metrics stay EMF; never publish the same metric through both EMF and OTel.
|
|
43
|
+
|
|
44
|
+
## Logging and metrics on Lambda
|
|
45
|
+
|
|
46
|
+
With the JSON log format, Python `logging` and Node `console` already get `timestamp`, `level`, `message` and `requestId` from the runtime. Go and Rust format their own JSON. Custom JSON needs a string `level` and an RFC 3339 `timestamp`, or log-level filtering treats the line as INFO.
|
|
47
|
+
|
|
48
|
+
| Language | Default | Choose instead when | Avoid |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| Python | Powertools Logger and Metrics | Plain `logging` for small functions with no business metrics; `structlog` or `loguru` only where the project already standardizes on them; `aws-embedded-metrics` 3 for metrics-only code shared with containers | Invocation keys left bound across warm calls; a queue sink that is not flushed before the handler returns |
|
|
51
|
+
| TypeScript | Powertools Logger and Metrics | `console` for minimal functions; Pino with `pino-lambda` 4 (its `StructuredLogFormatter`) for an existing Pino setup, after checking it works with Pino 10; `aws-embedded-metrics` 4.1.1 or later for metrics-only code | The `pino-lambda` default text formatter; raw numeric Pino levels with log-level filtering |
|
|
52
|
+
| Go | `log/slog` JSON with a handler that adds the invocation request id, cold start and active trace ids | `prozz/aws-embedded-metrics-golang` for business metrics after an ownership review (last release 2021); OTel metrics through the Collector on an OTel platform | Community Powertools ports presented as official; shared mutable invocation attributes |
|
|
53
|
+
| Rust | `tracing-subscriber` JSON with invocation spans carrying the request id | `metrics_cloudwatch_embedded` 0.10 for business metrics: enable its `lambda` feature and wrap the handler in its `MetricsLayer` or runtime helper so it flushes per invocation, or call `Collector::flush` before returning (histograms keep 100 samples and error on overflow); OTel metrics through the Collector | Timer-only flushing; ignored histogram overflow |
|
|
54
|
+
|
|
55
|
+
- EMF limits: 30 dimensions per set (29 user dimensions in Powertools), 100 metric definitions and 100 values per array in one event, 1 MB per event. Every distinct dimension combination is a new metric: put request ids in properties, never in dimensions.
|
|
56
|
+
- Application Signals gives request, latency, error and fault metrics plus traces for the APM view. It does not replace business metrics or logging.
|
|
57
|
+
- The OpenTelemetry Lambda Collector extension exports traces and metrics by default but not logs; configure a logs pipeline explicitly if you want OTLP logs. Test flushing before the runtime freezes, on Collector shutdown and on export failure; synchronous export adds latency to billed duration.
|
|
58
|
+
|
|
59
|
+
## Runtime defaults
|
|
60
|
+
|
|
61
|
+
- Logging: JSON log format with Lambda advanced logging controls, INFO by default, a retention period, no payload logging by default.
|
|
62
|
+
- Architecture: arm64 after a benchmark; x86_64 for native dependencies that need it. Check that every layer and extension supports arm64.
|
|
63
|
+
- Cold starts: SnapStart for latency-sensitive functions on Java 11 or later, Python 3.12 or later, or .NET 8 or later, after restore testing (no unique ids, credentials or connections captured in the snapshot); provisioned concurrency for stricter targets. Keep bundles small and measure Init Duration.
|
|
64
|
+
- Delivery is at least once: idempotent handlers, partial batch responses, dead-letter queues or on-failure destinations; never claim exactly-once side effects.
|
|
65
|
+
- Long workflows: Lambda durable functions (SDKs for JS/TS, Python, Java, Go, .NET) for code-centric steps and waits; Step Functions for cross-service orchestration. Never sleep inside a billed handler.
|
|
66
|
+
- Testing: unit-test the business function; replay synthetic events against the handler; run deployed integration tests that cover IAM, retries, partial batches and telemetry. Local emulation (SAM local, LocalStack, moto, DynamoDB Local) does not prove cloud behavior.
|
|
67
|
+
|
|
68
|
+
## Sources
|
|
69
|
+
|
|
70
|
+
- Powertools: https://github.com/aws-powertools
|
|
71
|
+
- X-Ray SDK timeline: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-daemon-timeline.html
|
|
72
|
+
- Application Signals for Lambda: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals-Enable-Lambda.html
|
|
73
|
+
- ADOT Go: https://aws-otel.github.io/docs/getting-started/lambda/lambda-go
|
|
74
|
+
- Lambda best practices: https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html
|
|
75
|
+
- Lambda testing guide: https://docs.aws.amazon.com/lambda/latest/dg/testing-guide.html
|
|
76
|
+
- Lambda Web Functions: https://docs.aws.amazon.com/lambda/latest/dg/web-functions.html
|
|
77
|
+
- Lambda Web Adapter: https://github.com/aws/aws-lambda-web-adapter
|
|
78
|
+
- Middy 7: https://middy.js.org/docs/upgrade/6-7/
|
|
79
|
+
- Hono on Lambda: https://hono.dev/docs/getting-started/aws-lambda
|
|
80
|
+
- Durable functions: https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# AWS service clients: library or raw SDK
|
|
2
|
+
|
|
3
|
+
Read before you write code that talks to an AWS service. Checked 2026-11-12. Use the AWS SDK for control-plane calls (create, configure, administer) and for simple, exact requests. Use a higher-level library when it removes a concrete burden: mapping, pagination, multipart transfers, leasing and checkpoints, caching, credential refresh, or replay. Versions and per-language detail are in `lang-<language>-libraries`, `references/aws.md`.
|
|
4
|
+
|
|
5
|
+
| Service | Python | TypeScript | Go | Rust | Avoid |
|
|
6
|
+
| --- | --- | --- | --- | --- | --- |
|
|
7
|
+
| DynamoDB | PynamoDB 6 for model-oriented code (transactions, `VersionAttribute` locking); boto3 client for exact requests | ElectroDB 3 for typed single-table entities; `dynamodb-toolbox` 2 for a lighter builder; `@aws-sdk/lib-dynamodb` for plain CRUD | SDK with `feature/dynamodb/attributevalue` and `expression`; `guregu/dynamo/v2` for fluent queries | `serde_dynamo` 4 for conversion; `modyne` for single-table modeling | OneTable (archived, unmaintained); new features through the boto3 resource layer (frozen) |
|
|
8
|
+
| Valkey, Redis, ElastiCache, MemoryDB | Valkey GLIDE 2 (async, cluster-aware, built-in IAM); `valkey` or `redis` for existing code | `@valkey/valkey-glide` 2 where native modules deploy; `redis` (node-redis) 6 otherwise | GLIDE Go 2 or `valkey-go`; `rueidis` for pipelining and server-assisted caching | `redis` 1 | Treating GLIDE's TTL-only client cache as invalidated; the AWS SDK for data commands |
|
|
9
|
+
| S3 | boto3 `upload_file`/`download_file` with `TransferConfig`; `obstore` or `s3fs` for object-store APIs | `@aws-sdk/lib-storage` `Upload`; `@aws-sdk/s3-request-presigner` | `feature/s3/transfermanager` (the `feature/s3/manager` uploader is deprecated) | `aws-sdk-s3`; `object_store` or `opendal` for portable code | Hand-written multipart; proxying downloads that a presigned URL can serve |
|
|
10
|
+
| SQS, SNS, EventBridge | Powertools Batch in Lambda; boto3 elsewhere | Powertools Batch in Lambda; `sqs-consumer` and `sqs-producer` for long-running workers | SDK with an explicit polling loop (cancellation, visibility renewal, delete, backoff) | Same as Go | A polling library inside an event-source-mapped Lambda; Celery only to poll business events |
|
|
11
|
+
| Secrets Manager, SSM, AppConfig | Powertools Parameters; `aws-secretsmanager-caching` for Secrets-only code | Powertools Parameters | `aws-secretsmanager-caching-go` where its SDK version fits; the Parameters and Secrets extension | The Lambda extension; the AppConfig agent | Fetching an unchanged secret every invocation |
|
|
12
|
+
| Cognito tokens | `PyJWT` with its JWKS client and explicit issuer, audience and `token_use` checks | `aws-jwt-verify` 5 | `lestrrat-go/jwx/v3` with a JWKS cache | `jsonwebtoken` with a cached JWKS fetch | Signature checks without claim checks; the whole Amplify stack for one bearer check |
|
|
13
|
+
| RDS, Aurora, Aurora DSQL | `aws-advanced-python-wrapper` 3 for failover and IAM; `aurora-dsql-python-connector` for DSQL | `aws-advanced-nodejs-wrapper` 3; Drizzle or `kysely-data-api` for the Data API; `@aws/aurora-dsql-node-postgres-connector` | `aws-advanced-go-wrapper`; the DSQL `pgx` connector | `aurora-dsql-sqlx-connector` for DSQL | A topology wrapper when nothing needs failover; treating DSQL as plain PostgreSQL |
|
|
14
|
+
| OpenSearch Service and Serverless | `opensearch-py` 3 with its AWS SigV4 auth | `@opensearch-project/opensearch` 3 with `AwsSigv4Signer` | `opensearch-go/v4` with its signer | `opensearch` with the `aws-auth` feature | The wrong signing service (`es` for domains, `aoss` for Serverless); frozen temporary credentials |
|
|
15
|
+
| Kinesis | `amazon-kclpy` 3 (KCL 3 through the Java MultiLangDaemon) | `aws-kcl` 3 | A Lambda event source, or Java KCL 3 | Same as Go | KCL 1.x (support ended 2026-01-30) |
|
|
16
|
+
| MSK with IAM | A Kafka client plus `aws-msk-iam-sasl-signer-python` | A Kafka client plus `aws-msk-iam-sasl-signer-js` | A Kafka client plus `aws-msk-iam-sasl-signer-go` | A reviewed signer only (the crate is community-owned) | Using the AWS SDK for records; a static token without refresh |
|
|
17
|
+
| Bedrock | boto3 `bedrock-runtime` Converse for direct calls; `anthropic[bedrock]` for Claude features; Strands Agents for an agent loop | `@ai-sdk/amazon-bedrock` for a unified streaming API; `@anthropic-ai/bedrock-sdk`; Strands for agents | The runtime SDK Converse API | The runtime SDK | An agent framework for a single inference call |
|
|
18
|
+
| CloudWatch metrics | Powertools Metrics in Lambda; `aws-embedded-metrics` elsewhere; OTel for cross-service telemetry | Same as Python | OTel through the Collector | Same as Go | High-cardinality dimensions |
|
|
19
|
+
| Lambda durable functions | `aws-durable-execution-sdk-python` | `@aws/durable-execution-sdk-js` | `aws-durable-execution-sdk-go` | No official SDK | Side effects that are not replay-safe |
|
|
20
|
+
|
|
21
|
+
Rules:
|
|
22
|
+
|
|
23
|
+
1. Choose by the work removed. A maintained third-party library that is markedly simpler or covers more of the access pattern (ElectroDB, PynamoDB, GLIDE) beats the official helper. The official helper wins a tie, and wins when the library lags service features you need, mishandles credential refresh, or shows an archive or maintenance notice.
|
|
24
|
+
2. Choose a single-table library for how it models your access patterns.
|
|
25
|
+
3. Require documented conditional-write, retry and pagination semantics from any data library.
|
|
26
|
+
4. IAM support means credential refresh, reconnection and expiry handling, not only signing.
|
|
27
|
+
5. Cache only with acceptable staleness and verified invalidation.
|
|
28
|
+
6. Test wrappers against the real service as well as emulators, and keep a raw-SDK escape hatch.
|
|
29
|
+
|
|
30
|
+
## Feature flags
|
|
31
|
+
|
|
32
|
+
Use OpenFeature through one typed flag module and one provider. Choose SSM Parameter Store for simple runtime on/off toggles without staged rollout. Choose an AppConfig feature flag profile through the Agent (Lambda extension on Lambda) for kill switches and gradual or percentage rollout, with validators, deployment strategies and alarm rollback. Repository `flags.yaml` in flagd format fits local development and flags changed with a deploy. If no maintained provider exists in the language, stop and ask before writing one; never silently wrap backend reads. Code and storage rules are in `quality-code-design`'s `feature-flags.md`; SDKs are in `lang-<language>-libraries`.
|
|
33
|
+
|
|
34
|
+
| Language | SSM provider | AppConfig provider |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Python | `openfeature-provider-aws-ssm` `>= 0.1` (contrib); set TTL cache, default LRU has no timed refresh | None found; ask first before writing an Agent HTTP provider |
|
|
37
|
+
| TypeScript (Node) | `@openfeature/aws-ssm-provider` `>= 0.1`; cache off by default, only boolean/string results cached | None found; ask first |
|
|
38
|
+
| Go | Contrib `providers/aws-ssm` `>= 1.0`. Calls `GetParameter` per evaluation without a cache. With the shared 40 TPS default, evaluate once per request. Object flags return the default. | Third-party `github.com/Arthur1/openfeature-provider-go-aws-appconfig` `>= 0.4`; Agent only, boolean flags; dependency review required |
|
|
39
|
+
| Rust | None found; ask first | None found; ask first |
|
|
40
|
+
| Browser | Evaluate on server and send decisions, or ask first | Same; never expose AWS credentials or Agent |
|
|
41
|
+
|
|
42
|
+
An approved AppConfig provider reads `http://localhost:2772/applications/<app>/environments/<env>/configurations/<profile>`, with `?flag=<key>` for one flag and `Context: key=value` headers for multi-variant evaluation.
|
|
43
|
+
|
|
44
|
+
Facts checked 2026-11-12:
|
|
45
|
+
|
|
46
|
+
- AppConfig charges $0.0000002 per request and $0.0008 per configuration received. Local multi-variant reads of the same version do not add configuration-received charges. Experimentation tools are listed at $0.90 per experiment-hour; validate exposure and analytics requirements before choosing them.
|
|
47
|
+
- Agent and Lambda extension polling defaults to 45 seconds. A refresh timeout serves cached data; cold startup without a cache needs its own fallback. Choose the poll interval and maximum staleness for the kill switch's required response time.
|
|
48
|
+
- SSM Parameter Store supports simple runtime on/off toggles, not staged rollout. Standard supports 10,000 parameters of 4 KB with no additional storage charge; advanced supports 100,000 of 8 KB at $0.05 per parameter-month.
|
|
49
|
+
- SSM default reads share 40 TPS. Higher throughput supports `GetParameter` at 10,000 TPS, `GetParameters` at 1,000 TPS and `GetParametersByPath` at 100 TPS. Advanced interactions, and standard interactions with higher throughput enabled, cost $0.05 per 10,000; each parameter counts as an interaction. Cache with a stated freshness policy.
|
|
50
|
+
- DynamoDB fits domain-owned tenant/user overrides and entitlements; layer rollout separately, never grant authorization through a flag. US-East Standard on-demand pricing is $0.625 per million WRUs, $0.125 per million RRUs and $0.25 per GB-month. Eventual reads consume half the units of strong reads; caching adds staleness.
|
|
51
|
+
- Python Powertools Feature Flags is its own rules engine over an AppConfig freeform profile, not native AppConfig feature flag profiles or OpenFeature. Use it only when those freeform rules are wanted; do not stack two engines. Other language utility parity was not verified.
|
|
52
|
+
- CloudWatch Evidently was discontinued in October 2025; use AppConfig. Its API notice says October 16, while AWS's announcement says October 17.
|
|
53
|
+
|
|
54
|
+
IaC (`CDK` or `Terraform`) owns applications, environments, profiles, validators, deployment strategies and IAM. Name who changes live values, audit those changes and reconcile emergency edits before applying IaC. Never silently overwrite an emergency value or store secrets in flag payloads.
|
|
55
|
+
|
|
56
|
+
## Sources
|
|
57
|
+
|
|
58
|
+
- AppConfig pricing and Parameter Store tiers: https://aws.amazon.com/systems-manager/pricing/
|
|
59
|
+
- SSM quotas: https://docs.aws.amazon.com/general/latest/gr/ssm.html#parameter-store
|
|
60
|
+
- Agent: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-agent-how-to-use.html
|
|
61
|
+
- Lambda caching: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-config.html
|
|
62
|
+
- DynamoDB pricing: https://aws.amazon.com/dynamodb/pricing/on-demand/
|
|
63
|
+
- Python freeform rules: https://docs.powertools.aws.dev/lambda/python/latest/utilities/feature_flags/
|
|
64
|
+
- Evidently API notice: https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/Welcome.html
|
|
65
|
+
- Evidently announcement: https://aws.amazon.com/blogs/mt/support-for-amazon-cloudwatch-evidently-ending-soon
|
|
66
|
+
- boto3 resources (no new features): https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html
|
|
67
|
+
- Valkey GLIDE: https://github.com/valkey-io/valkey-glide
|
|
68
|
+
- GLIDE client-side caching: https://glide.valkey.io/concepts/client-features/client-side-caching/
|
|
69
|
+
- ElastiCache IAM auth: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth-iam.html
|
|
70
|
+
- Aurora DSQL connectors: https://github.com/awslabs/aurora-dsql-connectors
|
|
71
|
+
- OpenSearch Serverless clients: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-clients.html
|
|
72
|
+
- KCL: https://docs.aws.amazon.com/streams/latest/dev/kcl.html
|
|
73
|
+
- MSK IAM clients: https://docs.aws.amazon.com/msk/latest/developerguide/configure-clients-for-iam-access-control.html
|
|
74
|
+
- Durable execution SDKs: https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-sdk.html
|