AWS技术问题:开发Lex函数时Lambda未显示在下拉选择列表
Hey, I’ve run into exactly this same frustrating issue before—nothing’s more annoying than trying to wire up services and having the dropdown stay empty! Let’s walk through the most common fixes that got me back on track:
Double-check IAM Permissions
First off, make sure the IAM user/role you’re logged in with has thelambda:ListFunctionspermission. This is the base permission that lets you see Lambda functions in any AWS service console. A lot of times, custom IAM policies forget this—they grant Lex-specific access but skip the Lambda list permission. You can test this temporarily by attaching theAWSLambdaReadOnlyAccessmanaged policy to your user/role; if functions show up after that, you know your custom policy is missing something. Also, watch out for resource or region restrictions in your policy that might filter out your functions.Verify Region Matching
AWS services are region-locked! If you created your Lambda inus-east-1but you’re working in theus-west-2Lex console, those functions won’t show up. Double-check the region selector in the top-right corner of both the Lambda and Lex consoles to make sure they’re pointing to the same region. This is such a common oversight—don’t skip this step!Check Lambda Runtime/Compatibility
Some AWS services have specific requirements for Lambda runtimes. For example, Lex might not support end-of-life runtimes like Python 2.7, or might require functions to have certain trigger configurations. Head over to your Lambda console and confirm your function is using a runtime that’s supported by the service you’re trying to connect it to.Clear Browser Cache or Try a Different Browser
Sometimes it’s just a flaky console cache. Try hard-refreshing the page (Ctrl+Shift+R or Cmd+Shift+R), opening the console in incognito mode, or switching to another browser. AWS’s web console can occasionally glitch and fail to load resource lists properly.Check AWS Organizations SCPs (If Applicable)
If your account is part of an AWS Organization, there might be a Service Control Policy (SCP) that restricts access to Lambda functions for your organizational unit. Reach out to your org admin to verify that there aren’t any policies blockinglambda:ListFunctionsor restricting which functions you can access.
As a quick diagnostic step, try running the AWS CLI command aws lambda list-functions in your terminal. If the CLI returns your functions but the console doesn’t, the issue is almost certainly with console caching or IAM permission granularity. If the CLI also returns an empty list, double-check that you actually have Lambda functions deployed in the correct region!
内容的提问来源于stack exchange,提问作者Michael Durrant

