Reputation: 33
Template format error: YAML not well-formed. (line 30, column 36). Please Help Me. Error comes in FilterPattern line
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MySNSTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
- Endpoint: "[email protected]"
Protocol: email
snstopic:
Type: AWS::Logs::LogGroup
DependsOn: MySNSTopic
Properties:
RetentionInDays: 7
UnauthorizedApiCalls:
Type: AWS::Logs::MetricFilter
DependsOn: snstopic
Properties:
LogGroupName:
Ref: "snstopic"
FilterPattern: "{($.errorCode="*UnauthorizedOperation") || ($.errorCode="AccessDenied*")}"
MetricTransformations:
-
MetricValue: "1"
MetricNamespace: "unauthorized-api-calls"
MetricName: "LogMetrics"
Upvotes: 2
Views: 632
Reputation: 238081
You should use single quotes:
FilterPattern: '{($.errorCode="*UnauthorizedOperation") || ($.errorCode="AccessDenied*")}'
Upvotes: 1