Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS Step Functionsの新機能「Call third-party API」を試してみた
Search
KMiura
December 20, 2023
Technology
1
140
AWS Step Functionsの新機能「Call third-party API」を試してみた
2023.12.20 color is【クラウドLT大会vol.6】大型アップデート祭り
https://saison-coloris.connpass.com/event/303486/
KMiura
December 20, 2023
Tweet
Share
More Decks by KMiura
See All by KMiura
AWS×IoTについて語り合う会
miura55
0
60
クラウドを活用して家電をハックしてみた
miura55
0
55
Amplify Gen2でLambda構築してみた
miura55
0
72
Amplify Gen2でLambda構築してみた
miura55
1
500
Amplify Gen2がGAされたので試してみた
miura55
0
81
VS CodeとVimが好きなエンジニアが考えた最強のエディタ
miura55
0
180
オープンソースのロボットソフトウェア「ROS」で地図作成を試してみた
miura55
0
280
Cloudflare WorkersがPythonに対応したので試してみた
miura55
0
400
個人のAWSアカウントをマルチ運用してみた
miura55
2
360
Other Decks in Technology
See All in Technology
MySQLのロックの種類とその競合
yoku0825
6
1.6k
AIエージェントを現場に導入する目線とは
masahiro_nishimi
1
1.5k
データ分析基盤を作ってみよう~設計編~
nrinetcom
PRO
1
110
初中級者用如何使用backlog -VALE TUDOEDITION-
in0u
0
140
AOAI Dev Day LLMシステム開発 Tips集
hirosatogamo
15
3.8k
CEL(Common Expression Language)で書いた条件にマッチしたIAM Policyを見つける / iam-policy-finder
fujiwara3
0
710
AOAI Dev Day - Opening Session
yoshidashingo
2
470
スタートアップにおける組織設計とスクラムの長期戦略 / Scrum Fest Kanazawa 2024
yoshikiiida
13
3.6k
LLMアプリケーションの評価の実践と課題 ~PharmaXにおける今後の展望~
pharma_x_tech
2
170
20240717_イケコパ代表Copilot_in_Teams会社でこう使ってます
ponponmikankan
2
430
20240724_cm_odyssey_hibiyatech
hiashisan
0
110
フルリモートワークはエンジニアの夢を叶えたか? #cm_odyssey
mamohacy
2
600
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
64
5.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
YesSQL, Process and Tooling at Scale
rocio
166
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.3k
We Have a Design System, Now What?
morganepeng
46
7k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Building a Scalable Design System with Sketch
lauravandoore
458
32k
How GitHub Uses GitHub to Build GitHub
holman
471
290k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
What's new in Ruby 2.0
geeforr
338
31k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
How GitHub (no longer) Works
holman
305
140k
Transcript
AWS Step Functionsの新機能「Call third-party API」を試してみた KMiura(@k_miura_io)
自己紹介 • 三浦 耕生(こうき) • JAWS UG名古屋運営 • 三次元地図技術のスタートアップの エンジニア
@k_miura_io koki.miura05
AWS Step Functionsとは? • AWSのサービスを組み合わせて分散アプ リケーションを作ることができるサービス • GUIベースでAWSのサービス・API呼び出 すことができる •
並列処理やエラー処理も追加できる
Step Functionsの新機能 • Call third-party API • Bedrock API
Call third-party API それまでLambdaを使わないとできなかった外部API連携が Step Functionsだけで実現できる
試してみた
今回のシナリオ News APIで取得した国内のヘッドラインニュースを Slackに投稿&レスポンスをS3に保管するワークフロー
DEMO
SLACKの投稿
S3バケットの中身
ワークフロー Lambda一切使わず実装!
POINT • APIのリクエストにはEventBridgeを使って APIの認証情報を登録する必要がある • よくあるヘッダーにAPIトークンをいれるタ イプのAPIであれば認証タイプをAPIキー に設定してヘッダーに登録する情報を入 れればOK
外部API呼び 出すときに使 われている IAMポリシー • Call third-party APIのステップを追加したステートマ シンのIAMロールを生成するとそこで必要なAPIのエ ンドポイント、メソッドのアクセスを許可するための
IAMポリシーが追加される • 何も知らずにあとから別のAPIを追加して実行する とアクセスエラーが出るので要注意! • ステートマシンの設定画面からIAMロールを作り直せ ばOK
ステートマシンのテンプレ もある • StripeのAPIを使った請求書 作成ワークフローをStep Functionsで完結するテンプ レートがある • 割と複雑なビジネスロジック がローコードで構築されて
いるのでStep Functionsの ポテンシャルを感じる
まとめ • Step Functionsを使って外部APIと連携することができた • Lambdaを使わないサーバーレスなシステム開発の幅が広がる予感 • Step Functions側で作られているIAMロールでアクセス制限をかけているのでセ キュアな分、カスタムする際は要注意
超簡単なサンプル記事 https://bit.ly/3Rsoxxr
END