feat(aws-serverless): add aws-serverless plugin#52
feat(aws-serverless): add aws-serverless plugin#52gunnargrosch wants to merge 8 commits intoawslabs:mainfrom
Conversation
aws-serverless-deployment skills Add the aws-serverless plugin with two new skills, MCP server configuration, SAM template validation hook, and marketplace entry. - aws-lambda: Lambda runtime behavior, event sources, EventBridge, Step Functions, orchestration, observability, optimization, and troubleshooting - aws-serverless-deployment: SAM and CDK project setup, CDK constructs and patterns, CI/CD pipelines, and SAM/CDK coexistence Also adds the aws-serverless MCP server (.mcp.json), a SAM template validation hook, and updates the marketplace registry. Based on https://github.com/gunnargrosch/aws-serverless-plugin
Add the aws-lambda-durable-functions skill to the aws-serverless plugin with getting started guide, checkpoint-replay model, testing guidance, advanced patterns, and error handling references.
| @@ -0,0 +1,35 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Would we want a validation tool to provide linting as well? --lint flag will use cfn-lint, which could be useful.
|
|
||
| FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty') | ||
|
|
||
| # Only validate SAM template files |
There was a problem hiding this comment.
sam validate also works on non-SAM templates as well, although that might not be important in the context of this tool.
There was a problem hiding this comment.
The comment was more meant to clarify that it doesn't validate other types of files, such as Lambda handlers etc.
| This skill requires AWS credentials configured on the host machine: | ||
|
|
||
| 1. **Install AWS CLI**: Follow the [AWS CLI installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) | ||
| 2. **Configure credentials**: Run `aws configure` or set up named profiles in `~/.aws/credentials` |
There was a problem hiding this comment.
Will the agent know what to do with aws configure?
| ### SAM CLI Setup | ||
|
|
||
| 1. **Install SAM CLI**: Follow the [SAM CLI installation guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html) | ||
| 2. **Install Docker Desktop**: Required for `sam_local_invoke` and container-based builds |
There was a problem hiding this comment.
This isn't necessarily true, on Linux it's probably preferred to not have docker desktop. Also, we support container engines other than docker, Finch specifically.
There was a problem hiding this comment.
Fully agree, rephrased to be vendor agnostic
| | Python 3.12 | Data processing, ML workloads, scripting | | ||
| | Node.js 22.x | Web APIs, real-time applications | | ||
| | Java 21 | Enterprise applications, high-performance computing | | ||
| | Go 1.x | Microservices, high-concurrency, low-latency | | ||
| | .NET 8 | Windows-centric applications, enterprise integration | |
There was a problem hiding this comment.
I'd be wary of keeping a list of runtimes like this; for all of these there are newer versions available, and .NET 8 is starting its deprecation cycle within the year. There's a couple places that reference Python 3.12, and I'm not sure what the standard practice is for having versions like this.
There was a problem hiding this comment.
@gunnargrosch do you agree that we remove this table completely?
There was a problem hiding this comment.
Should these patterns have descriptions so that the agent can better understand when to use them?
| | ------------------------ | ------------------------------------- | --------------------------------------------------------- | | ||
| | **Language** | YAML/JSON (declarative) | TypeScript, Python, Java, Go, C# (imperative) | | ||
| | **Learning curve** | Lower — close to CloudFormation | Higher — requires familiarity with a programming language | | ||
| | **Local testing** | `sam local invoke` built-in | Requires external tools (Localstack, docker) | |
There was a problem hiding this comment.
This is not true, as explained in sam-cdk-coexistence.md, sam local invoke works for any CFN template.
There was a problem hiding this comment.
There are a couple things referencing this below that need to be cleaned up.
| | **Language** | YAML/JSON (declarative) | TypeScript, Python, Java, Go, C# (imperative) | | ||
| | **Learning curve** | Lower — close to CloudFormation | Higher — requires familiarity with a programming language | | ||
| | **Local testing** | `sam local invoke` built-in | Requires external tools (Localstack, docker) | | ||
| | **Abstraction level** | Thin layer over CloudFormation | Rich L2/L3 constructs handle wiring automatically | |
There was a problem hiding this comment.
'Thin layer' might not be really true, SAM can handle a lot of wiring automatically for Serverless resources.
|
|
||
| For topic-specific best practices, see the dedicated guide files in the reference table above. | ||
|
|
||
| ## Lambda Limits Quick Reference |
There was a problem hiding this comment.
I don't know off the top of my head, but I would make sure these limits are correct and up to date.
| | **Local testing** | `sam local invoke` built-in | Requires external tools (Localstack, docker) | | ||
| | **Abstraction level** | Thin layer over CloudFormation | Rich L2/L3 constructs handle wiring automatically | | ||
| | **Code sharing** | Template fragments only | Full reuse via construct libraries (npm, PyPI) | | ||
| | **Loops and conditions** | Limited (`Fn::If`, no loops) | Native language constructs (`for`, `if`, maps) | |
There was a problem hiding this comment.
I think technically Fn::ForEach loops are supported by all CFN templates. The issue is that SAM CLI does not know how to read these, although support for this is coming soon actually.
- Remove sensitive data access flags from MCP server configuration - Add --lint flag to SAM template validation for stricter checks - Update validation messages to reflect linting improvements - Reorganize SKILL.md with clearer onboarding steps and prerequisites - Refine skill description to focus on core capabilities - Add advanced-error-handling.md reference guide for timeout and circuit breaker patterns - Update reference file routing to include advanced error handling scenarios - Consolidate guidelines into onboarding section for better user flow - Improve documentation structure for better discoverability
… requirements - Split Powertools documentation into dedicated reference file (powertools.md) - Update SKILL.md routing to direct Powertools queries to new dedicated reference - Update observability.md link to point to powertools.md instead of optimization.md - Clarify Python runtime requirements for durable functions (3.11+ minimum, 3.13+ for Lambda pre-installed SDK)
|
My feedback (in addition to previous comments from other reviewers which need to be resolved):
|
- Move troubleshooting production executions content to dedicated troubleshooting-executions.md reference file - Set language and IaC framework defaults including override syntax - Add error scenario handling for unsupported languages and frameworks - Remove inline troubleshooting agent instructions from main SKILL.md for better modularity - Consolidate advanced error handling references to separate advanced-error-handling.md file - Update plugin version from 1.1.0 to 1.0.0
|
Thanks for the feedback @krokoko, I've pushed adjustments for all of it |
Summary
Related RFC: #48
aws-serverlessplugin with three skills, MCP server configuration, SAM template validation hook, and marketplace entryChanges
Plugin infrastructure:
plugin.jsonandmarketplace.jsonentry for theaws-serverlessplugin.mcp.jsonforawslabs.aws-serverless-mcp-server(SAM CLI tools, event source mappings, webapp deployment, metrics, schemas)hooks/hooks.json+scripts/validate-template.shfor automaticsam validateon template editsSkill —
aws-lambda(9 reference files):getting-started.md— project type decision tree, prerequisites, working with existing projectsevent-sources.md— DynamoDB Streams, Kinesis, SQS, Kafka, S3, SNS configurationevent-driven-architecture.md— EventBridge bus setup, event patterns, Pipes, archive and replayorchestration-and-workflows.md— orchestration approach comparison, durable functions vs Step Functionsstep-functions.md— Standard vs Express, ASL, JSONata, SDK integrations, Distributed Map, testingweb-app-deployment.md— Lambda Web Adapter, API endpoints, CORS, authentication, custom domainsobservability.md— structured logging, tracing, metrics, alarms, dashboardsoptimization.md— cold starts, memory tuning, cost, streaming, Powertoolstroubleshooting.md— common errors, debugging, deployment failuresSkill —
aws-serverless-deployment(5 reference files):sam-project-setup.md— SAM templates, deployment workflow, local testing, container imagescdk-project-setup.md— CDK setup, construct levels, IAM grants, stack separation, testing, pipelinescdk-lambda-constructs.md— NodejsFunction, PythonFunction, base Function construct examplescdk-serverless-patterns.md— API Gateway, Function URL, EventBridge, DynamoDB, SQS CDK patternssam-cdk-coexistence.md— incremental migration, usingsam buildwith CDK templatesSkill —
aws-lambda-durable-functions(9 reference files, by @bfreiberg):getting-started.md— SDK installation, basic handler pattern, ESLint/Jest setupreplay-model-rules.md— determinism rules, non-deterministic code handlingstep-operations.md— atomic operations, retry logic, step semanticswait-operations.md— delays, callbacks, external system integration, pollingconcurrent-operations.md— parallel execution, map operations, batch processingerror-handling.md— retry strategies, saga pattern, compensating transactionstesting-patterns.md— LocalDurableTestRunner, cloud testing, flaky test preventiondeployment-iac.md— CloudFormation, CDK, SAM deployment patternsadvanced-patterns.md— GenAI agents, completion policies, custom serializationOrigin
The
aws-lambdaandaws-serverless-deploymentskills are based on https://github.com/gunnargrosch/aws-serverless-pluginTest plan
mise run lint:manifestspasses for plugin.json, marketplace.json, and .mcp.jsonmise run lint:mdpasses for all SKILL.md and reference filesmise run lint:cross-refspassesclaude --plugin-dir ./plugins/aws-serverlessBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.