Overview
Cloudlvl works similarly to Terraform when it comes to AWS permissions. The AI agent needs specific permissions to create, update, or delete AWS resources on your behalf. You control exactly what the AI can do by configuring the appropriate IAM permissions.Key Principle: The AI agent only gets the permissions you explicitly
grant. If you don’t give it permission to create EC2 instances, it won’t be
able to create them, even if you ask it to.
How Permissions Work
The Terraform Analogy
Just like Terraform, Cloudlvl:- Indexes your current infrastructure (no permissions needed - done during deployment)
- Plans changes based on your requests using the indexed data
- Applies changes to AWS resources (requires write permissions)
- Manages state and tracks what it has created
Important: When you ask “List my EC2 instances”, the AI agent doesn’t
query AWS directly. It uses its indexed knowledge of your infrastructure from
the last deployment. This means no read permissions are required for
viewing your current resources.
Permission Levels
You only need to configure permissions for actions that modify your infrastructure:Service-Level
Grant access to entire AWS services (e.g., all EC2 operations)
Action-Level
Grant specific actions (e.g., only create and describe instances)
Resource-Level
Limit access to specific resources (e.g., only instances with certain tags)
Condition-Based
Add conditions like time, IP, or MFA requirements
Common Permission Scenarios
Scenario 1: Web Application Infrastructure
What you want to build: A typical web app with EC2, RDS, and Load Balancer Required permissions:- “Create a web server with a MySQL database”
- “Add a load balancer to distribute traffic”
- “Scale up to 3 web servers”
Scenario 2: Serverless Application
What you want to build: Lambda functions, API Gateway, and DynamoDB Required permissions:- “Create a REST API with Lambda backend”
- “Add a DynamoDB table for user data”
- “Set up CRUD operations for my API”
- Only allows t2 and t3 instance types (cost control)
- Limits to specific regions
- Perfect for development workloads
AWS Managed Policies
For quick setup, you can use AWS managed policies:Recommended Policies by Use Case
PowerUserAccess
Best for: Most production use cases
Includes: All services except IAM user management
Includes: All services except IAM user management
AdministratorAccess
Best for: Full control scenarios
Includes: Everything (including IAM)
Includes: Everything (including IAM)
EC2FullAccess
Best for: Compute-focused workloads
Includes: Complete EC2 management
Includes: Complete EC2 management
Custom Policy
Best for: Specific requirements
Includes: Only what you define
Includes: Only what you define
Creating Custom Policies
Step-by-Step Policy Creation
-
Identify what you want to build
- List the AWS services you’ll need
- Think about the lifecycle (create, update, delete)
-
Find the required actions
- Use AWS documentation to find action names
- Consider both primary and supporting actions
-
Test with minimal permissions
- Start restrictive and add permissions as needed
- Monitor CloudTrail logs for denied actions
Example: Building a Custom Policy
Let’s say you want the AI agent to manage S3 buckets and CloudFront distributions:- ✅ Managing S3 buckets that start with “cloudlvl-”
- ✅ Full CloudFront distribution management
- ❌ Cannot access other S3 buckets
- ❌ Cannot manage other AWS services
Permission Testing
How to Test Your Permissions
-
Start with a simple request (no permissions needed)
This works immediately as it uses indexed data
-
Try creating something small (requires permissions)
This requires s3:CreateBucket permission
-
Test modifications (requires permissions)
This requires s3:PutBucketLifecycleConfiguration permission
-
Test cleanup (requires permissions)
This requires s3:DeleteBucket permission
Common Permission Errors
AccessDenied: The AI agent doesn’t have permission for the requested
modification action - Solution: Add the missing permission to your
policy - Note: This only happens when trying to create/update/delete
resources
InvalidUserID.NotFound: The AI agent can’t assume the role - Solution:
Check your trust policy configuration
UnauthorizedOperation: Specific action is blocked - Solution: Review
resource-level restrictions in your policy
Best Practices
Security Best Practices
-
Start with least privilege
- Begin with minimal permissions
- Add permissions as needed
-
Use resource restrictions
- Limit access to specific resource patterns
- Use tags to control access
-
Rotate credentials
- For IAM users, rotate access keys regularly
- For roles, monitor usage patterns
Getting Help
If you’re having permission issues:- Check the error message - it usually indicates the missing permission
- Review AWS documentation for the service you’re trying to use
- Test with AWS CLI using the same credentials
- Use AWS Policy Simulator to test your policies
Still Need help ?
Contact our support team for assistance with complex permission scenarios
hello@cloudlvl.com