Conversion rulesTwo output styles: an aws_iam_policy_document data source (native HCL blocks, readable and editable) or aws_iam_policy + jsonencode (the whole policy embedded verbatim, zero semantic loss); fields the doc style cannot map are called out, never dropped silently.
IAM Policy JSON
Load an IAM Policy JSON
Terraform HCL
Terraform code will appear here
Console policies into IaC

IAM Policy to Terraform

policy_document / jsonencode styles · unmappable fields flagged · local

🔒Processed locally in your browser — never uploaded or stored

No upload, no storage

JSON is processed in memory and never sent to a server.

Share via URL fragment

Share links encode data in the # anchor — never sent to a server.

Remember last edit

Optionally keep your last input locally; clear it with one click.

Why use IAM Policy to Terraform

Console to IaC in one step

Paste a policy JSON copied from the AWS console and get Terraform — no hand-typing statement blocks.

Two output styles

An aws_iam_policy_document data source for readable reviews, or jsonencode embedding the whole policy verbatim with zero semantic loss.

Common fields covered

Sid / Effect / Action / NotAction / Resource / Principal / Condition all map, with interpolation characters escaped into HCL-safe form.

No silent drops

Fields policy_document cannot express are named explicitly with a suggestion to switch to jsonencode — never a silently crippled output.

Local · no upload

IAM policies are sensitive configuration; converting entirely in your browser keeps them safe.