AWS Lambda创建函数角色报错求助:角色模板创建失败
Hey there, I’ve run into this exact frustrating error a few times before. Let’s walk through some under-the-radar checks that might fix your issue, since you’ve already tried the common steps like using new/existing roles, blueprint/blank creation, and root account verification:
Verify the role's trust policy is correctly configured
Lambda requires the role to trust the Lambda service principal. Sometimes when editing existing roles or using custom ones, the trust relationship might get messed up. Head to the IAM role's Trust relationships tab, edit the policy document, and ensure it includes this:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }Check for hidden characters or case sensitivity quirks in role names
While IAM role names are case-insensitive, copied-pasted names might have invisible whitespace, full-width characters, or typos that make the system think the role already exists (or is invalid). Try manually typing a simple name likelambda-test-role-001with only letters, numbers, and hyphens.Inspect the sub-account's permission boundary
Even if your sub-account has policies likeIAMFullAccess, a permission boundary could block role creation/modification. Go to the IAM user's Permissions boundary section, temporarily remove any applied boundary, and retry creating the Lambda function.Check service quotas for IAM roles in your region
It’s rare, but you might have hit the maximum number of IAM roles allowed in your AWS region. Navigate to the Service Quotas console, search for "IAM Roles", and confirm your current count hasn’t reached the quota limit.Reset your console state
Browser cache or lingering session state can cause odd console behavior. Try creating the Lambda function in an incognito/private window, or clear your browser cache and re-login to the AWS console.
内容的提问来源于stack exchange,提问作者Neal

