SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
A n g e l a W a n g
Solutions Architect, Amazon Web Services
SRV328
Designing and Implementing a Serverless
Media Processing Workflow Using AWS Step
Functions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Part one
Why AWS Step Functions?
Types of states
Workshop overview
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
λλ
λ DBMS
λ
λ
λ
λ
λ
λ λ
λ
λ
Queue
Modern
app
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Modern
app
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step Functions overview
“I want to sequence functions”
“I want to select functions based on data”
I want to run functions in parallel”
“I want to retry functions”
“I want to try/catch/finally”
“I want to run code for hours”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step Functions overview
Visualize in the
console
Define in JSON Monitor
executions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS::StepFunctions::StateMachine
{
"Comment": "A Hello World Example",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "${lambdaArn}",
"End": true
}
}}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Seven state types
Task A single unit of work
Choice Adds branching logic
Parallel Fork and join the data across tasks
Wait Delay for a specified time
Fail Stops an execution and marks it as a failure
Succeed Successfully stops an execution
Pass Passes its input to its output
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What you will build in this workshop
• Multi-step state machine that
leverages several SFN features:
• AWS Lambda task state
• Choice state
• Custom error catching
• Parallel state
• Input/output manipulations using
InputPath and ResultPaths
Task
Choice
Parallel
Fail
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hands-on: Part one (step 0–1C)
• Link to instructions: http://amzn.to/sfn-workshop
What part one will look like when finished:
What you’ll do:
• Run AWS CloudFormation script
• Deploy single-step state machine using
the console
• Test using the console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Part one review
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ExtractImageMetadata
ImageTypeCheck
TransformMetadata
Rekognition Thumbnail
StoreMetadata
Start
End
Synchronous task
Task: A single unit of work
Synchronous: Lambda
{
"ExtractImageMetadata": {
"Type": "Task",
"Resource": "arn:aws:lambda:mars-ter …”,
…
}
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ExtractImageMetadata
ImageTypeCheck
TransformMetadata
Rekognition Thumbnail
StoreMetadata
Start
End
Task: A single unit of work
Asynchronous: “Activity Task”, Polled by workers
{
"ExtractImageMetadata": {
"Type": ”Task",
"Resource": "arn:aws:states:mars-ter …”,
…
}
}
Asynchronous task
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Part two
Input/output processing
Branching
Custom error handling
Parallel state
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Input/Output processing
State [x]
Input
Output
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Input/Output processing
State [x]"InputPath" "ResultPath" "OutputPath"
Input
Output
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
InputPath example
{
”s3key”:”apple.png”,
”timestamp”:12324
}
Input
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
"InputPath”:“$”
Input
InputPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
State [x]"InputPath”:“$”
Input
Input received by state x:
{
”s3key”:”apple.png”,
”timestamp”:12324
}
InputPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
InputPath example
"InputPath”:“$.s3key”
{
”s3key”:”apple.png”,
”timestamp”:12324
}
State [x]"InputPath”:“$”
Input
Input received by state x:
{
”s3key”:”apple.png”,
”timestamp”:12324
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
InputPath example
State [y]"InputPath”:“$.s3key”
{
”s3key”:”apple.png”,
”timestamp”:12324
}
”apple.png”
State [x]"InputPath”:“$”
Input
Input received by state y:
Input received by state x:
{
”s3key”:”apple.png”,
”timestamp”:12324
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
Input
State [x]
State output:
{“type”: “png"}
"InputPath”
: “$.s3key”
“ResultPath”:“$”
ResultPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
Input
State [x]
State output:
{“type”: “png"}
"InputPath”
: “$.s3key”
“ResultPath”:“$”{ ”type”:”png}Output
ResultPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
Input
State [x]
State output:
{“type”: “png"}
"InputPath”
: “$.s3key”
“ResultPath”:“$”{ ”type”:”png}Output
”ResultPath”:“$.metadata”
ResultPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
”s3key”:”apple.png”,
”timestamp”:12324
}
Input
State [x]
State output:
{“type”: “png"}
"InputPath”
: “$.s3key”
“ResultPath”:“$”{ ”type”:”png}Output
”ResultPath”:“$.metadata”
{
”s3key”:”apple.png”,
”timestamp”:12324,
“metadata”: {
“type”: “png"}
}
Output
ResultPath example
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branching logic
“ExampleChoiceState": {
"Type": ”Choice",
”Choices": [{
”Variable": ”$.imageformat",
”StringEquals": ”JPG",
”Next": “ParalellProcessing”
}, …
],
”Default": ”NotSupported",
…
}
Choice state
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Custom error handling
“ExampleTaskState": {
"Type": "Task",
"Resource": “<Lambda Arn>",
"Next": "Graceful Exit",
"Retry": [
{
"ErrorEquals": [ “ErrorA" ,”ErrorB”],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 1.5
} ,
{
“ErrorEquals” : [ “ErrorC” ],
“Interval Seconds” : 5
],
"Catch": [
{
"ErrorEquals": [ "States.ALL" ],
"Next": "Clean Up" }
]
},
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“P": {
"Type": "Parallel",
"Branches": [
{
"StartAt": “P1",
"States": {
“P1": {
"Type": "Task",
"Resource": “<Lambda Arn>",
"End": true } }
},
{
"StartAt": “P2",
"States": {
“P2": {
"Type": "Task",
"Resource": “<Lambda Arn>",
"End": true } }
}
],
"Next": "NextState"
}
Parallel states
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands-on: Part two (step 1D–3)
• Link to instructions: http://amzn.to/sfn-workshop
What part two will look like when finished:
What you’ll do:
• Add ResultPath
• Add choice state
• Add custom error handling
• Add parallel state
• Test using the console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Part two review
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Part three
Other architecture patterns
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use activity task for manual approval
Step Functions
Poll:
taskToken
Amazon
SES
Poller
Approver
Send success:
taskToken
API
Gateway
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use Wait + Choice to wait for batch job/async APIs
while:
sleep (30)
if status=done:
break
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Integrate with other AWS services
• Create state machines and activities with AWS CloudFormation
• Call AWS Step Functions with Amazon API Gateway
• Start state machines in response to events, or on a schedule, with Amazon CloudWatch
Events
• Monitor state machine executions with Amazon CloudWatch
• Log API calls with AWS CloudTrail
• Start state machine using AWS Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hands-on: Part three (step 3–end)
• Link to instructions: http://amzn.to/sfn-workshop
What you’ll do:
• Add a final task state to persist the metadata
• Configure the trigger for the state machine
• Deploy a test web application and test
Optional bonus tasks: (if you finish early and you want to, keep going)
Add in additional error handling/retry logic
Add a manual approval task if inappropriate content is found
A state machine to clean up when images are deleted
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Q&A
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are you building? #stepfunctions
Serverless image recognition and processing backendEBS snapshot management
https://console.aws.amazon.com/states/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Please complete the session survey in the
summit mobile app.
Submit Session Feedback
1. Tap the Schedule icon. 2. Select the session
you attended.
3. Tap Session
Evaluation to submit your
feedback.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!

Mais conteúdo relacionado

Mais procurados

Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Amazon Web Services
 
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018Amazon Web Services
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWSAmazon Web Services
 
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...Amazon Web Services
 
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateDEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateAmazon Web Services
 
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018Amazon Web Services
 
SRV322 Increase the Value of Video with ML & Media Services
 SRV322 Increase the Value of Video with ML & Media Services SRV322 Increase the Value of Video with ML & Media Services
SRV322 Increase the Value of Video with ML & Media ServicesAmazon Web Services
 
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...Amazon Web Services
 
Building Real-time Serverless Backends with GraphQL
Building Real-time Serverless Backends with GraphQLBuilding Real-time Serverless Backends with GraphQL
Building Real-time Serverless Backends with GraphQLAmazon Web Services
 
SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study
 SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study
SRV316 Serverless Data Processing at Scale: An Amazon.com Case StudyAmazon Web Services
 
Amazon CI-CD Practices for Software Development Teams
Amazon CI-CD Practices for Software Development Teams Amazon CI-CD Practices for Software Development Teams
Amazon CI-CD Practices for Software Development Teams Amazon Web Services
 
ENT206 Product Development in the Cloud
ENT206 Product Development in the CloudENT206 Product Development in the Cloud
ENT206 Product Development in the CloudAmazon Web Services
 
ENT304 Enabling Self Service for Data Scientists with AWS Service Catalog
ENT304 Enabling Self Service for Data Scientists with AWS Service CatalogENT304 Enabling Self Service for Data Scientists with AWS Service Catalog
ENT304 Enabling Self Service for Data Scientists with AWS Service CatalogAmazon Web Services
 
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...Amazon Web Services
 
SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job
 SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job
SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right JobAmazon Web Services
 
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...Amazon Web Services
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDutyAmazon Web Services
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...Amazon Web Services
 
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Amazon Web Services
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Web Services
 

Mais procurados (20)

Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
 
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
 
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateDEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
 
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
 
SRV322 Increase the Value of Video with ML & Media Services
 SRV322 Increase the Value of Video with ML & Media Services SRV322 Increase the Value of Video with ML & Media Services
SRV322 Increase the Value of Video with ML & Media Services
 
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
AWS Security in Your Sleep: Build End-to-End Automation for IR Workflows (SEC...
 
Building Real-time Serverless Backends with GraphQL
Building Real-time Serverless Backends with GraphQLBuilding Real-time Serverless Backends with GraphQL
Building Real-time Serverless Backends with GraphQL
 
SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study
 SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study
SRV316 Serverless Data Processing at Scale: An Amazon.com Case Study
 
Amazon CI-CD Practices for Software Development Teams
Amazon CI-CD Practices for Software Development Teams Amazon CI-CD Practices for Software Development Teams
Amazon CI-CD Practices for Software Development Teams
 
ENT206 Product Development in the Cloud
ENT206 Product Development in the CloudENT206 Product Development in the Cloud
ENT206 Product Development in the Cloud
 
ENT304 Enabling Self Service for Data Scientists with AWS Service Catalog
ENT304 Enabling Self Service for Data Scientists with AWS Service CatalogENT304 Enabling Self Service for Data Scientists with AWS Service Catalog
ENT304 Enabling Self Service for Data Scientists with AWS Service Catalog
 
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
 
SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job
 SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job
SRV309 AWS Purpose-Built Database Strategy: The Right Tool for the Right Job
 
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...
Securely Deliver Desktop Applications with Amazon AppStream 2.0 (BAP201) - AW...
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDuty
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
 

Semelhante a SRV328 Designing and Implementing a Serverless Media-Processing Workflow

Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Amazon Web Services
 
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...Amazon Web Services
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)Amazon Web Services
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Amazon Web Services
 
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...Amazon Web Services
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Amazon Web Services
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Julien SIMON
 
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfMonetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfAmazon Web Services
 
Building Real-time Serverless Backends
Building Real-time Serverless BackendsBuilding Real-time Serverless Backends
Building Real-time Serverless BackendsAmazon Web Services
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Amazon Web Services
 
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...Amazon Web Services
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...Chris Munns
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless ApplicationsAmazon Web Services
 
Practical Guidance for Increasing your Serverless Application's Security
Practical Guidance for Increasing your Serverless Application's SecurityPractical Guidance for Increasing your Serverless Application's Security
Practical Guidance for Increasing your Serverless Application's SecurityChris Munns
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWSAmazon Web Services
 
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)Amazon Web Services
 

Semelhante a SRV328 Designing and Implementing a Serverless Media-Processing Workflow (20)

Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
 
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...
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
 
Taking serverless to the edge
Taking serverless to the edgeTaking serverless to the edge
Taking serverless to the edge
 
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)
 
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfMonetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
 
Building Real-time Serverless Backends
Building Real-time Serverless BackendsBuilding Real-time Serverless Backends
Building Real-time Serverless Backends
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
 
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless Applications
 
Practical Guidance for Increasing your Serverless Application's Security
Practical Guidance for Increasing your Serverless Application's SecurityPractical Guidance for Increasing your Serverless Application's Security
Practical Guidance for Increasing your Serverless Application's Security
 
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
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWS
 
Serverless for Developers
Serverless for DevelopersServerless for Developers
Serverless for Developers
 
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)
使用 AWS 無伺服器化應用程式模型 (SAM) 釋放您的 "敏捷" 能量 (Level 300)
 

Mais de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

SRV328 Designing and Implementing a Serverless Media-Processing Workflow

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. A n g e l a W a n g Solutions Architect, Amazon Web Services SRV328 Designing and Implementing a Serverless Media Processing Workflow Using AWS Step Functions
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Part one Why AWS Step Functions? Types of states Workshop overview
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. λλ λ DBMS λ λ λ λ λ λ λ λ λ Queue Modern app
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Modern app
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step Functions overview “I want to sequence functions” “I want to select functions based on data” I want to run functions in parallel” “I want to retry functions” “I want to try/catch/finally” “I want to run code for hours”
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step Functions overview Visualize in the console Define in JSON Monitor executions
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS::StepFunctions::StateMachine { "Comment": "A Hello World Example", "StartAt": "HelloWorld", "States": { "HelloWorld": { "Type": "Task", "Resource": "${lambdaArn}", "End": true } }}
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Seven state types Task A single unit of work Choice Adds branching logic Parallel Fork and join the data across tasks Wait Delay for a specified time Fail Stops an execution and marks it as a failure Succeed Successfully stops an execution Pass Passes its input to its output
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What you will build in this workshop • Multi-step state machine that leverages several SFN features: • AWS Lambda task state • Choice state • Custom error catching • Parallel state • Input/output manipulations using InputPath and ResultPaths Task Choice Parallel Fail
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands-on: Part one (step 0–1C) • Link to instructions: http://amzn.to/sfn-workshop What part one will look like when finished: What you’ll do: • Run AWS CloudFormation script • Deploy single-step state machine using the console • Test using the console
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Part one review
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ExtractImageMetadata ImageTypeCheck TransformMetadata Rekognition Thumbnail StoreMetadata Start End Synchronous task Task: A single unit of work Synchronous: Lambda { "ExtractImageMetadata": { "Type": "Task", "Resource": "arn:aws:lambda:mars-ter …”, … } }
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ExtractImageMetadata ImageTypeCheck TransformMetadata Rekognition Thumbnail StoreMetadata Start End Task: A single unit of work Asynchronous: “Activity Task”, Polled by workers { "ExtractImageMetadata": { "Type": ”Task", "Resource": "arn:aws:states:mars-ter …”, … } } Asynchronous task
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Part two Input/output processing Branching Custom error handling Parallel state
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Input/Output processing State [x] Input Output
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Input/Output processing State [x]"InputPath" "ResultPath" "OutputPath" Input Output
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. InputPath example { ”s3key”:”apple.png”, ”timestamp”:12324 } Input
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } "InputPath”:“$” Input InputPath example
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } State [x]"InputPath”:“$” Input Input received by state x: { ”s3key”:”apple.png”, ”timestamp”:12324 } InputPath example
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. InputPath example "InputPath”:“$.s3key” { ”s3key”:”apple.png”, ”timestamp”:12324 } State [x]"InputPath”:“$” Input Input received by state x: { ”s3key”:”apple.png”, ”timestamp”:12324 }
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. InputPath example State [y]"InputPath”:“$.s3key” { ”s3key”:”apple.png”, ”timestamp”:12324 } ”apple.png” State [x]"InputPath”:“$” Input Input received by state y: Input received by state x: { ”s3key”:”apple.png”, ”timestamp”:12324 }
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } Input State [x] State output: {“type”: “png"} "InputPath” : “$.s3key” “ResultPath”:“$” ResultPath example
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } Input State [x] State output: {“type”: “png"} "InputPath” : “$.s3key” “ResultPath”:“$”{ ”type”:”png}Output ResultPath example
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } Input State [x] State output: {“type”: “png"} "InputPath” : “$.s3key” “ResultPath”:“$”{ ”type”:”png}Output ”ResultPath”:“$.metadata” ResultPath example
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { ”s3key”:”apple.png”, ”timestamp”:12324 } Input State [x] State output: {“type”: “png"} "InputPath” : “$.s3key” “ResultPath”:“$”{ ”type”:”png}Output ”ResultPath”:“$.metadata” { ”s3key”:”apple.png”, ”timestamp”:12324, “metadata”: { “type”: “png"} } Output ResultPath example
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branching logic “ExampleChoiceState": { "Type": ”Choice", ”Choices": [{ ”Variable": ”$.imageformat", ”StringEquals": ”JPG", ”Next": “ParalellProcessing” }, … ], ”Default": ”NotSupported", … } Choice state
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Custom error handling “ExampleTaskState": { "Type": "Task", "Resource": “<Lambda Arn>", "Next": "Graceful Exit", "Retry": [ { "ErrorEquals": [ “ErrorA" ,”ErrorB”], "IntervalSeconds": 2, "MaxAttempts": 2, "BackoffRate": 1.5 } , { “ErrorEquals” : [ “ErrorC” ], “Interval Seconds” : 5 ], "Catch": [ { "ErrorEquals": [ "States.ALL" ], "Next": "Clean Up" } ] },
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. “P": { "Type": "Parallel", "Branches": [ { "StartAt": “P1", "States": { “P1": { "Type": "Task", "Resource": “<Lambda Arn>", "End": true } } }, { "StartAt": “P2", "States": { “P2": { "Type": "Task", "Resource": “<Lambda Arn>", "End": true } } } ], "Next": "NextState" } Parallel states
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hands-on: Part two (step 1D–3) • Link to instructions: http://amzn.to/sfn-workshop What part two will look like when finished: What you’ll do: • Add ResultPath • Add choice state • Add custom error handling • Add parallel state • Test using the console
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Part two review
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Part three Other architecture patterns
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use activity task for manual approval Step Functions Poll: taskToken Amazon SES Poller Approver Send success: taskToken API Gateway
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use Wait + Choice to wait for batch job/async APIs while: sleep (30) if status=done: break
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Integrate with other AWS services • Create state machines and activities with AWS CloudFormation • Call AWS Step Functions with Amazon API Gateway • Start state machines in response to events, or on a schedule, with Amazon CloudWatch Events • Monitor state machine executions with Amazon CloudWatch • Log API calls with AWS CloudTrail • Start state machine using AWS Lambda
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands-on: Part three (step 3–end) • Link to instructions: http://amzn.to/sfn-workshop What you’ll do: • Add a final task state to persist the metadata • Configure the trigger for the state machine • Deploy a test web application and test Optional bonus tasks: (if you finish early and you want to, keep going) Add in additional error handling/retry logic Add a manual approval task if inappropriate content is found A state machine to clean up when images are deleted
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Q&A
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are you building? #stepfunctions Serverless image recognition and processing backendEBS snapshot management https://console.aws.amazon.com/states/
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Please complete the session survey in the summit mobile app.
  • 39. Submit Session Feedback 1. Tap the Schedule icon. 2. Select the session you attended. 3. Tap Session Evaluation to submit your feedback.
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!