<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LINE Bot &#8211; 科技島-掌握科技新聞、科技職場最新資訊</title>
	<atom:link href="https://www.technice.com.tw/tag/line-bot/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.technice.com.tw</link>
	<description>專注於科技新聞、科技職場、科技知識相關資訊，包含生成式AI、人工智慧、Web 3.0、區塊鏈、科技職缺百科、生物科技、軟體發展、雲端技術等豐富內容，適合熱衷科技及從事科技專業人事第一手資訊的平台。</description>
	<lastBuildDate>Mon, 09 Sep 2024 06:06:36 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>

<image>
	<url>https://www.technice.com.tw/wp-content/uploads/2022/12/cropped-wordpress_512x512-150x150.png</url>
	<title>LINE Bot &#8211; 科技島-掌握科技新聞、科技職場最新資訊</title>
	<link>https://www.technice.com.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【學長姐帶路】使用 AWS Lambda快速串接LINE Bot: Webhook</title>
		<link>https://www.technice.com.tw/work-place/mentor/139991/</link>
					<comments>https://www.technice.com.tw/work-place/mentor/139991/#respond</comments>
		
		<dc:creator><![CDATA[周星馳]]></dc:creator>
		<pubDate>Mon, 09 Sep 2024 06:06:33 +0000</pubDate>
				<category><![CDATA[學長姊帶路]]></category>
		<category><![CDATA[投書徵稿]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[LINE Bot]]></category>
		<category><![CDATA[學長姐帶路]]></category>
		<category><![CDATA[工作甘苦談]]></category>
		<category><![CDATA[面試問題]]></category>
		<guid isPermaLink="false">https://www.technice.com.tw/?p=139991</guid>

					<description><![CDATA[<p>目前很多服務都有提供API Webhook的功能，當事件發生時，就可以把事件的資訊送到我們指定的目的地 。<content><!-- wp:paragraph --></p>
<p>原標《AWS的雲端架構框架-資安篇》</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --></p>
<p>文/Cancerpio</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --></p>
<p>目前很多服務都有提供API Webhook的功能，當事件發生時，就可以把事件的資訊送到我們指定的目的地 。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:image {"id":139999,"sizeSlug":"large","linkDestination":"none"} --></p>
<figure class="wp-block-image size-large"><img src="https://www.technice.com.tw/wp-content/uploads/2024/09/digital-illustration-city-with-clouds-city-background_1044943-27341-1024x574.jpg" alt="【學長姐帶路】使用 AWS Lambda快速串接LINE Bot: Webhook" class="wp-image-139999"/><figcaption class="wp-element-caption">使用 AWS Lambda快速串接LINE Bot: Webhook</figcaption></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:paragraph --></p>
<p>例如:我們可指定Git在commit時，通知CICD工具做自動測試 / 部署，以及LineBot在收到聊天訊息時，把訊息內容送到我們指定的API Endpoint (也就是API的網址)，做進一步的程式處理。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --></p>
<p>而當測試這些Webhook功能，或者拿來開發最小功能產品(MVP)時，雲端Serverless服務是一個方便快速的方式 ，例如AWS Lambda。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>AWS Lambda</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:paragraph --></p>
<p>需注意的是，剛開始接觸AWS服務架構時，點進去的架構圖有一個”Add Trigger”的選項，容易讓人誤以為API Gateway和Lambda這兩個服務是綁在一起的:</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:image --></p>
<figure class="wp-block-image"><img src="https://miro.medium.com/v2/resize:fit:700/1*VYvZAIXyds4RTCJfQx_cpQ.png" alt=""/></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>Function URL</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:paragraph --></p>
<p>但其實Lambda自身就有提供Function URL的功能， 不必加上API Gateway這個trigger，也能供外部以API Calling的方式，來把需要的資訊讓Lambda Function接收到。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>API Gateway的限制</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:paragraph --></p>
<p>相較於Function URL API Gateway在被外界存取時，一定要透過IAM(AWS的身份驗證)，較不利於專案初期的測試，例如只是想簡單的測試Linbot發出的Webhooke Event</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --></p>
<p>要讓Lambda function用非IAM驗證 / 無驗證的方式開放給外界使用時，可以設定Function URL來快速的測試Webhook。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>設定Lambda Function</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:list --></p>
<ul><!-- wp:list-item --></p>
<li>點擊Configuration 分頁, 在左側欄的Function URL設定</li>
<p><!-- /wp:list-item --></ul>
<p><!-- /wp:list --></p>
<p><!-- wp:image --></p>
<figure class="wp-block-image"><img src="https://miro.medium.com/v2/resize:fit:700/0*pJ5vIQgUIzQ-RpcX" alt=""/></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>測試</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:paragraph --></p>
<p>在Line developer platform 點擊Verify去驗證API</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:image --></p>
<figure class="wp-block-image"><img src="https://miro.medium.com/v2/resize:fit:700/0*SEL-1jrLvci-qTqF" alt=""/></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>使用API Gateway Endpoint測試Linebot webhook</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:paragraph --></p>
<p>會出現403 Forbidden</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:image --></p>
<figure class="wp-block-image"><img src="https://miro.medium.com/v2/resize:fit:700/0*LXEGQK7Qmi34o0i-" alt=""/></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:heading --></p>
<h2 class="wp-block-heading"><strong>使用Lambda Function</strong></h2>
<p><!-- /wp:heading --></p>
<p><!-- wp:image --></p>
<figure class="wp-block-image"><img src="https://miro.medium.com/v2/resize:fit:700/0*cQ_m44NBYGBR20WQ" alt=""/></figure>
<p><!-- /wp:image --></p>
<p><!-- wp:paragraph --></p>
<p>如上圖，使用Lambda Function產生的URL就可以成功被Verify了。</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --></p>
<p>※本文由&nbsp;<a href="https://cancerpio.medium.com/" rel="noreferrer noopener" target="_blank">Cancerpio</a>&nbsp;授權勿任意轉載，原文<a href="https://cancerpio.medium.com/%E4%BD%BF%E7%94%A8-aws-lambda-function-url%E4%BE%86%E5%BF%AB%E9%80%9F%E6%B8%AC%E8%A9%A6webhook-58c6288455ce" rel="noreferrer noopener" target="_blank">《[AWS]使用 AWS Lambda快速串接LINE Bot: Webhook》</a></p>
<p><!-- /wp:paragraph --></content></p>
<p>這篇文章 <a rel="nofollow" href="https://www.technice.com.tw/work-place/mentor/139991/">【學長姐帶路】使用 AWS Lambda快速串接LINE Bot: Webhook</a> 最早出現於 <a rel="nofollow" href="https://www.technice.com.tw">科技島-掌握科技新聞、科技職場最新資訊</a>。</p>
]]></description>
		
					<wfw:commentRss>https://www.technice.com.tw/work-place/mentor/139991/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
