Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides AWS CloudFormation patterns for Lambda functions, layers, API Gateway integration, event sources, cold start optimization, monitoring, logging, template validation, and deployment workflows. Use when creating Lambda functions with CloudFormation, configuring event sources, implementing cold start optimization, managing layers, integrating with API Gateway, and deploying Lambda infrastructure.
.claude/skills/giuseppe-trisciuoglio-aws-cloudformation-lambda/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 235% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 123% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 155% | 0% |
| case-22 | ✓→✗ | ▼ Worse | 193% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 110% | 0% |
Create production-ready Lambda functions using CloudFormation templates with validation and deployment workflows.
Always follow this deployment workflow:
bashaws cloudformation validate-template --template-body file://template.yaml
bashaws cloudformation deploy \ --template-file template.yaml \ --stack-name my-lambda-stack \ --capabilities CAPABILITY_IAM \ --parameter-overrides Environment=prod
bashaws cloudformation describe-stack-events \ --stack-name my-lambda-stack \ --query 'StackEvents[?ResourceStatus==`CREATE_FAILED`||ResourceStatus==`UPDATE_FAILED`]'
bashaws lambda get-function --function-name my-lambda-stack-function aws cloudformation describe-stacks --stack-name my-lambda-stack \ --query 'Stacks[0].StackStatus'
bashaws cloudformation delete-stack --stack-name my-lambda-stack aws logs describe-log-groups --log-group-name-prefix "/aws/lambda/my-lambda"
Follow these steps to create Lambda functions with CloudFormation:
Specify runtime, memory, timeout, and environment variables:
yamlParameters: FunctionMemory: Type: Number Default: 256 AllowedValues: - 128 - 256 - 512 - 1024 - 2048 Description: Lambda function memory in MB FunctionTimeout: Type: Number Default: 30 MinValue: 1 MaxValue: 900 Description: Function timeout in seconds Runtime: Type: String Default: nodejs20.x AllowedValues: - nodejs20.x - python3.11 - java21 - dotnet8 - go1.x Description: Lambda runtime environment
Define the basic function configuration:
yamlResources: LambdaFunction: Type: AWS::Lambda::Function Properties: FunctionName: !Sub "${AWS::StackName}-function" Runtime: !Ref Runtime Handler: index.handler Role: !Ref ExecutionRole MemorySize: !Ref FunctionMemory Timeout: !Ref FunctionTimeout Code: S3Bucket: !Ref CodeBucket S3Key: !Ref CodeKey Environment: Variables: LOG_LEVEL: INFO DATABASE_URL: !Ref DatabaseUrl Tags: - Key: Environment Value: !Ref Environment
Apply least privilege IAM policies:
yamlResources: ExecutionRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Principal: Service: lambda.amazonaws.com Action: sts:AssumeRole ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole Policies: - PolicyName: S3ReadAccess PolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Action: - s3:GetObject Resource: !Sub "${DataBucket.Arn}/*"
Configure triggers for Lambda invocation:
yamlResources: # S3 event source S3EventSource: Type: AWS::Lambda::EventSourceMapping Properties: EventSourceArn: !GetAtt DataBucket.Arn FunctionName: !Ref LambdaFunction # SQS event source SQSEventSource: Type: AWS::Lambda::EventSourceMapping Properties: EventSourceArn: !GetAtt Queue.Arn FunctionName: !Ref LambdaFunction BatchSize: 10 MaximumBatchingWindowInSeconds: 5
Set up REST or HTTP API integration:
yamlResources: # HTTP API integration HttpApi: Type: AWS::ApiGatewayV2::Api Properties: Name: !Sub "${AWS::StackName}-api" ProtocolType: HTTP Target: !Ref LambdaFunction ApiIntegration: Type: AWS::ApiGatewayV2::Integration Properties: ApiId: !Ref HttpApi IntegrationType: AWS_PROXY IntegrationUri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFunction.Arn}/invocations"
Create function versions and aliases:
yamlResources: LambdaVersion: Type: AWS::Lambda::Version Properties: FunctionName: !Ref LambdaFunction Description: !Sub "Version ${AWS::StackName} v1" LambdaAlias: Type: AWS::Lambda::Alias Properties: FunctionName: !Ref LambdaFunction FunctionVersion: !GetAtt LambdaVersion.Version Name: live
Enable CloudWatch logging and X-Ray tracing:
yamlResources: LambdaFunction: Type: AWS::Lambda::Function Properties: LoggingConfig: LogGroup: !Ref LogGroup TracingConfig: Mode: Active LogGroup: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub "/aws/lambda/${LambdaFunction}" RetentionInDays: 7
Configure DLQ for failed invocations:
yamlResources: DeadLetterQueue: Type: AWS::SQS::Queue Properties: QueueName: !Sub "${AWS::StackName}-dlq" LambdaFunction: Type: AWS::Lambda::Function Properties: DeadLetterConfig: TargetArn: !GetAtt DeadLetterQueue.Arn
yamlAWSTemplateFormatVersion: '2010-09-09' Description: Lambda function with monitoring and DLQ Parameters: FunctionMemory: Type: Number Default: 256 AllowedValues: [128, 256, 512, 1024] FunctionTimeout: Type: Number Default: 30 Resources: ExecutionRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Principal: { Service: lambda.amazonaws.com } Action: sts:AssumeRole ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole LambdaFunction: Type: AWS::Lambda::Function Properties: FunctionName: !Sub "${AWS::StackName}-function" Runtime: nodejs20.x Handler: index.handler Role: !GetAtt ExecutionRole.Arn MemorySize: !Ref FunctionMemory Timeout: !Ref FunctionTimeout Code: S3Bucket: !Ref CodeBucket S3Key: !Ref CodeKey Environment: Variables: LOG_LEVEL: INFO LambdaVersion: Type: AWS::Lambda::Version Properties: FunctionName: !Ref LambdaFunction LambdaAlias: Type: AWS::Lambda::Alias Properties: FunctionName: !Ref LambdaFunction FunctionVersion: !GetAtt LambdaVersion.Version Name: live Outputs: FunctionArn: Value: !GetAtt LambdaFunction.Arn FunctionName: Value: !Ref LambdaFunction
* in Resource policies; always scope to specific resourcesFor detailed implementation guidance, see:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 12,771 | 11,697 | -8% | 1 | 1 | 0% | 2,440 | 5,124 | +110% | 0 | 0 | — |
case-01 | fail→pass | 39,031 | 10,276 | -74% | 1 | 1 | 0% | 1,396 | 4,676 | +235% | 0 | 0 | — |
case-02 | fail→pass | 9,969 | 5,772 | -42% | 1 | 1 | 0% | 1,803 | 4,016 | +123% | 0 | 0 | — |
case-03 | pass→pass | 11,831 | 8,179 | -31% | 1 | 1 | 0% | 2,155 | 4,393 | +104% | 0 | 0 | — |
case-04 | fail→pass | 12,275 | 7,627 | -38% | 1 | 1 | 0% | 1,755 | 4,467 | +155% | 0 | 0 | — |
case-06 | pass→pass | 10,902 | 10,736 | -2% | 1 | 1 | 0% | 1,977 | 5,042 | +155% | 0 | 0 | — |
case-07 | pass→pass | 13,720 | 9,630 | -30% | 1 | 1 | 0% | 2,442 | 4,772 | +95% | 0 | 0 | — |
case-08 | pass→pass | 12,498 | 11,305 | -10% | 1 | 1 | 0% | 2,205 | 5,100 | +131% | 0 | 0 | — |
case-09 | pass→pass | 14,839 | 9,530 | -36% | 1 | 1 | 0% | 2,744 | 4,590 | +67% | 0 | 0 | — |
case-10 | pass→pass | 8,420 | 7,751 | -8% | 1 | 1 | 0% | 1,709 | 4,535 | +165% | 0 | 0 | — |
case-11 | pass→pass | 9,651 | 6,064 | -37% | 1 | 1 | 0% | 1,776 | 4,061 | +129% | 0 | 0 | — |
case-12 | pass→pass | 10,012 | 7,171 | -28% | 1 | 1 | 0% | 1,597 | 4,135 | +159% | 0 | 0 | — |
case-13 | pass→pass | 9,156 | 5,005 | -45% | 1 | 1 | 0% | 1,559 | 3,724 | +139% | 0 | 0 | — |
case-14 | pass→pass | 3,482 | 3,090 | -11% | 1 | 1 | 0% | 533 | 3,418 | +541% | 0 | 0 | — |
case-15 | pass→pass | 10,386 | 2,687 | -74% | 1 | 1 | 0% | 1,665 | 3,356 | +102% | 0 | 0 | — |
case-16 | pass→pass | 8,061 | 3,034 | -62% | 1 | 1 | 0% | 1,263 | 3,433 | +172% | 0 | 0 | — |
case-17 | pass→pass | 13,324 | 13,046 | -2% | 1 | 1 | 0% | 2,717 | 5,831 | +115% | 0 | 0 | — |
case-18 | pass→pass | 17,977 | 20,518 | +14% | 1 | 1 | 0% | 2,813 | 6,797 | +142% | 0 | 0 | — |
case-19 | pass→pass | 14,597 | 8,831 | -40% | 1 | 1 | 0% | 2,242 | 4,306 | +92% | 0 | 0 | — |
case-20 | pass→pass | 8,393 | 7,283 | -13% | 1 | 1 | 0% | 1,689 | 4,421 | +162% | 0 | 0 | — |
case-21 | pass→pass | 6,630 | 4,920 | -26% | 1 | 1 | 0% | 1,138 | 3,782 | +232% | 0 | 0 | — |
case-22 | pass→fail | 8,365 | 11,560 | +38% | 1 | 1 | 0% | 1,786 | 5,228 | +193% | 0 | 0 | — |
case-23 | pass→pass | 6,939 | 5,841 | -16% | 1 | 1 | 0% | 1,427 | 4,081 | +186% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.