(aws-lambda): Use PoLP inline IAM policies instead of AWS managed policies #31756
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Lambdas are created with inline policies that follow PoLP instead of AWS managed policies.
Use Case
Currently Lambdas are created with AWS managed policies for logging and VPC access.
AWS managed policies used by the CDK:
AWSLambdaBasicExecutionRole
AWSLambdaVPCAccessExecutionRole
In most cases AWS managed policies are considered overly permissive and customer managed policies should be used in their place.
Lambdas should be created with sensible defaults based on AWS best practices.
Proposed Solution
The CDK creates Lambdas without using AWS managed policies. Instead, it uses custom inline policies based on the PoLP.
Other Information
Existing GitHub discussion
Acknowledgements
CDK version used
2.162.1
Environment details (OS name and version, etc.)
Ubuntu 24.04.1
The text was updated successfully, but these errors were encountered: