flosell / iam-policy-json-to-terraform

Small tool to convert an IAM Policy in JSON format into a Terraform aws_iam_policy_document
https://flosell.github.io/iam-policy-json-to-terraform/
Apache License 2.0
774 stars 58 forks source link

Remove superflous quotes when dealing with inline terraform expressions #14

Open flosell opened 4 years ago

flosell commented 4 years ago

(triggered by #13)

When writing policy JSONs inline as heredoc, one often includes terraform expressions for certain values, e.g.

"Resource": ["${aws_kms_key.key.arn}"]

Currently, those are converted into normal string arrays with interpolations, e.g.

resources = ["${aws_kms_key.key.arn}"]

Since terraform 0.12, there's a more elegant way to express this, would be nice for iam-policy-json-to-terraform to render them:

resources = [ aws_kms_key.key.arn ]