Repository: ACloudGuru/serverless-plugin-aws-alerts (js)

Issue:
Alarm won't trigger even alarm was created successfully
Currently, alarm has invalid dimension. so alarm won't trigger even alarm was created successfully.

This is our example serverless.yml:
```yml
# (truncated)

plugins:
  - serverless-plugin-aws-alerts
functions:
  hello:
    handler: handlers.hello
    alarms:
      - functionErrors

custom:
  alerts:
    definitions:
      functionErrors:
        namespace: 'AWS/Lambda'
        metric: Errors
        threshold: 1
        statistic: Minimum
        period: 600
        evaluationPeriods: 1
        comparisonOperator: GreaterThanThreshold

# (truncated)
```


Generated CloudFormation content:
```json
{
  "Resources": {
    "ValidateFunctionErrorsAlarm": {
      "Type": "AWS::CloudWatch::Alarm",
      "Properties": {
        "Namespace": "AWS/Lambda",
        "MetricName": "Errors",
        "Threshold": 1,
        "Statistic": "Minimum",
        "Period": 600,
        "EvaluationPeriods": 1,
        "ComparisonOperator": "GreaterThanThreshold",
        "OKActions": [],
        "AlarmActions": [],
        "InsufficientDataActions": [],
        "Dimensions": [
          {
            "Name": "HelloLambdaFunctionName",
            "Value": {
              "Ref": "HelloLambdaFunction"
            }
          }
        ]
      }
    }
  }
}
```

I think value of `Dimensions[0].Name` should be use 'FunctionName', not `${ref}Name`.

Pull request:
fix alarm won’t triggered. closes #12
Closes #12.


Patch:
diff --git a/src/index.js b/src/index.js
index a07737d..446b56b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -99,7 +99,7 @@ class Plugin {
 		} else {
 			const dimensions = _.map(functionRefs, (ref) => {
 				return {
-					Name: `${ref}Name`,
+					Name: 'FunctionName',
 					Value: {
 						Ref: ref,
 					},


Test patch:
diff --git a/src/index.test.js b/src/index.test.js
index 12898d8..b5066e6 100644
--- a/src/index.test.js
+++ b/src/index.test.js
@@ -341,7 +341,7 @@ describe('#index', function () {
 						OKActions: [],
 						InsufficientDataActions: [],
 						Dimensions: [{
-							Name: 'FooLambdaFunctionName',
+							Name: 'FunctionName',
 							Value: { Ref: 'FooLambdaFunction' },
 						}]
 					}
@@ -404,7 +404,7 @@ describe('#index', function () {
 						OKActions: [],
 						InsufficientDataActions: [],
 						Dimensions: [{
-							Name: 'FooLambdaFunctionName',
+							Name: 'FunctionName',
 							Value: { Ref: 'FooLambdaFunction' },
 						}]
 					}