You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a pretty basic need to do some math within a template; I'd like to make the IOPS values for EBS volumes follow the max formulas that AWS supports based on Volume size parameters
Seems really silly to write a lambda that writes a stack output that I then consume as an input for an EBS volume property; by my understanding this forces me into nested templates if I want to only stack once to perform this math. I may be misunderstanding that too, not sure.
Are you currently working around this issue?
My workaround it to repeat myself, this is a real use-case:
What is the expected behavior with this new feature
This could be added as intrinsic functions (added to AWS::LanguageExtensions?) and be named Fn::Add, Fn:Subtract, Fn:Multiply, Fn:Divide. Each basic function could take multiple arguments:
If rounding is too complicated to implement, we could stick to integer operations only and skip Fn:Divide. This will still cover many use cases and simplify maintainability.
Overflow could throw 🤷
Attachments
N/A
The text was updated successfully, but these errors were encountered:
yvele
changed the title
Add (language extension) functions that handles basic mathematical operations
Add (language extension) functions that handles basic math operations
Jun 10, 2024
Community Note
Tell us about your request
It would be useful to add a way to perform basic arithmetic mathematical operations such as addition, subtraction, multiplication and division.
Tell us about the problem you are trying to solve. What are you trying to do, and why is it hard?
Mostly to keep template DRY.
See also:
From the reddit post:
Are you currently working around this issue?
My workaround it to repeat myself, this is a real use-case:
Others on the internet are using a custom function (overkill!) or a template preprocessor (CDK, etc.): https://stackoverflow.com/a/41422057/1480391
What is the expected behavior with this new feature
This could be added as intrinsic functions (added to
AWS::LanguageExtensions
?) and be namedFn::Add
,Fn:Subtract
,Fn:Multiply
,Fn:Divide
. Each basic function could take multiple arguments:Additional context
If rounding is too complicated to implement, we could stick to integer operations only and skip Fn:Divide. This will still cover many use cases and simplify maintainability.
Overflow could throw 🤷
Attachments
N/A
The text was updated successfully, but these errors were encountered: