question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regional base price selection (Step Functions)

See original GitHub issue

Similarly to #77, we should use the correct regional price of Step Functions based on where the state machine is executed (which might be different from the input function’s region!).

Each state transition costs $0.000025 in almost every region, with some exceptions:

  • default: $0.025
  • eu-south-1: $0.02625
  • us-west-1: $0.0279
  • af-south-1: $0.02975
  • ap-east-1: $0.0275
  • ap-south-1: $0.0285
  • ap-northeast-2: $0.0271
  • eu-south-1: $0.02625
  • eu-west-3: $0.0297
  • me-south-1: $0.0275
  • sa-east-1: $0.0375
  • us-gov-east-1: $0.03
  • us-gov-west-1: $0.03

The state machine execution cost is computed here:

module.exports.stepFunctionsCost = (nPower) => +(0.000025 * (6 + nPower)).toFixed(5);

The formula to compute the # of state transitions is: 6 + COUNT(POWERVALUES), therefore the Step Functions cost will be REGIONAL_COST * NUMBER_OF_TRANSITIONS.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcasalbonicommented, May 7, 2020

Mmm I think I’d rather count on the SAR versioning to make sure each version is stable and to easily identify bugs or price changes over time (wrt of hoping that everything works correctly during the deployment phase). Also, i don’t think it makes sense to complicate everything with scripts, custom resources, or other tricks to fetch the most updated data on-deploy.

The main reason is that I don’t expect these prices to change every week/month/year. So I think it’s more than enough if we plan to have a daily/weekly crawler that checks if prices have changed and opens a PR here. But definitely not required for this issue, imho.

For now I’d stick to a static file or env variable with the current prices.

1reaction
alexcasalbonicommented, May 7, 2020

Yes, AWS_REGION should work great.

From the documentation: “The AWS Region where the Lambda function is executed.”

For clarify: its value might be different from the region where the input Lambda function is running, but that’s ok. Lambda Power Tuning works with functions in any region, but you still need to deploy the state machine in a region 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Step Functions Pricing | Amazon Web Services - AWS
With AWS Step Functions, you pay only for what you use. You are charged based on ... AWS Step Functions Standard Workflow State...
Read more >
Quotas - Amazon Step Functions - 亚马逊云科技
Throttling quotas are per account, per Amazon Region. Amazon Step Functions may increase both the bucket size and refill rate at any time....
Read more >
Building Business Workflows with AWS Step Functions
With AWS Step Functions you can build workflows to coordinate applications from single AWS Lambda functions up through complex multi-step ...
Read more >
Hitchhiker's Guide to AWS Step Functions - Epsagon
Review all you need to know about AWS Step Functions, including a ... At $25 per million state transitions, plus the cost of...
Read more >
Cloud Functions Locations - Google Cloud
Tier 1 pricing; Tier 2 pricing; Selecting the region; Setting a default region; Data residency; Best practices for changing region. HTTP functions ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found