Is there a way to add every number with the next one from a list and then the result to be added to the next number from the same list?
For example:
[0, 2, 5, 9]
Is there a way to get:
[0, 2, 7, 16]
I've come to:
resource "null_resource" "dmns_calc_l" {
count = "${length(local.num_cntd_and_zero_l) - 1}"
triggers {
num_calc_l = "${local.num_cntd_and_zero_l[count.index] + local.num_cntd_and_zero_l[count.index + 1]}"
}
}
locals {
num_calc_and_zero_l = [
"${0}",
"${null_resource.dmns_calc_l.*.triggers.num_calc_l}",
]
}
However, as it is clearly to see it - it is good enough only for a list of 3 elements /and if the first element is "0"/ because it does NOT add up with the previous addition result.
Hi @Xtigyro! :wave:
We use GitHub issues in this repository for tracking AWS provider bugs and enhancements rather than for questions. While we may be able to help with some simple problems here it's generally better to use one of the community forums where there are far more people ready to help; the GitHub issues here are generally monitored only by our few core maintainers who are generally only working on provider bugs or enhancements.
If you do feel you have found a bug or limitation, feel free to open an issue in the Terraform core repository as this relates to available configuration language built-in functions.
Thanks!
Hi Brian,
Thanks for your time! And yes, I know - I have something to say about this though.
Why is there a "question" that one can choose from the types of issues? And by the way the question is a fundamental one - it's difficult for the community to know whether a specific technique actually exists in Terraform.
From past experience if someone is not using one of the community forums like the mailing list, Stack Overflow, etc. most people will submit issues in the hashicorp/terraform repository first. We're not really equipped for handling general Terraform usage questions in any of the providers as the information would be spread out in many places. We do have some tooling setup to migrate issues from hashicorp/terraform to the provider repositories if necessary, but not the other way around.
As our first iteration of trying to better handle the "normal" types of requests that come into this Terraform provider specifically, we setup the "Bug Report"/"Feature Request"/"Question" issue templates.
When selecting "Question" from the issue templates you should see a page with these details:

The "Bug Report" template has additional information about when this might need to be submitted upstream to hashicorp/terraform:

Does this information not show up for you?
If you have ideas for how to improve this, please let us know.
Yes, it does. However, the information is scarce on the Internet re Terraform use cases and ideas. Very often nobody actually answers you.
Anyway, I do understand that this is vast and tons of questions come up.
Have a good evening and thanks for your time again - it's appreciated. I do hope that HCL 2 has good "loop" and "nested loops" improvements as this is the hardest thing to overcome most of the times. The second will be more organized documentation with much more real use cases and examples.
P.S. And actually I've made a proposition re the documentation in one of my other posted question here.
Sorry to bother you, Brian, but I have a short off-topic question.
How can I make a proposition for a module and if I've written some code - how can I share it with you so you can evaluate it?
How can I make a proposition for a module and if I've written some code - how can I share it with you so you can evaluate it?
If by "module", you mean a Terraform module that is published to the Terraform registry, those modules are mostly community developed and managed. Publishing information can be found here: https://www.terraform.io/docs/registry/modules/publish.html
We currently only have a limited verification program for Terraform modules:
Module verification is currently a manual process restricted to a small group of trusted HashiCorp partners. In the coming months, we'll be expanding verification to enable the broader community to verify their modules.
I personally do not have more information about the second part there, but it might be worth asking on the mailing list.
Thank you very much!
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!