Last active
July 24, 2019 22:11
-
-
Save vitali-s/f81a0b9cb25c21823f1d36f433c0a8bf to your computer and use it in GitHub Desktop.
Custodian project-iam-policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@resources.register('project-iam-policy') | |
class ProjectIAMRole(QueryResourceManager): | |
"""GCP resource: https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy | |
""" | |
class resource_type(TypeInfo): | |
service = 'cloudresourcemanager' | |
version = 'v1' | |
component = 'projects' | |
scope = 'project' | |
enum_spec = ('list', 'bindings', None) | |
id = 'role' | |
scope_key = 'parent' | |
scope_template = 'projects/{}' | |
@staticmethod | |
def get(client, resource_info): | |
return client.execute_query( | |
'post', verb_arguments={ | |
'name': 'projects/{}:getIamPolicy'.format( | |
resource_info['project_id'])}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment