serverless-appsync-plugin 'pipeline' 部署错误
serverless-appsync-plugin 'pipeline' deployment error
我正在使用无服务器部署 Appsync API,使用 'PIPELINE',用作 API lambda 函数。此插件 https://github.com/sid88in/serverless-appsync-plugin 用于部署具有使用 'pipeline' 能力的 Appsync。我使用了文档中的描述,但是当我尝试自己部署它时出现错误:
错误:CloudFormation 模板无效:模板错误:Fn::GetAtt 的实例引用了未定义的资源 GraphQlDsmeInfo
functions:
graphlql:
handler: handler.meInfo
name: meInfo
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: meInfo
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
有人可以帮我用管道类型配置 'serverless-appsync-plugin ' 吗?
您需要指定函数中使用的data source。
您似乎已将处理程序部署为 Lambda 函数。如果没有,首先您应该为您的 Lambda 设置一个单独的 serverless.yml
配置并部署它。然后您需要附加此 Lambda 作为 AppSync 数据源,因此您的 AppSync 配置将如下所示:
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
dataSources:
- type: AWS_LAMBDA
name: Lambda_Name
description: 'Lambda Description'
config:
lambdaFunctionArn: 'arn:aws:lambda:xxxx'
serviceRoleArn: 'arn:aws:iam::xxxx'
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: Lambda_Name
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
有一篇文章详细描述了可能有用的过程:https://medium.com/hackernoon/running-a-scalable-reliable-graphql-endpoint-with-serverless-24c3bb5acb43
我正在使用无服务器部署 Appsync API,使用 'PIPELINE',用作 API lambda 函数。此插件 https://github.com/sid88in/serverless-appsync-plugin 用于部署具有使用 'pipeline' 能力的 Appsync。我使用了文档中的描述,但是当我尝试自己部署它时出现错误: 错误:CloudFormation 模板无效:模板错误:Fn::GetAtt 的实例引用了未定义的资源 GraphQlDsmeInfo
functions:
graphlql:
handler: handler.meInfo
name: meInfo
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: meInfo
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
有人可以帮我用管道类型配置 'serverless-appsync-plugin ' 吗?
您需要指定函数中使用的data source。
您似乎已将处理程序部署为 Lambda 函数。如果没有,首先您应该为您的 Lambda 设置一个单独的 serverless.yml
配置并部署它。然后您需要附加此 Lambda 作为 AppSync 数据源,因此您的 AppSync 配置将如下所示:
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
dataSources:
- type: AWS_LAMBDA
name: Lambda_Name
description: 'Lambda Description'
config:
lambdaFunctionArn: 'arn:aws:lambda:xxxx'
serviceRoleArn: 'arn:aws:iam::xxxx'
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: Lambda_Name
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
有一篇文章详细描述了可能有用的过程:https://medium.com/hackernoon/running-a-scalable-reliable-graphql-endpoint-with-serverless-24c3bb5acb43