Blenra
Optimized for: Gemini / ChatGPT / Claude

Advanced AI Prompt for AWS Lambda Execution Role with DynamoDB Access

Use this engineered prompt to drastically optimize your workflow and output.

Required Variables

  • [TABLE_ARN]
  • [REGION]
  • [PARTITION_KEY_VALUE]
advanced-ai-prompt-lambda-dynamodb-policy.txt
Generate a least-privilege IAM execution role policy for an AWS Lambda function. The function needs to perform 'Query' and 'UpdateItem' operations on the DynamoDB table [TABLE_ARN]. Critically, use a 'Condition' block to restrict the 'dynamodb:LeadingKeys' to only allow access to items where the partition key is '[PARTITION_KEY_VALUE]'. Include permissions for CloudWatch Logs creation and streaming with a resource limit to the function's own log group.

Example Output

"The AI generates a policy with a 'dynamodb:LeadingKeys' condition, preventing the Lambda from accessing data outside its designated partition."