agentleFS
jimmypocockjimmypocock/cursor-rules/.cursor/rules/aws-sam.mdc

cursor-rules / rules

Cursor rule8 starsChanged 19 months agoMITView on GitHub

AWS Serverless Application Model (SAM) Development Standards

The file

We split this aws-sam.mdc into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use clear, descriptive resource names

    line 16
  2. Distinctive:

    Add comments for complex resource configurations

    line 17
  3. Distinctive:

    Use outputs for important resource information

    line 20
  4. Distinctive:

    Create mappings for environment-specific variables

    line 21
  5. Distinctive:

    Create appropriate event source mappings

    line 29
  6. Distinctive:

    Use SAM CLI for local testing

    line 85
  7. Distinctive:

    Use SAM accelerate for faster development

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
aws-sam.mdc
---
description: AWS Serverless Application Model (SAM) Development Standards
globs: 
alwaysApply: false
---
---
Description: AWS Serverless Application Model (SAM) Development Standards
Globs: **/*.yaml, **/*.yml, **/template.yaml, **/sam.yaml
---

# AWS SAM Development Standards
@base.mdc

## SAM Template Structure
- Organize templates with logical resource groupings
- Use clear, descriptive resource names
- Add comments for complex resource configurations
- Structure templates consistently across projects
- Implement parameters for configurable values
- Use outputs for important resource information
- Create mappings for environment-specific variables
- Split complex applications into nested stacks

## SAM Resource Definitions
- Define Lambda functions with appropriate properties
- Configure API Gateway resources properly
- Set up DynamoDB tables with correct key structures
- Implement proper S3 bucket configurations
- Create appropriate event source mappings
- Configure Step Functions state machines properly
- Set up SNS topics and SQS queues with correct attributes
- Define appropriate CloudWatch alarm resources

## Function Configuration
- Set appropriate memory and timeout values
- Configure environment variables properly
- Implement function layers for shared code
- Set up appropriate IAM roles with least privilege
- Configure function URL settings when applicable
- Implement proper VPC configurations when needed
- Set up provisioned concurrency for critical functions
- Configure proper retry behavior for event sources

## API Gateway Configuration
- Implement proper API Gateway endpoint types
- Configure appropriate authorization methods
- Set up request/response mappings properly
- Implement proper CORS settings
- Configure throttling and quota limits
- Set up appropriate caching strategies
- Implement proper stage variables
- Configure request validation when applicable

## Event Configuration
- Define appropriate event sources for Lambda functions
- Configure event filters to reduce unnecessary invocations
- Set proper batch sizes for stream-based event sources
- Implement proper failure handling for event processing
- Configure event retention and replay strategies
- Set up dead-letter queues for failed events
- Configure event source mappings with proper concurrency settings
- Implement event bridging patterns when appropriate

## Security Best Practices
- Implement proper IAM roles with least privilege
- Configure appropriate resource policies
- Set up proper encryption for all resource types
- Implement secure API authorization
- Configure VPC endpoints for private resources
- Set up WAF for public APIs
- Implement proper secret management
- Configure security groups and network ACLs properly

## Deployment Configuration
- Configure appropriate deployment preferences
- Set up canary deployments for critical resources
- Implement proper rollback triggers
- Configure CodeDeploy hooks appropriately
- Set up deployment alarms
- Implement blue/green deployment strategies
- Configure proper deployment monitoring
- Implement deployment validation tests

## Local Development
- Use SAM CLI for local testing
- Configure proper local environment variables
- Set up mock event JSON files for testing
- Implement proper debugging configurations
- Use SAM accelerate for faster development
- Configure proper local API testing
- Set up Docker for local Lambda execution
- Implement proper unit and integration testing

## CI/CD Integration
- Set up proper SAM build pipelines
- Configure deployment artifacts correctly
- Implement environment-specific configurations
- Set up proper testing stages in pipelines
- Configure appropriate approval workflows
- Implement proper artifact storage
- Set up deployment validation
- Configure proper rollback strategies

## Monitoring and Observability
- Implement proper CloudWatch logging
- Set up appropriate CloudWatch metrics
- Configure custom metrics for business KPIs
- Implement proper alarm configurations
- Set up X-Ray tracing for distributed systems
- Configure proper log groups and retention policies
- Implement centralized logging strategies
- Set up appropriate dashboards for monitoring

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.