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
variable"lastname" {
type=stringdefault="bär"
}
variable"firstname" {
type=stringdefault="föo"
}
terraform {
required_providers {
corefunc={
source ="northwood-labs/corefunc"
version ="1.5.1"
}
}
}
locals {
username=provider::corefunc::str_iterative_replace(
lower("${var.firstname}.${var.lastname}"),
[
{ old ="ä", new ="ae" },
{ old ="ö", new ="oe" },
{ old ="ü", new ="ue" },
{ old ="ß", new ="ss" },
],
)
}
output"out" {
value=local.username
}
parse-hcl.js
const{ parse }=require('@cdktf/hcl2json');constfs=require('fs').promises;consthclFilePath='test.tf';(async()=>{try{// Read the HCL content from the fileconsthcl=awaitfs.readFile(hclFilePath,'utf-8');// Parse the HCL contentconstjson=awaitparse(hclFilePath,hcl);// Output the parsed JSONconsole.log(JSON.stringify(json,null,2));}catch(err){console.error('Error:',err.message);}})();
Error: parse config: [test.tf:22,22-23: Missing newline after argument; An argument definition must end with a newline.]
However, a terraform plan works fine. And the usage of provider::corefunc::str_iterative_replace is as describe here.
docker run -it --rm -v $PWD:/tmp -w /tmp hashicorp/terraform:1.10 init
docker run -it --rm -v $PWD:/tmp -w /tmp hashicorp/terraform:1.10 plan
Changes to Outputs:
+ out = "foeo.baer"
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.
The text was updated successfully, but these errors were encountered:
Consider
test.tf
parse-hcl.js
However, a
terraform plan
works fine. And the usage ofprovider::corefunc::str_iterative_replace
is as describe here.The text was updated successfully, but these errors were encountered: