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?
CodePudding user response:
In Java there is putRolePolicy for that:
Adds or updates an inline policy document that is embedded in the specified IAM role.