我正在使用此博客作为引用来构建可搜索的企业文档存储库:https://aws.amazon.com/blogs/compute/creating-a-searchable-enterprise-document-repository/
创建Amazon ElasticSearch域是成功的。
我也创建了一个S3存储桶。
我正在使用此仓库(如博客中所指定):https://github.com/aws-samples/s3-to-lambda-patterns/tree/master/docrepository
但是,部署应用程序不起作用。
我使用正确的存储桶名称和ESdomain更新了“samconfig.toml”文件。
命令“sam deploy”导致失败。
错误:queryESFunction可能未定义授权。
我应该做些什么改变才能使它工作?
我认为我们可能必须在“template.yaml”文件中设置一些授权,但是我应该在此处设置什么属性?
最佳答案
该错误表明该应用程序配置了API网关,即未经授权的API。
以下是一些选项(未经测试):
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: Dev
Auth:
Authorizer: 'NONE'
sam deploy --guided
。遵循屏幕上的提示,直到您看到queryESFunction可能没有授权定义的提示。从Deploy your application to the AWS Cloud