Skip to content

Commit

Permalink
added cloudwatch log group modifier for lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Koval committed Dec 27, 2016
1 parent 0f7b41d commit 0f41301
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ To perform a query against your selected profile. Alfred will then auto-populate
#### Modifier Key Cheat Sheet
Below is a table describing the currently supported AWS resource lookups and what Alfred will do upon hitting **Enter** when combined with modifier keys:

| | (none) | Cmd | Alt / Option | Ctrl | Shift <sub>(_press_, not hold)</sub> |
| :---: | --- | --- | --- | --- | --- |
| ![](icons/cfn_stack.png)CloudFormation | Open stack in AWS console | | | | Quicklook |
| ![](icons/ec2_instance.png)<br/>EC2 | Copies _private_ IP | Open instance in AWS console | Copies _public_ IP (if available) | | Quicklook |
| ![](icons/eb_environment.png)<br/>Elastic Beanstalk | Open environment in AWS Console | Copies load balancer URL (if available) | | | Quicklook |
| ![](icons/services/lambda.png)<br/>Lambda | Open function in AWS console | | | | Quicklook |
| ![](icons/db_instance.png)![](icons/db_cluster.png)<br/>RDS | Copy endpoint URL | Open cluster or node in AWS Console | | | Quicklook |
| ![](icons/services/redshift.png)<br/>Redshift | Open cluster in AWS console | Copies first node's _private_ IP (if available) | Copies first node's _public_ IP (if available) | | Quicklook |
| ![](icons/s3_bucket.png)<br/>S3 | Open bucket in AWS Console | | | | Quicklook |
| ![](icons/sqs_queue.png)<br/>SQS | Open queue in AWS console | Copy queue URL | | | Quicklook |
| | (none) | Cmd | Alt / Option | Ctrl | Shift <sub>(_press_, not hold)</sub> |
| :---: | --- | --- | --- | --- | --- |
| ![](icons/cfn_stack.png)CloudFormation | Open stack in AWS console | | | | Quicklook |
| ![](icons/ec2_instance.png)<br/>EC2 | Copies _private_ IP | Open instance in AWS console | Copies _public_ IP (if available) | | Quicklook |
| ![](icons/eb_environment.png)<br/>Elastic Beanstalk | Open environment in AWS Console | Copies load balancer URL (if available) | | | Quicklook |
| ![](icons/services/lambda.png)<br/>Lambda | Open function in AWS console | Open CloudWatch log group in AWS Console | | | Quicklook |
| ![](icons/db_instance.png)![](icons/db_cluster.png)<br/>RDS | Copy endpoint URL | Open cluster or node in AWS Console | | | Quicklook |
| ![](icons/services/redshift.png)<br/>Redshift | Open cluster in AWS console | Copies first node's _private_ IP (if available) | Copies first node's _public_ IP (if available) | | Quicklook |
| ![](icons/s3_bucket.png)<br/>S3 | Open bucket in AWS Console | | | | Quicklook |
| ![](icons/sqs_queue.png)<br/>SQS | Open queue in AWS console | Copy queue URL | | | Quicklook |

... more resources and modifiers to be implemented. Feel free to [fork this repo](#fork-destination-box) to implement your own!

Expand Down
9 changes: 9 additions & 0 deletions aws_workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ def populate_menu_item(self, wf, function, title, uid, region_name, quicklookurl
)
item.setvar('action', 'open-url')

cloudwatch_url = 'https://%s.console.aws.amazon.com/cloudwatch/home?region=%s#logStream:group=/aws/lambda/%s;streamFilter=typeLogStreamPrefix' % (region_name, region_name, title)
cmdmod = item.add_modifier(
'cmd',
subtitle='open cloudwatch log group',
arg=cloudwatch_url,
valid=True,
)
cmdmod.setvar('action', 'open-url')


class EnvironmentFinder(Finder):
item_identifier = 'eb'
Expand Down

0 comments on commit 0f41301

Please sign in to comment.