Guardian 0.11.4
The 0.11.4
release of Guardian introduces the ability to create alarms on specific aliases on a lambda function.
Previously, alarms for lambda functions were created on the lambda function irrespective of any aliases on the lambda, this caused issues where a alarms would fire when the dev alias of a lambda function encountered errors due to the inability to distinguish between dev/prod aliases etc.
Guardian now detected the presence of an alias within the resource id and creates the alarm specifically on the lambda alias.
Example
- We start with 2 lambda functions,
NormalFunction
andFunctionWithAlias
which has two aliasDev
andProd
. - We deploy guardian with the following alarms.yaml template:
Resources:
Lambda:
- Id: NormalFunction
- Id: FunctionWithAlias:Dev
Observe that the resource id for FunctionWithAlias
targets only the Dev
alias whilst NormalFunction
has no alias target as such remains the same as before.
- Observe the created LambdaErrors alarms in Cloudwatch. Observe that the
Dev
alias is targeted in theFunctionWithAlias
alarm. - We then trigger a Lambda error in the
NormalFunction
andFunctionWithAlias
Prod alias which we are not monitoring.
Normal Function | FunctionWithAlias (Prod Alias) |
---|---|
-
Observe that the LambdaErrors alarm has triggered for
NormalFunction
as expected. Also observe it did not trigger ofFunctionWithAlias
as expected as the error occurred in theProd
alias but we are monitoring theDev
alias. -
Now we trigger a lambda error in the
FunctionWithAlias
lambda on theDev
alias. -
Observe the alarm for the
FunctionWithAlias
has triggered for the error induced on theDev
alias as expected.