-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource definitions for managed policies. #71
Conversation
@DenverJ thanks for contributing to the resource definitions! 👍 This looks great so far, but I think we'll want to make just a couple minor changes related to the questions you had above.
@trevorrowe any other feedback? |
I think it warrants reviewing some of the method naming schemes with the IAM service team to ensure we are in-line with their expectations, but overall this looks great! |
Add reverse attach/detach Group/Role/User actions for Policy.
Thanks guys. I have fixed up the first two points as per comments but I'm struggling with the last. Assuming that I can work out the correct JMESPath expression to pull out the entity names from the response that looks like this...
Then I would have an eg Is there an existing example of doing something like this? |
@DenverJ, we've had a good discussion on this internally and I think I will avoid adding the generic For now I'd like to merge in your updated model and share it with the other SDKs. It looks great! 👍 |
Resource definitions for managed policies.
Can we get a version bump so this managed policies code is pushed out to pypi ? |
@MonkeySecurity a new release is coming soon. We've put this code through an internal review and there's minor change coming, then we're good to release. |
This PR adds resource support for IAM Managed policies.
There are 3 main areas I wasn't sure about so it would be good to get some feedback.
1 - The create method on iam.Policy is a bit strange and I'm thinking I should just remove it. This is because the GetPolicy call to load the object requires an ARN but the CreatePolicy call expects a friendly name (and I couldn't see a way to use a regular expression of another value as an identifier). That means it would be something like this to create a new policy.
I think it's much clearer to simply call...
(I actually think this is generally clearer in all cases that I have encountered so far)
2 - I have configured methods on the Group/User/Role objects to attach/detach a policy. Eg.
Does it make sense to also add a method for each of Group/User/Role to the Policy object? Eg.
3 - The call to get attached entities of a Policy is ListEntitiesForPolicy. It returns Group/User/Role names within the response, but I could not see a way to split out the response into different resources, so I am making a filtered call for each type. Eg. The following code makes 3 separate calls to ListEntitiesForPolicy.