iam
Skill1.2k starsChanged 3 months agoMITView on GitHub
AWS Identity and Access Management for users, roles, policies, and permissions. Use when creating IAM policies, configuring cross-account access, setting up service roles, troubleshooting permission errors, or managing access control.
2 other projects use a version of this.
Trending
More talk lately.thin dataabout the whole repository
Most recently taken up by
- jpantsjoha/googlecloud-plugintheir own version, first seen Jul 23, 2026
- wittyreference/twilio-claude-plugintheir own version, first seen Apr 13, 2026
Who's talking about itsmostafa/aws-agent-skills
- @tom-doerr.bsky.social“https://github.com/itsmostafa/aws-agent-skills”Bluesky · Mar 19, 2026 · 1 likes
- ProSkillsMD/proskills“[Candidate] itsmostafa/aws-agent-skills/skills/api-gateway - api-gateway”GitHub · Oct 4, 2026
- sudosubin/agents.nix“claude-code-plugins.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Oct 4, 2026
- sudosubin/agents.nix“claude-code-marketplaces.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Sep 28, 2026
The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 6
Talked about on GitHub and Bluesky (6 times).
On GitHub · 5
- Oct 4, 2026[Candidate] itsmostafa/aws-agent-skills/skills/api-gateway - api-gateway — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 4, 2026claude-code-plugins.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-marketplaces.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Sep 28, 2026agent-skills.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Apr 25, 2026Audit candidate: itsmostafa/aws-agent-skills — xiaolai/nlpm0 reactions · 102 comments
On Bluesky · 1
- Mar 19, 2026https://github.com/itsmostafa/aws-agent-skills — @tom-doerr.bsky.social1 likes and repost
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jpantsjoha/googlecloud-plugin★ 4same name
- wittyreference/twilio-claude-plugin★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- api-gatewaySkill
- bedrockSkill
- cloudformationSkill
- cloudwatchSkill
- cognitoSkill
- dynamodbSkill
- ec2Skill
- ecsSkill
- eksSkill
- eventbridgeSkill
- lambdaSkill
- rdsSkill
- s3Skill
- secrets-managerSkill
- snsSkill
- sqsSkill
- step-functionsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 187
Use roles: instead of long-term access keys
- Distinctive: line 195
Start with AWS managed policies, customize as needed
- Very specific: line 196
Use policy variables (${aws:username}) for dynamic policies
- Distinctive: line 197
Prefer explicit denies for sensitive actions
- Distinctive: line 203
Use IAM Access Analyzer to identify overly permissive policies
- Very specific: line 215
Check attached policies: aws iam list-attached-role-policies --role-name MyRole
- Distinctive: line 223
Check for explicit denies in SCPs or permission boundaries
- Distinctive: line 224
Verify resource-based policies allow the principal
- Distinctive: line 244
Solution: Use multiple policies, reference resources by prefix/wildcard, or use tags-based access control.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
AWS IAM
AWS Identity and Access Management (IAM) enables secure access control to AWS services and resources. IAM is foundational to AWS security—every AWS API call is authenticated and authorized through IAM.
Table of Contents
- Core Concepts
- Common Patterns
- CLI Reference
- Best Practices
- Troubleshooting
- References
Core Concepts
Principals
Entities that can make requests to AWS: IAM users, roles, federated users, and applications.
Policies
JSON documents defining permissions. Types:
- Identity-based: Attached to users, groups, or roles
- Resource-based: Attached to resources (S3 buckets, SQS queues)
- Permission boundaries: Maximum permissions an identity can have
- Service control policies (SCPs): Organization-wide limits
Roles
Identities with permissions that can be assumed by trusted entities. No permanent credentials—uses temporary security tokens.
Trust Relationships
Define which principals can assume a role. Configured via the role's trust policy.
Common Patterns
Create a Service Role for Lambda
AWS CLI:
# Create the trust policy
cat > trust-policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "lambda.amazonaws.com" },
"Action": "sts:AssumeRole"
}
]
}
EOF
# Create the role
aws iam create-role \
--role-name MyLambdaRole \
--assume-role-policy-document file://trust-policy.json
# Attach a managed policy
aws iam attach-role-policy \
--role-name MyLambdaRole \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRoleboto3:
import boto3
import json
iam = boto3.client('iam')
trust_policy = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "lambda.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
# Create role
iam.create_role(
RoleName='MyLambdaRole',
AssumeRolePolicyDocument=json.dumps(trust_policy)
)
# Attach managed policy
iam.attach_role_policy(
RoleName='MyLambdaRole',
PolicyArn='arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
)Create Custom Policy with Least Privilege
cat > policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
}
]
}
EOF
aws iam create-policy \
--policy-name MyDynamoDBPolicy \
--policy-document file://policy.jsonCross-Account Role Assumption
# In Account B (trusted account), create role with trust for Account A
cat > cross-account-trust.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111111111111:root" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": { "sts:ExternalId": "unique-external-id" }
}
}
]
}
EOF
# From Account A, assume the role
aws sts assume-role \
--role-arn arn:aws:iam::222222222222:role/CrossAccountRole \
--role-session-name MySession \
--external-id unique-external-idCLI Reference
Essential Commands
| Command | Description |
aws iam create-role | Create a new IAM role |
aws iam create-policy | Create a customer managed policy |
aws iam attach-role-policy | Attach a managed policy to a role |
aws iam put-role-policy | Add an inline policy to a role |
aws iam get-role | Get role details |
aws iam list-roles | List all roles |
aws iam simulate-principal-policy | Test policy permissions |
aws sts assume-role | Assume a role and get temporary credentials |
aws sts get-caller-identity | Get current identity |
Useful Flags
--query: Filter output with JMESPath--output table: Human-readable output--no-cli-pager: Disable pager for scripting
Best Practices
Security
- Never use root account for daily tasks
- Enable MFA for all human users
- Use roles instead of long-term access keys
- Apply least privilege — grant only required permissions
- Use conditions to restrict access by IP, time, or MFA
- Rotate credentials regularly
- Use permission boundaries for delegated administration
Policy Design
- Start with AWS managed policies, customize as needed
- Use policy variables (
${aws:username}) for dynamic policies - Prefer explicit denies for sensitive actions
- Group related permissions logically
Monitoring
- Enable CloudTrail for API auditing
- Use IAM Access Analyzer to identify overly permissive policies
- Review credential reports regularly
- Set up alerts for root account usage
Troubleshooting
Access Denied Errors
Symptom: AccessDeniedException or UnauthorizedAccess
Debug steps:
- Verify identity:
aws sts get-caller-identity - Check attached policies:
aws iam list-attached-role-policies --role-name MyRole - Simulate the action:
aws iam simulate-principal-policy \ --policy-source-arn arn:aws:iam::123456789012:role/MyRole \ --action-names dynamodb:GetItem \ --resource-arns arn:aws:dynamodb:us-east-1:123456789012:table/MyTable - Check for explicit denies in SCPs or permission boundaries
- Verify resource-based policies allow the principal
Role Cannot Be Assumed
Symptom: AccessDenied when calling AssumeRole
Causes:
- Trust policy doesn't include the calling principal
- Missing
sts:AssumeRolepermission on the caller - ExternalId mismatch (for cross-account roles)
- Session duration exceeds maximum
Fix: Review and update the role's trust relationship.
Policy Size Limits
- Managed policy: 6,144 characters
- Inline policy: 2,048 characters (user), 10,240 characters (role/group)
- Trust policy: 2,048 characters
Solution: Use multiple policies, reference resources by prefix/wildcard, or use tags-based access control.
References
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.

