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

cursor-rules / rules

Cursor rule8 starsChanged 19 months agoMITView on GitHub

AWS CloudFormation Development Standards

The file

Show its rules and text

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈40

    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 a consistent logical resource naming convention

    line 16
  2. Distinctive:

    Add metadata for improved template documentation

    line 17
  3. Distinctive:

    Keep templates modular and focused on specific components

    line 20
  4. Distinctive:

    Use nested stacks for complex architectures

    line 21
  5. Distinctive:

    Use intrinsic functions (Ref, GetAtt, etc.) appropriately

    line 26
  6. Distinctive:

    Use DependsOn only when explicit dependencies are required

    line 28
  7. Distinctive:

    Use UpdateReplacePolicy to protect data during updates

    line 32
  8. Distinctive:

    Add parameter descriptions for clarity

    line 38
  9. Distinctive:

    Use SSM Parameter Store references for sensitive values

    line 42
  10. Distinctive:

    Create mappings for environment-specific configurations

    line 45
  11. Distinctive:

    Use mappings for instance types, AMIs, and similar variations

    line 48
  12. Distinctive:

    Document mapping structure and usage

    line 49
  13. Distinctive:

    Keep mappings updated with latest values

    line 50
  14. Distinctive:

    Use FindInMap function correctly

    line 51
  15. Distinctive:

    Create conditions for resource inclusion/exclusion

    line 55
  16. Distinctive:

    Use conditions for feature toggles

    line 57
  17. Distinctive:

    Document condition purpose and logic

    line 59
  18. Distinctive:

    Keep condition expressions readable

    line 60
  19. Distinctive:

    Test condition outcomes in different scenarios

    line 61
  20. Distinctive:

    Use descriptive output names

    line 66
  21. Distinctive:

    Add descriptions to outputs

    line 67
  22. Distinctive:

    Document output usage and purpose

    line 72
  23. Distinctive:

    Use dynamic references for sensitive information

    line 76
  24. Distinctive:

    Avoid hardcoding credentials or sensitive data

    line 77
  25. Distinctive:

    Use secure default values for parameters

    line 82
  26. Distinctive:

    Use cfn-lint for syntax and best practice checking

    line 86
  27. Distinctive:

    Run static analysis on templates

    line 88
  28. Distinctive:

    Test templates in development environments

    line 89
  29. Distinctive:

    Check for circular dependencies

    line 91
  30. Distinctive:

    Ensure resource limits are respected

    line 92
  31. Distinctive:

    Use version control for template management

    line 95
  32. Distinctive:

    Document template changes in commit messages

    line 97
  33. Distinctive:

    Use branches for template development

    line 98
  34. Distinctive:

    Test templates in isolated environments

    line 100
  35. Distinctive:

    Use drift detection for deployed stacks

    line 101
  36. Distinctive:

    Use change sets for controlled updates

    line 106
  37. Distinctive:

    Use stack policies to protect critical resources

    line 110
  38. Distinctive:

    Use Custom Resources for special use cases

    line 115
  39. Distinctive:

    Use Macros for template transformations

    line 117
  40. Distinctive:

    Use dynamic references to external configuration

    line 120

≈ “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-cloudformation.mdc
---
description: AWS CloudFormation Development Standards
globs: 
alwaysApply: false
---
---
Description: AWS CloudFormation Development Standards
Globs: **/*.yaml, **/*.yml, **/*.json, **/*.template
---

# AWS CloudFormation Development Standards
@base.mdc

## Template Structure
- Organize templates with clear sections (Parameters, Mappings, Resources, Outputs)
- Use a consistent logical resource naming convention
- Add metadata for improved template documentation
- Implement description fields for templates and resources
- Group related resources together in the template
- Keep templates modular and focused on specific components
- Use nested stacks for complex architectures
- Implement stack sets for multi-account/region deployments

## Resource Definitions
- Define resources with appropriate properties
- Use intrinsic functions (Ref, GetAtt, etc.) appropriately
- Implement resource dependencies correctly
- Use DependsOn only when explicit dependencies are required
- Configure deletion policies for stateful resources
- Set up update policies for controlled updates
- Implement creation policies for resource initialization
- Use UpdateReplacePolicy to protect data during updates

## Parameters
- Define parameters for configurable values
- Specify appropriate parameter types
- Set default values when applicable
- Add parameter descriptions for clarity
- Implement parameter constraints (AllowedValues, Min/Max)
- Group similar parameters using parameter groups
- Organize parameters in a logical order
- Use SSM Parameter Store references for sensitive values

## Mappings
- Create mappings for environment-specific configurations
- Structure mappings with logical hierarchies
- Implement region-specific configurations via mappings
- Use mappings for instance types, AMIs, and similar variations
- Document mapping structure and usage
- Keep mappings updated with latest values
- Use FindInMap function correctly
- Implement proper fallbacks for mapping lookups

## Conditions
- Create conditions for resource inclusion/exclusion
- Implement environment-specific conditions
- Use conditions for feature toggles
- Combine conditions logically when necessary
- Document condition purpose and logic
- Keep condition expressions readable
- Test condition outcomes in different scenarios
- Implement default behaviors for condition failure

## Outputs
- Export important resource information
- Use descriptive output names
- Add descriptions to outputs
- Export values needed by other stacks
- Implement proper cross-stack references
- Output URLs, ARNs, and other useful identifiers
- Organize outputs by logical groups
- Document output usage and purpose

## Security Best Practices
- Implement least privilege IAM policies
- Use dynamic references for sensitive information
- Avoid hardcoding credentials or sensitive data
- Implement proper resource-level permissions
- Configure encryption for sensitive resources
- Set up proper VPC configurations
- Implement security groups with minimum required access
- Use secure default values for parameters

## Template Validation
- Validate templates with CloudFormation linting tools
- Use cfn-lint for syntax and best practice checking
- Implement cfn-nag for security validation
- Run static analysis on templates
- Test templates in development environments
- Validate parameter constraints
- Check for circular dependencies
- Ensure resource limits are respected

## Template Management
- Use version control for template management
- Implement a change management process
- Document template changes in commit messages
- Use branches for template development
- Implement peer reviews for template changes
- Test templates in isolated environments
- Use drift detection for deployed stacks
- Implement proper backup and recovery procedures

## Deployment Strategies
- Implement staged deployments across environments
- Use change sets for controlled updates
- Configure appropriate stack update behaviors
- Implement rollback triggers for failed deployments
- Set up proper monitoring during deployments
- Use stack policies to protect critical resources
- Implement blue/green deployments for zero-downtime updates
- Configure proper timeout values for resource creation/updates

## Optimization
- Use Custom Resources for special use cases
- Implement proper error handling in custom resources
- Use Macros for template transformations
- Leverage StackSets for multi-account deployments
- Implement resource import for existing resources
- Use dynamic references to external configuration
- Optimize template size for large deployments
- Implement proper resource cleanup for cost efficiency

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.