forked from salesforce/policy_sentry
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get_actions_matching_condition_crud_and_arn is now available. Part of…
… the scaffoldign needed for #21
- Loading branch information
Showing
5 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
examples/library-usage/querying/actions/get_actions_matching_condition_crud_and_arn.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
from policy_sentry.shared.database import connect_db | ||
from policy_sentry.querying.actions import get_actions_matching_condition_crud_and_arn | ||
import json | ||
|
||
if __name__ == '__main__': | ||
db_session = connect_db('bundled') | ||
results = get_actions_matching_condition_crud_and_arn( | ||
db_session, | ||
"ram:ResourceArn", | ||
"Permissions management", | ||
"arn:${Partition}:ram:${Region}:${Account}:resource-share/${ResourcePath}" | ||
) | ||
print(json.dumps(output, indent=4)) | ||
|
||
""" | ||
Output: | ||
[ | ||
'ram:createresourceshare' | ||
] | ||
""" |
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
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
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