Turning an existing IAM policy JSON document into a CloudFormation resource means wrapping it in an AWS::IAM::Policy resource and deciding how to represent the PolicyDocument property. IAM Policy to CloudFormation Converter pastes your policy JSON and produces a ready-to-adapt YAML resource block, embedding the policy document as inline JSON — which CloudFormation accepts directly, since JSON is a valid subset of YAML — rather than attempting a full JSON-to-YAML block-mapping re-encoding that risks subtly altering a value along the way.
The output is a starting point: the resource's logical id, its PolicyName, and the role it attaches to are clearly labeled placeholders you should rename to match real resources in your template before deploying. The policy document itself is preserved exactly as pasted, pretty-printed, and indented to sit correctly under PolicyDocument:.
This tool emits the AWS::IAM::Policy (inline policy attached to one or more roles) shape by default, since it is the simplest complete example; if you need a standalone AWS::IAM::ManagedPolicy instead, the change is a one-line edit to the Type and the attachment property.