SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
AWS Step Functions 実践
AWS Premeir Night #3
クラスメソッド株式会社
菊池 修治
• 菊池 修治(きくち しゅうじ)
– クラスメソッド AWS事業
– Solutions Architect
– AWS Certified in All 5!
– SIer à 製造業 à クラスメソッド
– 好きなAWSサービス
• VPC、S3、Step Functions
⾃⼰紹介
Agenda
• AWS Step Functions とは
• Amazon State Language
• Step Functions の実⾏
– State Machine の実⾏⽅法
– Activity Task の実⾏
Agenda
• AWS Step Functions とは
• Amazon State Language
• Step Functions の実⾏
– State Machine の実⾏⽅法
– Activity Task の実⾏
AWS Step Functions
re:Invent 2016 にて発表!
AWS Step Functions
• 「Step Functionsやってみた」ブログ公開中
– http://dev.classmethod.jp/referencecat/aws-step-functions/
AWS Step Functions
• 分散されたアプリケーションをビジュアルに
コーディネート
– Lambdaなどの複数アプリケーションを⼀連の
ワークフローとして定義・実⾏
– 処理の流れ・ステップをビジュアル化
AWS Step Functions
AWS Step Functions
• ユースケース
– シーケンシャルなアプリケーションの実⾏
– タスクの並列化
– 処理の条件分岐
– エラーハンドリング
– ⻑時間の実⾏
AWS Step Functions
• 利点
– アプリケーション間を疎結合に
– 汎⽤性・再利⽤性の向上
– 実⾏結果の管理
AWS Step Functions
• コンポーネント
– State Machine:定義された⼀連のフロー
– State Language:State Machineを定義する⾔語
Agenda
• AWS Step Functions とは
• Amazon State Language
• Step Functions の実⾏
– State Machine の実⾏⽅法
– Activity Task の実⾏
Amazon State Language
• JSONで記述
{
"Comment": "A Retry example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME",
"Retry": [
{
"ErrorEquals": ["HandledError"],
"IntervalSeconds": 1,
"MaxAttempts": 2,
"BackoffRate": 2.0
},
{
"ErrorEquals": ["States.TaskFailed"],
"IntervalSeconds": 30,
"MaxAttempts": 2,
"BackoffRate": 2.0
},
{
"ErrorEquals": ["States.ALL"],
"IntervalSeconds": 5,
"MaxAttempts": 5,
"BackoffRate": 2.0
}
],
"End": true
}
}
}
Amazon State Language
• State (= Step)をつなげてフロー(State Machine)
を作成
• ⼀度作成したState Machineは変更・修正できない
Amazon State Language
• 7つの State
– Task :アプリケーションの実⾏
– Choice :分岐条件
– Parallel :Taskの並列実⾏
– Wait :待ち
– Fail :異常終了
– Succeed :正常終了
– Pass :なにもしない
Amazon State Language
• 7つの State
– Task :アプリケーションの実⾏
– Choice :分岐条件
– Parallel :Taskの並列実⾏
– Wait :待ち
– Fail :異常終了
– Succeed :正常終了
– Pass :なにもしない
Amazon State Language
• Task
"TaskState": {
"Comment": "Task State example",
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio
"Next": "NextState",
"TimeoutSeconds": 300,
"Retry": [
{
"ErrorEquals": [ "ErrorA", "ErrorB" ],
"IntervalSeconds": 1,
"BackoffRate": 2,
"MaxAttempts": 2
}
]
}
Amazon State Language
• Task
"TaskState": {
"Comment": "Task State example",
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio
"Next": "NextState",
"TimeoutSeconds": 300,
"Retry": [
{
"ErrorEquals": [ "ErrorA", "ErrorB" ],
"IntervalSeconds": 1,
"BackoffRate": 2,
"MaxAttempts": 2
}
]
}
Amazon State Language
• Task
"TaskState": {
"Comment": "Task State example",
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio
"Next": "NextState",
"TimeoutSeconds": 300,
"Retry": [
{
"ErrorEquals": [ "ErrorA", "ErrorB" ],
"IntervalSeconds": 1,
"BackoffRate": 2,
"MaxAttempts": 2
}
]
}
Amazon State Language
• Task
"TaskState": {
"Comment": "Task State example",
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio
"Next": "NextState",
"TimeoutSeconds": 300,
"Retry": [
{
"ErrorEquals": [ "ErrorA", "ErrorB" ],
"IntervalSeconds": 1,
"BackoffRate": 2,
"MaxAttempts": 2
}
]
}
Amazon State Language
• Choice
"ChoiceState": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$.foo",
"NumericEquals": 1,
"Next": "FirstMatchState"
},
{
"Variable": "$.foo",
"NumericEquals": 2,
"Next": "SecondMatchState”
}
],
"Default": "DefaultState"
},
• StringEquals
• StringLessThan
• StringGreaterThan
• StringLessThanEquals
• StringGreaterThanEquals
• NumericEquals
• NumericLessThan
• NumericGreaterThan
• NumericLessThanEquals
• NumericGreaterThanEquals
• BooleanEquals
• TimestampEquals
• TimestampLessThan
• TimestampGreaterThan
• TimestampLessThanEquals
• TimestampGreaterThanEquals
Amazon State Language
• Choice "ChoiceStateX": {
"Type" : "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private”
},
"Next": "Public”
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20
},
{
"Variable": "$.value",
"NumericLessThan": 30
}
],
"Next": "ValueInTwenties”
}
],
"Default": "DefaultState”
},
• Not
• Or
• And
Amazon State Language
• Choice "ChoiceStateX": {
"Type" : "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private”
},
"Next": "Public”
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20
},
{
"Variable": "$.value",
"NumericLessThan": 30
}
],
"Next": "ValueInTwenties”
}
],
"Default": "DefaultState”
},
• Not
• Or
• And
Amazon State Language
• Choice "ChoiceStateX": {
"Type" : "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private”
},
"Next": "Public”
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20
},
{
"Variable": "$.value",
"NumericLessThan": 30
}
],
"Next": "ValueInTwenties”
}
],
"Default": "DefaultState”
},
• Not
• Or
• And
Amazon State Language
• Parallel
– 全ての分岐が完了
してから次のState
へ進む
"Parallel": {
"Type": "Parallel",
"Next": "Final State",
"Branches": [
{
"StartAt": "Wait 20s",
"States": {
"Wait 20s": {
"Type": "Wait",
"Seconds": 20,
"End": true
}
}
},
{
"StartAt": "Wait 10s",
"States": {
"Wait 10s": {
"Type": "Wait",
"Seconds": 10,
"End": true
}
}
}
]
},
Amazon State Language
• Wait
– Seconds
– SecondsPath
– Timestamp
– TimestampPath
"wait_ten_seconds" : {
"Type" : "Wait",
"Seconds" : 10,
"Next": "NextState”
}
"wait_until" : {
"Type": "Wait",
"Timestamp": "2016-03-14T01:59:00Z",
"Next": "NextState”
}
"wait_until" : {
"Type": "Wait",
"TimestampPath": "$.expirydate",
"Next": "NextState”
}
Agenda
• AWS Step Functions とは
• Amazon State Language
• Step Functions の実⾏
– State Machine の実⾏⽅法
– Activity Task の実⾏
State Machine の実⾏
• start-execution API
Step Functions
State Machine
start-execution
State Machine の実⾏
• start-execution API
Lambda Step Functions
State Machine
start-execution
State Machine の実⾏
• start-execution API
API
Gateway
S3
SNS
Cloud Watch
Event
Lambda Step Functions
State Machine
start-execution
State Machine の実⾏
• 実⾏結果
– State Machine ごとに管理
State Machine の実⾏
• 実⾏結果
– State Machine の実⾏毎に管理
State Machine の実⾏
• 実⾏結果
– State 毎に管理
Agenda
• AWS Step Functions とは
• Amazon State Language
• Step Functions の実⾏
– State Machine の実⾏⽅法
– Activity Task の実⾏
Activity Taskの実⾏
• Lambda以外のアプリケーションの実⾏
–EC2
–オンプレミス
• Pull型の実⾏
– アプリケーションからポーリング
– LambdaはPush型
Activity Taskの実⾏
• Activityの作成
Activity Taskの実⾏
• Activityの作成
設定項⽬は名前だけ
ARNが作成される
Activity Taskの実⾏
• State Machineの作成
{
"Comment": "An example using a Task state.",
"StartAt": "getGreeting",
"Version": "1.0",
"TimeoutSeconds": 300,
"States":
{
"getGreeting": {
"Type": "Task",
"Resource": "arn:aws:states:eu_central-1:123456789012:activity:get-greeting",
"End": true
}
}
}
Activity Taskの実⾏
• アプリケーションからポーリング
– Get-Activity-Task API
Polling
Get-Activity-Task
--Activity ARN
--Worker Name (Option)
Worker
State Machine
Activity Taskの実⾏
• State Machine実⾏
Input
TaskToken
In progress
Get-Activity-Task
--Activity ARN
--Worker Name (Option)
Worker
State Machine
Activity Taskの実⾏
• 実⾏完了
Success
Send-Task-Success
--Task-Token
--Output
Worker
State Machine
Activity Taskの実⾏
• 分散アプリケーション
Workers
State Machines
まとめ
• Step Functionsを使うことで分散アプリケーション
による複雑な処理を簡単に定義・実⾏・管理
• マイクロサービス化、サーバレス化
• Lambdaだけでなくサーバ上のアプリケーションも
組み込み可能
classmethod.jp44

