Today I have a new AWS Lambda question, and can\'t find anywhere in Google.
I new a Lambda function, there is no question. But when I input any code in this function[eg.
AWSLambdaVPCAccessExecutionRole
managed policy fits like a glove (and we all know IAM Managed Policies are an AWS-recommended best-practice).Piping aws lambda get-function-configuration
output in to a grep for Role (probably a cleaner/leaner/meaner way to do this)
aws lambda get-function-configuration \
--function-name <> \
| grep "Role"
return
"Role": "arn:aws:iam::000000000000:role/service-role/your-service-role-name",
Take the value after the Role ARN's last slash your-service-role-name
to #2
AWSLambdaVPCAccessExecutionRole
to Service Roleaws iam attach-role-policy \
--role-name your-service-role-name \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole