I'm trying to write a script to get all the policies in one role and detach all policies.
Which lead me to use list_role_policies for each role, the call was successfully made, but it always shows:
{'PolicyNames': [], 'IsTruncated': False, 'ResponseMetadata': {'RequestId': 'xxx', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'xxx', 'content-type': 'text/xml', 'content-length': '323', 'date': 'Thu, 02 Apr 2020 18:49:35 GMT'}, 'RetryAttempts': 0}}
When I looked into the IAM via console, there are definitely policies attached, some Inline Poliicies but mostly Managed Policies, is this why they are not shown?
Also, ultimately I actually don't care too much about the policy names if it is not required, could there be some other ways that just detach all policies?
Thanks!