Más contenido relacionado

La actualidad más candente

Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
Amazon Web Services
 

La actualidad más candente (20)

ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container DayECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
 
AWS CloudFormation Best Practices
AWS CloudFormation Best PracticesAWS CloudFormation Best Practices
AWS CloudFormation Best Practices
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
 
SRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS BatchSRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS Batch
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
Secured API Acceleration with Engineers from Amazon CloudFront and Slack
Secured API Acceleration with Engineers from Amazon CloudFront and SlackSecured API Acceleration with Engineers from Amazon CloudFront and Slack
Secured API Acceleration with Engineers from Amazon CloudFront and Slack
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step Functions
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
 
Introduction to AWS Batch
Introduction to AWS BatchIntroduction to AWS Batch
Introduction to AWS Batch
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
Continuous Deployment Practices, with Production, Test and Development Enviro...
Continuous Deployment Practices, with Production, Test and Development Enviro...Continuous Deployment Practices, with Production, Test and Development Enviro...
Continuous Deployment Practices, with Production, Test and Development Enviro...
 
Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)
 
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
 
Amazon Batch: 實現簡單且有效率的批次運算
Amazon Batch: 實現簡單且有效率的批次運算Amazon Batch: 實現簡單且有效率的批次運算
Amazon Batch: 實現簡單且有效率的批次運算
 
AWS re:Invent 2016 recap (part 1)
AWS re:Invent 2016 recap (part 1)AWS re:Invent 2016 recap (part 1)
AWS re:Invent 2016 recap (part 1)
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormation
 
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWSDevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
DevOps on AWS: Advanced Techniques for Amazon EC2 Deployments on AWS
 

Similar a AWS Step Functions 実践

Similar a AWS Step Functions 実践 (20)

Serverless Apps with AWS Step Functions
Serverless Apps with AWS Step FunctionsServerless Apps with AWS Step Functions
Serverless Apps with AWS Step Functions
 
Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Introduction to AWS Step Functions:
Introduction to AWS Step Functions:
 
Announcing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar SeriesAnnouncing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar Series
 
Building Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step FunctionsBuilding Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step Functions
 
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
 
AWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdfAWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdf
 
NEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step FunctionsNEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step Functions
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless Applications
 
Serverless Orchestration with AWS Step Functions - May 2017 AWS Online Tech T...
Serverless Orchestration with AWS Step Functions - May 2017 AWS Online Tech T...Serverless Orchestration with AWS Step Functions - May 2017 AWS Online Tech T...
Serverless Orchestration with AWS Step Functions - May 2017 AWS Online Tech T...
 
NEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step FunctionsNEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step Functions
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step Functions
 
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
Serverless Orchestration of AWS Step Functions - July 2017 AWS Online Tech Talks
Serverless Orchestration of AWS Step Functions - July 2017 AWS Online Tech TalksServerless Orchestration of AWS Step Functions - July 2017 AWS Online Tech Talks
Serverless Orchestration of AWS Step Functions - July 2017 AWS Online Tech Talks
 
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Decompose the monolith into AWS Step Functions
Decompose the monolith into AWS Step FunctionsDecompose the monolith into AWS Step Functions
Decompose the monolith into AWS Step Functions
 

Más de Shuji Kikuchi

Más de Shuji Kikuchi (20)

re:Growth 2021 コンピュートサービスの進化を語る
re:Growth 2021 コンピュートサービスの進化を語るre:Growth 2021 コンピュートサービスの進化を語る
re:Growth 2021 コンピュートサービスの進化を語る
 
re:Grouth 2020 : AWS Infrastrucuter Serviceの進化 2020
re:Grouth 2020 : AWS Infrastrucuter Serviceの進化 2020re:Grouth 2020 : AWS Infrastrucuter Serviceの進化 2020
re:Grouth 2020 : AWS Infrastrucuter Serviceの進化 2020
 
JAWS-UG 横浜 re:Invent re:Cap week1 EC2ストレージパフォーマンスの進化
JAWS-UG 横浜 re:Invent re:Cap week1 EC2ストレージパフォーマンスの進化JAWS-UG 横浜 re:Invent re:Cap week1 EC2ストレージパフォーマンスの進化
JAWS-UG 横浜 re:Invent re:Cap week1 EC2ストレージパフォーマンスの進化
 
AWS Outpostsセミナー オンプレミスネットワークとの接続
AWS Outpostsセミナー オンプレミスネットワークとの接続AWS Outpostsセミナー オンプレミスネットワークとの接続
AWS Outpostsセミナー オンプレミスネットワークとの接続
 
NW-JAWS x Tech-on勉強会:AWS Transit Gateway で広がる ネットワークアーキテクチャ
NW-JAWS x Tech-on勉強会:AWS Transit Gateway で広がるネットワークアーキテクチャNW-JAWS x Tech-on勉強会:AWS Transit Gateway で広がるネットワークアーキテクチャ
NW-JAWS x Tech-on勉強会:AWS Transit Gateway で広がる ネットワークアーキテクチャ
 
[JAWS-UG 横浜] AWS re:Invent 2019 Network関連アップデート 5本立て
[JAWS-UG 横浜] AWS re:Invent 2019Network関連アップデート5本立て[JAWS-UG 横浜] AWS re:Invent 2019Network関連アップデート5本立て
[JAWS-UG 横浜] AWS re:Invent 2019 Network関連アップデート 5本立て
 
Developers.IO 2019 Tokyo re:inventの歩き方
Developers.IO 2019 Tokyo re:inventの歩き方Developers.IO 2019 Tokyo re:inventの歩き方
Developers.IO 2019 Tokyo re:inventの歩き方
 
Developers.IO 2019 ハイブリッド/マルチVPC環境を構成するためのAWSネットワーク完全理解
Developers.IO 2019 ハイブリッド/マルチVPC環境を構成するためのAWSネットワーク完全理解Developers.IO 2019 ハイブリッド/マルチVPC環境を構成するためのAWSネットワーク完全理解
Developers.IO 2019 ハイブリッド/マルチVPC環境を構成するためのAWSネットワーク完全理解
 
[JAWS-UG Tokyo 32] AWS Client VPNの特徴
[JAWS-UG Tokyo 32] AWS Client VPNの特徴[JAWS-UG Tokyo 32] AWS Client VPNの特徴
[JAWS-UG Tokyo 32] AWS Client VPNの特徴
 
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
[JAWS DAYS 2019] Amazon DocumentDB(with MongoDB Compatibility)入門
 
re:Growth 2018 Tokyo:Amazon Global Networkが提供する新サービス
re:Growth 2018 Tokyo:Amazon Global Networkが提供する新サービスre:Growth 2018 Tokyo:Amazon Global Networkが提供する新サービス
re:Growth 2018 Tokyo:Amazon Global Networkが提供する新サービス
 
Developers.IO 2018 Tokyo AWSベストプラクティス
Developers.IO 2018 Tokyo AWSベストプラクティスDevelopers.IO 2018 Tokyo AWSベストプラクティス
Developers.IO 2018 Tokyo AWSベストプラクティス
 
AKIBA.AWS #10 NLBを取り巻く環境のUPDATE
AKIBA.AWS #10 NLBを取り巻く環境のUPDATEAKIBA.AWS #10 NLBを取り巻く環境のUPDATE
AKIBA.AWS #10 NLBを取り巻く環境のUPDATE
 
[AKIBA.AWS] NLBとPrivateLinkの仕様に立ち向かう
[AKIBA.AWS] NLBとPrivateLinkの仕様に立ち向かう[AKIBA.AWS] NLBとPrivateLinkの仕様に立ち向かう
[AKIBA.AWS] NLBとPrivateLinkの仕様に立ち向かう
 
[AKIBA.AWS] VGWのルーティング仕様
[AKIBA.AWS] VGWのルーティング仕様[AKIBA.AWS] VGWのルーティング仕様
[AKIBA.AWS] VGWのルーティング仕様
 
[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎
 
[AKIBA.AWS] VPCをネットワーク図で理解してみる
[AKIBA.AWS] VPCをネットワーク図で理解してみる[AKIBA.AWS] VPCをネットワーク図で理解してみる
[AKIBA.AWS] VPCをネットワーク図で理解してみる
 
[HIGOBASHI.AWS] AWS ネットワーク小ネタ祭り
[HIGOBASHI.AWS] AWS ネットワーク小ネタ祭り[HIGOBASHI.AWS] AWS ネットワーク小ネタ祭り
[HIGOBASHI.AWS] AWS ネットワーク小ネタ祭り
 
[AKIBA.AWS] AWS Elemental MediaConvertから学ぶコーデック入門
[AKIBA.AWS] AWS Elemental MediaConvertから学ぶコーデック入門[AKIBA.AWS] AWS Elemental MediaConvertから学ぶコーデック入門
[AKIBA.AWS] AWS Elemental MediaConvertから学ぶコーデック入門
 
[AKIBA.AWS] re:invent 2017アップデート:ついてこられるか?AWSネットワークの進化
[AKIBA.AWS] re:invent 2017アップデート:ついてこられるか?AWSネットワークの進化[AKIBA.AWS] re:invent 2017アップデート:ついてこられるか?AWSネットワークの進化
[AKIBA.AWS] re:invent 2017アップデート:ついてこられるか?AWSネットワークの進化
 

Último

Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
anilsa9823
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 

Último (20)

Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 

AWS Step Functions 実践

  • 1. AWS Step Functions 実践 AWS Premeir Night #3 クラスメソッド株式会社 菊池 修治
  • 2. • 菊池 修治(きくち しゅうじ) – クラスメソッド AWS事業 – Solutions Architect – AWS Certified in All 5! – SIer à 製造業 à クラスメソッド – 好きなAWSサービス • VPC、S3、Step Functions ⾃⼰紹介
  • 3. Agenda • AWS Step Functions とは • Amazon State Language • Step Functions の実⾏ – State Machine の実⾏⽅法 – Activity Task の実⾏
  • 4. Agenda • AWS Step Functions とは • Amazon State Language • Step Functions の実⾏ – State Machine の実⾏⽅法 – Activity Task の実⾏
  • 5. AWS Step Functions re:Invent 2016 にて発表!
  • 6. AWS Step Functions • 「Step Functionsやってみた」ブログ公開中 – http://dev.classmethod.jp/referencecat/aws-step-functions/
  • 7. AWS Step Functions • 分散されたアプリケーションをビジュアルに コーディネート – Lambdaなどの複数アプリケーションを⼀連の ワークフローとして定義・実⾏ – 処理の流れ・ステップをビジュアル化
  • 9. AWS Step Functions • ユースケース – シーケンシャルなアプリケーションの実⾏ – タスクの並列化 – 処理の条件分岐 – エラーハンドリング – ⻑時間の実⾏
  • 10. AWS Step Functions • 利点 – アプリケーション間を疎結合に – 汎⽤性・再利⽤性の向上 – 実⾏結果の管理
  • 11. AWS Step Functions • コンポーネント – State Machine:定義された⼀連のフロー – State Language:State Machineを定義する⾔語
  • 12. Agenda • AWS Step Functions とは • Amazon State Language • Step Functions の実⾏ – State Machine の実⾏⽅法 – Activity Task の実⾏
  • 13. Amazon State Language • JSONで記述 { "Comment": "A Retry example of the Amazon States Language using an AWS Lambda Function", "StartAt": "HelloWorld", "States": { "HelloWorld": { "Type": "Task", "Resource": "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME", "Retry": [ { "ErrorEquals": ["HandledError"], "IntervalSeconds": 1, "MaxAttempts": 2, "BackoffRate": 2.0 }, { "ErrorEquals": ["States.TaskFailed"], "IntervalSeconds": 30, "MaxAttempts": 2, "BackoffRate": 2.0 }, { "ErrorEquals": ["States.ALL"], "IntervalSeconds": 5, "MaxAttempts": 5, "BackoffRate": 2.0 } ], "End": true } } }
  • 14. Amazon State Language • State (= Step)をつなげてフロー(State Machine) を作成 • ⼀度作成したState Machineは変更・修正できない
  • 15. Amazon State Language • 7つの State – Task :アプリケーションの実⾏ – Choice :分岐条件 – Parallel :Taskの並列実⾏ – Wait :待ち – Fail :異常終了 – Succeed :正常終了 – Pass :なにもしない
  • 16. Amazon State Language • 7つの State – Task :アプリケーションの実⾏ – Choice :分岐条件 – Parallel :Taskの並列実⾏ – Wait :待ち – Fail :異常終了 – Succeed :正常終了 – Pass :なにもしない
  • 17. Amazon State Language • Task "TaskState": { "Comment": "Task State example", "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio "Next": "NextState", "TimeoutSeconds": 300, "Retry": [ { "ErrorEquals": [ "ErrorA", "ErrorB" ], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 2 } ] }
  • 18. Amazon State Language • Task "TaskState": { "Comment": "Task State example", "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio "Next": "NextState", "TimeoutSeconds": 300, "Retry": [ { "ErrorEquals": [ "ErrorA", "ErrorB" ], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 2 } ] }
  • 19. Amazon State Language • Task "TaskState": { "Comment": "Task State example", "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio "Next": "NextState", "TimeoutSeconds": 300, "Retry": [ { "ErrorEquals": [ "ErrorA", "ErrorB" ], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 2 } ] }
  • 20. Amazon State Language • Task "TaskState": { "Comment": "Task State example", "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunctio "Next": "NextState", "TimeoutSeconds": 300, "Retry": [ { "ErrorEquals": [ "ErrorA", "ErrorB" ], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 2 } ] }
  • 21. Amazon State Language • Choice "ChoiceState": { "Type" : "Choice", "Choices": [ { "Variable": "$.foo", "NumericEquals": 1, "Next": "FirstMatchState" }, { "Variable": "$.foo", "NumericEquals": 2, "Next": "SecondMatchState” } ], "Default": "DefaultState" }, • StringEquals • StringLessThan • StringGreaterThan • StringLessThanEquals • StringGreaterThanEquals • NumericEquals • NumericLessThan • NumericGreaterThan • NumericLessThanEquals • NumericGreaterThanEquals • BooleanEquals • TimestampEquals • TimestampLessThan • TimestampGreaterThan • TimestampLessThanEquals • TimestampGreaterThanEquals
  • 22. Amazon State Language • Choice "ChoiceStateX": { "Type" : "Choice", "Choices": [ { "Not": { "Variable": "$.type", "StringEquals": "Private” }, "Next": "Public” }, { "And": [ { "Variable": "$.value", "NumericGreaterThanEquals": 20 }, { "Variable": "$.value", "NumericLessThan": 30 } ], "Next": "ValueInTwenties” } ], "Default": "DefaultState” }, • Not • Or • And
  • 23. Amazon State Language • Choice "ChoiceStateX": { "Type" : "Choice", "Choices": [ { "Not": { "Variable": "$.type", "StringEquals": "Private” }, "Next": "Public” }, { "And": [ { "Variable": "$.value", "NumericGreaterThanEquals": 20 }, { "Variable": "$.value", "NumericLessThan": 30 } ], "Next": "ValueInTwenties” } ], "Default": "DefaultState” }, • Not • Or • And
  • 24. Amazon State Language • Choice "ChoiceStateX": { "Type" : "Choice", "Choices": [ { "Not": { "Variable": "$.type", "StringEquals": "Private” }, "Next": "Public” }, { "And": [ { "Variable": "$.value", "NumericGreaterThanEquals": 20 }, { "Variable": "$.value", "NumericLessThan": 30 } ], "Next": "ValueInTwenties” } ], "Default": "DefaultState” }, • Not • Or • And
  • 25. Amazon State Language • Parallel – 全ての分岐が完了 してから次のState へ進む "Parallel": { "Type": "Parallel", "Next": "Final State", "Branches": [ { "StartAt": "Wait 20s", "States": { "Wait 20s": { "Type": "Wait", "Seconds": 20, "End": true } } }, { "StartAt": "Wait 10s", "States": { "Wait 10s": { "Type": "Wait", "Seconds": 10, "End": true } } } ] },
  • 26. Amazon State Language • Wait – Seconds – SecondsPath – Timestamp – TimestampPath "wait_ten_seconds" : { "Type" : "Wait", "Seconds" : 10, "Next": "NextState” } "wait_until" : { "Type": "Wait", "Timestamp": "2016-03-14T01:59:00Z", "Next": "NextState” } "wait_until" : { "Type": "Wait", "TimestampPath": "$.expirydate", "Next": "NextState” }
  • 27. Agenda • AWS Step Functions とは • Amazon State Language • Step Functions の実⾏ – State Machine の実⾏⽅法 – Activity Task の実⾏
  • 28. State Machine の実⾏ • start-execution API Step Functions State Machine start-execution
  • 29. State Machine の実⾏ • start-execution API Lambda Step Functions State Machine start-execution
  • 30. State Machine の実⾏ • start-execution API API Gateway S3 SNS Cloud Watch Event Lambda Step Functions State Machine start-execution
  • 31. State Machine の実⾏ • 実⾏結果 – State Machine ごとに管理
  • 32. State Machine の実⾏ • 実⾏結果 – State Machine の実⾏毎に管理
  • 33. State Machine の実⾏ • 実⾏結果 – State 毎に管理
  • 34. Agenda • AWS Step Functions とは • Amazon State Language • Step Functions の実⾏ – State Machine の実⾏⽅法 – Activity Task の実⾏
  • 35. Activity Taskの実⾏ • Lambda以外のアプリケーションの実⾏ –EC2 –オンプレミス • Pull型の実⾏ – アプリケーションからポーリング – LambdaはPush型
  • 38. Activity Taskの実⾏ • State Machineの作成 { "Comment": "An example using a Task state.", "StartAt": "getGreeting", "Version": "1.0", "TimeoutSeconds": 300, "States": { "getGreeting": { "Type": "Task", "Resource": "arn:aws:states:eu_central-1:123456789012:activity:get-greeting", "End": true } } }
  • 39. Activity Taskの実⾏ • アプリケーションからポーリング – Get-Activity-Task API Polling Get-Activity-Task --Activity ARN --Worker Name (Option) Worker State Machine
  • 40. Activity Taskの実⾏ • State Machine実⾏ Input TaskToken In progress Get-Activity-Task --Activity ARN --Worker Name (Option) Worker State Machine
  • 43. まとめ • Step Functionsを使うことで分散アプリケーション による複雑な処理を簡単に定義・実⾏・管理 • マイクロサービス化、サーバレス化 • Lambdaだけでなくサーバ上のアプリケーションも 組み込み可能