Serverless Framework IAM Role Generator converts a pasted IAM policy JSON document into the IAM role block for your serverless.yml, in both syntaxes real projects actually use today: the modern provider.iam.role.statements syntax introduced in Serverless Framework v3, and the legacy provider.iamRoleStatements syntax used by v1/v2 projects and still common in the wild. A tab switches between the two without re-entering anything, since both are generated from the same statements.
Each Statement in your policy becomes one YAML list item with Effect, Action (always rendered as a YAML list, even for a single action), and Resource (also always a YAML list) — matching how these blocks are conventionally written by hand. A Condition block, when present, is embedded inline as JSON, which YAML accepts directly and preserves exactly.
This is a starting-point block to merge into your existing serverless.yml, not a full file: check that indentation lines up with the rest of your file and that it merges cleanly with any provider.iam/iamRoleStatements content you already have.