Skip to content

Commit

Permalink
Merge pull request #112 from base2Services/feature/lambda-alias-support
Browse files Browse the repository at this point in the history
Add support for lambda aliases
  • Loading branch information
tarunmenon95 authored Jul 28, 2023
2 parents a44a87c + 306747d commit 754ce5c
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 754ce5c

Please sign in to comment.