Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # AWS snippets
- I created these functions and small scripts to help me a bit using AWS. I personally don't like AWS console (as a guy who uses XTerm and WindowMaker in a regular basis, open a webpage just to check logs is too cumbersome :D). I use Ubuntu 18.04.
- ## CodeCommit
- 1) Creating a pull-request
- ```bash
- aws codecommit create-pull-request \
- --title "Doing something with code" \
- --description "This PR does amazing things you wouldn't believe." \
- --targets "sourceReference=feat/awesome-branch,destinationReference=develop,repositoryName=my-repo"
- ```
- 2) Merging a pull-request
- ```bash
- aws codecommit merge-pull-request-by-three-way --repository-name my-repo --pull-request-id 629
- ```
- ## Reading lambda function last event in CloudWatch
- ```bash
- export GROUP_NAME=/aws/lambda/my-awesome-yet-small-lambda
- function get_log_id() {
- aws logs describe-log-streams --log-group-name ${GROUP_NAME} --order-by LastEventTime |grep logStreamName | sed -E 's/.*: "(.*)",/\1/g'
- }
- aws logs get-log-events --log-group-name ${GROUP_NAME} --log-stream-name "$(get_log_id | tail -n1)" |grep message
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement