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,
NormalFunctionandFunctionWithAliaswhich has two aliasDevandProd. - 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
Devalias is targeted in theFunctionWithAliasalarm.
- We then trigger a Lambda error in the
NormalFunctionandFunctionWithAliasProd alias which we are not monitoring.
| Normal Function | FunctionWithAlias (Prod Alias) |
|---|---|
|
|
-
Observe that the LambdaErrors alarm has triggered for
NormalFunctionas expected. Also observe it did not trigger ofFunctionWithAliasas expected as the error occurred in theProdalias but we are monitoring theDevalias.
-
Now we trigger a lambda error in the
FunctionWithAliaslambda on theDevalias.
-
Observe the alarm for the
FunctionWithAliashas triggered for the error induced on theDevalias as expected.