aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

Documentation for !Ref of an AWS::Events::Rule not fully documented #1131

Open pplu opened 2 years ago

pplu commented 2 years ago

Name of the resource

AWS::Events::Rule

Resource name

No response

Reference Link

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#aws-resource-events-rule-return-values

Details

In https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#aws-resource-events-rule-return-values, the return value for the !Ref of a Rule is

Ref returns event rule ID, such as mystack-ScheduledRule-ABCDEFGHIJK

I have seen that Rules return "busname|rulename" as the value of !Ref. I am actually using the return value of !Ref on an Event this to monitor the rule like this:

 BusInvocationErrors:
   Type: AWS::CloudWatch::Alarm
   Properties:
    ActionsEnabled: true
    AlarmDescription: !Sub 'FailedInvocations in ${AWS::StackName}'
    ComparisonOperator: GreaterThanThreshold
    Dimensions:
    - Name: EventBusName
      Value: !Select [ 0, !Split [ '|', !Ref Rule ] ]
    - Name: RuleName
      Value: !Select [ 1, !Split [ '|', !Ref Rule ] ]
    Period: 60
    EvaluationPeriods: 1
    MetricName: FailedInvocations
    Namespace: AWS/Events
    Statistic: Sum

I would suggest that the return value be correctly documented.

pplu commented 1 year ago

8 months into having reported this, and it bit me again (didn't even remember reporting it). Is this going to get corrected?