如何在AWS中创建Webhook侦听器
我想在AWS中创建一个Webhook侦听器,以从Azure接收数据。 我已经从Azure Runbook创建了一个带有SQL Server的Webhook URL数据的Webhook
$SQLServerCred = Get-AutomationPSCredential -Name "SqlCred"
$SQL_Server_Name = Get-AutomationVariable -Name "SqlServer"
$SQL_DB_Name = Get-AutomationVariable -Name "Database"
$Query = "select Calculated from dbo.Testings"
$Results = invoke-sqlcmd -ServerInstance "$SQL_Server_Name" -Database "$SQL_DB_Name" -Credential $SQLServerCred -Query "$Query" -QueryTimeout 420
Write-Output $Results
,我不知道如何将其转发给AWS。 我知道Lambda可以以某种方式完成,但是除了转发到Github或Slack之外,我没有找到任何教程。 我希望有人可以为我提供学习的链接或一些可以指导我通过的示例代码。非常感谢!
I want to create a webhook listener in AWS to receive data from Azure.
I've created a webhook from Azure Runbook with my data from Sql Server
$SQLServerCred = Get-AutomationPSCredential -Name "SqlCred"
$SQL_Server_Name = Get-AutomationVariable -Name "SqlServer"
$SQL_DB_Name = Get-AutomationVariable -Name "Database"
$Query = "select Calculated from dbo.Testings"
$Results = invoke-sqlcmd -ServerInstance "$SQL_Server_Name" -Database "$SQL_DB_Name" -Credential $SQLServerCred -Query "$Query" -QueryTimeout 420
Write-Output $Results
With the webhook URL, I don't know how to forward it to AWS.
I know it can somehow be done by Lambda, but I didn't find any tutorial except forwarding to github or slack.
I'm hoping someone could give me a link to learn or some sample code that could guide me through it. Many Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用API网关公开HTTP API。 API网关可用于触发lambda功能,然后使用lambda函数您可以执行所需的任务。您也可以尝试直接与AWS服务集成,而不是使用Lambda功能。
要遵循的简单步骤是
AWS文档
https://docs.aws.amazon.com/apigateway/latest/latest/developerguide/getting-started.html
将数据上传到S3的示例通过webhook
api网关配置
You can use an API gateway to expose an HTTP API. API gateway can be used to trigger the lambda function and then using the lambda function you can perform the required task. You can also try integrating with AWS services directly instead of using the lambda function.
The simple steps to follow are
AWS Document
https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html
An example for uploading data to S3 via Webhook
API Gateway configuration