I am writing code which requires IAM role to be created programmatically in Java. I would like an inline policy attached to the role instead of a managed policy. I can only find example and doc to create a role and a managed policy separately, then attach the managed policy to the existing IAM role.
How can I create an IAM role with inline policy?