terraform icon indicating copy to clipboard operation
terraform copied to clipboard

lang/funcs: Add camelCase, kebab-case and snake_case functions

Open stephen-harris opened this issue 4 years ago • 17 comments

stephen-harris avatar Dec 22 '20 22:12 stephen-harris

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Dec 22 '20 22:12 hashicorp-cla

Codecov Report

Merging #27357 (33934ed) into master (c0e37a7) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted Files Coverage Δ
lang/funcs/string.go 100.00% <100.00%> (ø)
lang/functions.go 96.35% <100.00%> (+0.08%) :arrow_up:
terraform/evaluate.go 52.89% <0.00%> (+0.41%) :arrow_up:
terraform/node_resource_plan.go 98.05% <0.00%> (+1.94%) :arrow_up:

codecov[bot] avatar Dec 22 '20 22:12 codecov[bot]

I would love this @teamterraform :)

pranaygp avatar May 28 '21 23:05 pranaygp

This PR has been languishing for a long time now 😞

Could someone from @teamterraform please comment on whether or not this contribution will be accepted if the conflicts are resolved?

dhirschfeld avatar Sep 06 '21 03:09 dhirschfeld

@teamterraform I am in urgent need of these functions. I was writing logic in my tf module when I saw this PR. Please let us know when these changes will get merged? A lot of people are waiting for this feature. I can work on whatever is left. It has been almost a year for such a simple but very useful feature.

Shrirang97 avatar Oct 21 '21 11:10 Shrirang97

@teamterraform Can we please have a look at it. This will save hours of work for many of us. Thanks! :heart:

sobi3ch avatar Oct 28 '21 08:10 sobi3ch

Bumping! Would be nice to have this in terraform :)

dnck avatar Jan 24 '22 16:01 dnck

Bumping again! I'm new to TF and this would be great to have.

shayan-golafshani avatar Mar 25 '22 16:03 shayan-golafshani

This wasn't released yet right? Could that be included to convert json keys during jsondecode, as a optional parameter?

felipefrocha avatar Apr 08 '22 16:04 felipefrocha

This PR is in a holding pattern for now, please see this comment: https://github.com/hashicorp/terraform/issues/28855#issuecomment-856345294, specifically:

We're being pretty cautious about adding new functions that overlap with existing use-cases because Terraform has grown quite an unwieldy collection of builtins over the years, and so we've been considering various ways to allow for externally-defined functions (e.g. https://github.com/hashicorp/terraform/issues/2771) to avoid continuing to grow that set. However, that's not something we'll be working on in the very near future, due to our current focus being elsewhere, so we'll revisit this at a later time and post any updates in those other issues.

Just an FYI as to why this hasn't been reviewed. The conversation is active but there are no updates as to externally-defined functions. Once that has been designed, it will be easier to determine which of the existing requests for functions belong in core versus belong outside of core.

crw avatar Apr 08 '22 19:04 crw

@teamterraform any update on this?

Shrirang97 avatar May 20 '22 05:05 Shrirang97

@Shrirang97 no updates at this time.

crw avatar Oct 19 '22 21:10 crw

@crw @teamterraform 9 months on; what are your latest thoughts on this please?

jonmcewen avatar Jul 06 '23 08:07 jonmcewen

@jonmcewen https://github.com/hashicorp/terraform/pull/27357#issuecomment-1093269075

For what it is worth, I am continuing to champion the extendable functions concept. However, there is no update to share.

crw avatar Jul 06 '23 20:07 crw

Hello, it would really be a plus in the integration of csv files from providers like Google. a concrete example on Google alert monitoring, it's possible to export in csv (Camel Case). The need would be to convert all map ids to Snake Case and integrate the file into Terraform even more easily.

millouzgc avatar Oct 23 '23 15:10 millouzgc

Just FYI, https://github.com/hashicorp/terraform/issues/27696#issuecomment-1758977989

crw avatar Oct 23 '23 17:10 crw

Is anyone interested in making a provider for these functions? https://github.com/hashicorp/terraform/issues/2771

mcm-ham avatar Jun 09 '24 09:06 mcm-ham