Last active
July 22, 2022 15:19
-
-
Save prog893/f6e4bc48ca652cc0ea865602350d775e to your computer and use it in GitHub Desktop.
awscli aliases
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
# Prerequisites: awscli, jq | |
## Show role details for a Lambda function | |
function get-function-role() { | |
aws lambda get-function --function-name "$1" | jq '.Configuration.Role' -j | sed 's/.*\///' | xargs aws iam get-role --role-name | jq | |
} | |
## Show Lambda function resource-based policy | |
# Useful for debugging integration with other services (like API Gateway, ALB and EventBridge) | |
# since permissions for invocations from them are written here | |
function get-function-resource-policy() { | |
aws lambda get-policy --function-name $1 | jq '.Policy' -r | jq | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment