yaml - 在无服务器框架中找不到导出名称 XYZ
问题描述
functions:
wsConnect:
handler: src/handlers/wsConnect.handler
name: ${self:provider.stage}-wsConnect
environment:
WS_SERVICE: ${self:provider.stage}-wsService
events:
- websocket:
route: $connect
wsDisconnect:
handler: src/handlers/wsDisconnect.handler
name: ${self:provider.stage}-wsDisconnect
environment:
WS_SERVICE: ${self:provider.stage}-wsService
events:
- websocket:
route: $disconnect
wsDefault:
handler: src/handlers/wsDefault.handler
name: ${self:provider.stage}-wsDefault
events:
- websocket:
route: $default
resources:
Outputs:
ExportedWebSocketpi:
Value: !Ref WebsocketsApi # Logical ID
Export:
Name: webSocketAPI
ExportedRestApi:
Value: !Ref ApiGatewayRestApi # Logical ID
Export:
Name: rest-wsAPI
custom:
importwebSocketAPI:
Fn::ImportValue: webSocketAPI
我已经创建了这个 WebSocket 并第一次尝试部署它,它显示No export name webSocketAPI found, custom: tag is executed before output export the API。我如何使用 DependsOn 来做到这一点,或者有没有其他方法可以做到这一点?
解决方案
您缺少输出的必填字段 -值
在这里,您可能会发现如何在无服务器框架中设置输出
另一个例子:
resources:
Outputs:
DBUserName:
Value: ${self:custom.dbCredentials.DB_USERNAME}
DBPassword:
Value: ${self:custom.dbCredentials.DB_PSW}
RDSClusterID:
Description: "RDS Cluster"
Value: { Ref: RDSCluster }
CognitoUserPoolId:
Value: ${self:custom.userPool}
推荐阅读
- javascript - Bootstrap popper 对我的生活不起作用
- encryption - 解密 Word 文档,了解其部分内容
- javascript - 如何从 yupgrid 中删除或禁用添加行和删除行操作按钮?
- python - 如何从 PHP exec 调用 python
- python - 如何解决给定节点连接、节点值和查询的树差异问题?(Dijkstra 算法)
- javascript - React Native - [未处理的承诺拒绝:错误:注册错误]
- node.js - 如何在输出子进程nodejs中将格式列表转换为json?
- java - 如何让我的扫描仪以多种方法工作
- python - Python unittest 仅运行第一个测试而不运行其他测试
- c# - 指定的包含路径无效。EntityType 'DB_A50B96_aljawdahlabModel.LAB_RESULTS'