1 Answer
- Newest
- Most votes
- Most comments
2
You can delete the inline policy from the role with the CLI command aws iam delete-role-policy --role-name <value> --policy-name <value>, where you only need the names (not ARNs) of the role and the inline policy. https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role-policy.html
In boto3, the method is delete_role_policy, taking the same format for the parameters: https://boto3.amazonaws.com/v1/documentation/api/1.26.86/reference/services/iam/client/delete_role_policy.html
An inline policy is embedded in the role and has no independent existence, and that's why it can't be detached the way that a managed IAM policy can be. An inline policy can only be deleted.
Relevant content
- asked 3 years ago
- asked 2 years ago
