guidance-for-claude-code-with-amazon-bedrock / deployment
CLAUDE.md405 starsChanged 5 months agoMIT-0View on GitHub
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- source/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 0 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Always: use !Sub "arn:${AWS::Partition}:..." — never hardcode arn:aws:.
- Very specific: line 15
Use ${AWS::Region}, ${AWS::AccountId} — never hardcode account/region.
- Very specific: line 20
Use !If [ConditionName, TrueValue, FalseValue] — never duplicate resources.
- Very specific: line 23
One resource per route-key: Don't create two AWS::ApiGatewayV2::Route for the same path.
- Very specific: line 24
Use !If inside a single route resource to switch AuthorizationType or Target.
- Very specific: line 40
Use AllowedValues where the set is finite (auth modes, regions).
- Very specific: line 48
Don't use DependsOn for implicit dependencies (Ref/GetAtt already creates them).
- Very specific: line 49
Don't put !Sub inside !If values that contain no variables (cfn-lint error).
- Very specific: line 50
Don't create DeletionPolicy: Retain without documenting manual cleanup steps.
- Very specific: line 51
Don't reference AWS::StackName in resource names if you plan nested stacks.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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.
Files
CLAUDE.md — CloudFormation Templates
Quick Commands
cfn-lint deployment/infrastructure/*.yaml # Validate all templates
cfn-lint deployment/infrastructure/my-stack.yaml # Validate single templateKey Rules
Partition & Region
- Always use
!Sub "arn:${AWS::Partition}:..."— never hardcodearn:aws:. - This ensures GovCloud (
aws-us-gov) and China (aws-cn) compatibility. - Use
${AWS::Region},${AWS::AccountId}— never hardcode account/region.
Conditions Pattern
- Name conditions positively:
HasOidcAuth,HasQuotaEnabled(notNoOidc). - Empty string = disabled:
!Equals [!Ref ParamName, ""]for optional params. - Use
!If [ConditionName, TrueValue, FalseValue]— never duplicate resources.
Route-Key Conflicts
- One resource per route-key. Don't create two
AWS::ApiGatewayV2::Routefor the same path. - Use
!Ifinside a single route resource to switchAuthorizationTypeorTarget. - See issue #682 for the pattern that caused a production regression.
IAM Permissions
- Exact actions only — no
s3:*orAction: "*". - Scope
Resourceto the specific ARN (use!Subwith resource refs). - Match IAM actions to actual API calls in the Lambda code.
- See
.claude/rules/iam-actions.md.
Stack Ordering
- Destroy order matters — dependent stacks must be destroyed first.
- See
.claude/rules/stack-ordering.mdfor the canonical order. - New stacks: add to both
VALID_STACKSandDESTROYABLE_STACKSindeploy.py.
Parameters
- New parameters must have
Defaultvalues (backwards compat with existing deployments). - Use
AllowedValueswhere the set is finite (auth modes, regions). - Mark sensitive params with
NoEcho: true.
Outputs & Exports
- Conditional outputs need
Condition:— don't export values that might not exist. - Export names:
${AWS::StackName}-ResourceNameformat.
Common Pitfalls
- Don't use
DependsOnfor implicit dependencies (Ref/GetAtt already creates them). - Don't put
!Subinside!Ifvalues that contain no variables (cfn-lint error). - Don't create
DeletionPolicy: Retainwithout documenting manual cleanup steps. - Don't reference
AWS::StackNamein resource names if you plan nested stacks.
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
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.

