iam-policy-json-to-terraform

Convert AWS IAM policy JSON to Terraform HCL code.

brewmacoslinux
Try with needOr install directly
Source

About

Convert a JSON IAM Policy into terraform

Commands

iam-policy-json-to-terraform

Examples

convert IAM policy JSON to Terraform$ iam-policy-json-to-terraform < policy.json
convert inline JSON policy to Terraform code$ echo '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:*","Resource":"*"}]}' | iam-policy-json-to-terraform
convert IAM policy and save as Terraform file$ iam-policy-json-to-terraform < policy.json > policy.tf
convert policy from AWS console and generate Terraform$ cat exported-policy.json | iam-policy-json-to-terraform
transform multiple IAM policies to Terraform format$ for f in *.json; do iam-policy-json-to-terraform < "$f" > "${f%.json}.tf"; done