configu / configu

Open-source ConfigOps infrastructure ⚙️

Home Page:https://configu.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format objects for Terraform .tfvars file

samgabrail opened this issue · comments

commented

Current Behavior

using a schema like this:

"my_tags": {
"type": "JSONSchema",
"description": "A map of tags to add to all resources.",
"schema": {"type": "object"},
"required": true
}

then exporting as a Terraform .tfvars file results in this:

prefix = "configu"
region = "us-east-1"
address_space = "10.0.0.0/16"
subnet_prefix = "10.0.10.0/24"
instance_type = "t2.micro"
my_aws_key = "mykey.pem"
my_tags = "{"Name": "configu-demo", "Environment": "Development"}"

Expected Behavior

However, Terraform doesn't like this and considers it invalid. would need to either do this:
my_tags = "{\"Name\": \"configu-demo\", \"Environment\": \"Development\"}"

or better yet, export it as a map (object) like this:
my_tags = {"Name": "configu-demo", "Environment": "Development"}

To Reproduce

No response

Context

No response

Great catch @samgabrail!

@rannn505 please provide your insight regarding the right way to go about fixing this issue.

Thanks @samgabrail well handle it in the next release :)

commented

can you assign it to me please?