【AWS】step-functions服务编排

作为AWS Serverless无服务器的一个重要一环
使用step-functions方法将 AWS 服务链接在一起

step-functions

https://us-east-2.console.aws.amazon.com/states/home?region=us-east-2#/homepage

功能:
配置工作流,工作流中的每个步骤称为一个状态
任务状态可以调用任何 AWS 服务或 API

State machine type

Standard workflows

异步,仅执行一次workflows,可以运行长达一年

Express workflows

同步,至少执行一次workflows,最多可以运行五分钟

design skills

  • keep all output
    在这里插入图片描述

  • 当需要使用引号,但双引号和单引号都已使用时,请使用``。

  • pass value
    另一种典型场景:根据@type选择时,选择中无法识别@符号,那么可以先添加一个Pass状态:

"Pass": {
  "Type": "Pass",
  "Next": "Choice",
  "Parameters": {
    "type.$": "$.@type"
  },
  "ResultPath": "$.pass"
},

"Choice": {
  "Type": "Choice",
  "Choices": [
    {
      "Variable": "$.pass.type",
      "StringEquals": "ProductOfferingPrice",
      "Next": "[API]active productOffering (1)"
    },
    {
      "Variable": "$.pass.type",
      "StringEquals": "ProductOfferingPriceRef",
      "Next": "[API]patch productOfferingPrice1"
    }
  ],
  "Default": "Skip"
}

Error handling

Every api call should include success Output and Error handling ! ! !
在这里插入图片描述

  • Errors that need to be captured separately, should have a separate error handling

like:ApiGateway.400 ApiGateway.404
在这里插入图片描述

saga Transaction processing

在这里插入图片描述

控制分布式系统中的并发性

https://aws.amazon.com/cn/blogs/compute/controlling-concurrency-in-distributed-systems-using-aws-step-functions/

收费

便宜,100万次调用1美元
https://aws.amazon.com/step-functions/pricing/?nc1=h_ls

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xyc1211

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值