Skip to content

Commit

Permalink
Add support for lambda aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunmenon95 committed Jul 28, 2023
1 parent a44a87c commit 306747d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/cfnguardian/models/alarm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ def initialize(resource)
super(resource)
@group = 'Lambda'
@namespace = 'AWS/Lambda'
@dimensions = { FunctionName: resource['Id'] }
if resource['Id'].include?(':')
lambda_name, lambda_alias = resource['Id'].split(':', 2)
@dimensions = { FunctionName: lambda_name, Resource: resource['Id'] }
else
@dimensions = { FunctionName: resource['Id'] }
end
@statistic = 'Average'
@evaluation_periods = 5
@treat_missing_data = 'notBreaching'
Expand Down
2 changes: 1 addition & 1 deletion lib/cfnguardian/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CfnGuardian
VERSION = "0.11.3"
VERSION = "0.11.4"
CHANGE_SET_VERSION = VERSION.gsub('.', '-').freeze
end

0 comments on commit 306747d

Please sign in to comment.