Terraform IAM Policy Resource Generator goes beyond wrapping a policy JSON document in a bare jsonencode(...) call: it generates a complete, named aws_iam_policy resource with editable name, path, and description arguments, and — when you turn on the role option — an aws_iam_role plus an aws_iam_role_policy_attachment wiring the new policy to that role. The role's trust document is generated from a chosen AWS service principal (EC2, Lambda, ECS tasks, and more), so the output is a small, deployable mini-module rather than a single orphaned policy resource.
The policy document itself is embedded with jsonencode(...), the standard, idiomatic pattern most real Terraform codebases use for a raw IAM policy, since it accepts a JSON-compatible literal directly and reproduces your policy exactly, only re-indented to fit the HCL block.
Every generated name is a clearly labeled placeholder. This is a starting point for review, not a finished module: rename resource identifiers, the policy path, and the role name to fit your project, and add any dynamic Terraform references (like another resource's ARN) by hand — this tool only converts the static JSON you paste.