βοΈ IAM Policy Formatter
Format and validate AWS IAM policy JSON documents.
IAM Policy Structure
π Key Elements
- Version: Policy language version (usually "2012-10-17")
- Statement: Array of policy statements
- Effect: Allow or Deny
- Action: AWS service actions
- Resource: AWS resources (ARNs)
π Example Policy
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket/*"
}]
} π Best Practices
- Use least privilege principle
- Be specific with resources
- Add conditions when possible
- Regularly review and audit policies
- Use managed policies when available