如何在AWS中创建Webhook侦听器

发布于 2025-02-11 04:25:24 字数 630 浏览 3 评论 0原文

我想在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2025-02-18 04:25:24

您可以使用API​​网关公开HTTP API。 API网关可用于触发lambda功能,然后使用lambda函数您可以执行所需的任务。您也可以尝试直接与AWS服务集成,而不是使用Lambda功能。

要遵循的简单步骤是

  1. 创建IAM角色,该角色可允许对您的API网关
  2. 访问API网关并配置
  3. 使用所需的集成

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

  1. Create an IAM role that gives respective access to your API gateway
  2. Create an API Gateway and configure it
  3. Use required integration

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文