Closed raymondbutcher closed 5 years ago
After reading this a bit more https://www.terraform.io/docs/configuration/syntax.html#arguments-and-blocks
I think I want to change how blocks are created.
# current tf(f"resource.aws_iam_user.{username}", { "name": "test" }) # proposed tf("resource", "aws_iam_user", username, { "name": "test" })
The function might be like:
def tf(*args) -> Block: block_type = None labels = list(args) body = None # or {} not sure if labels: block_type = labels.pop(0) if labels: body = labels.pop() return Block(block_type, labels, body)
Should the function be called block() rather than tf()? Would it make the *.tf.py files a bit uglier?
block()
tf()
*.tf.py
Does this work for all potential blocks? Need to look at providers, terraform block, etc.
What about when generating tfvars files?
Done in 90cd11216b1c01b776618df0611b1c96e2146bb3
After reading this a bit more https://www.terraform.io/docs/configuration/syntax.html#arguments-and-blocks
I think I want to change how blocks are created.
The function might be like:
Should the function be called
block()
rather thantf()
? Would it make the*.tf.py
files a bit uglier?Does this work for all potential blocks? Need to look at providers, terraform block, etc.
What about when generating tfvars files?