inspec / inspec-aws

InSpec AWS Resource Pack https://www.inspec.io/
Other
136 stars 106 forks source link

aws_eventbridge_rule is not able to specify event bus #953

Open ganhuang opened 1 year ago

ganhuang commented 1 year ago

In aws_eventbridge_rule, we're not able to pass event bus other than default event bus

Describe the problem

Trying to validate event rule resource, it appears that it can't specify event bus, which leads to the failure

aws_cloudwatch_event_rule_name = attribute('cloudwatch_event_rule_name')

control 'aws-event-rule' do
  impact 1.0
  title 'Ensure AWS Event Rule has the correct properties.'

  describe aws_eventbridge_rule(name: aws_cloudwatch_event_rule_name) do
    it { should exist }
  end
end

Actual Result

[2022-11-05T10:41:00+08:00] WARN: AWS Service Error encountered running a control with Resource aws_eventbridge_rule. Error message: Rule sample-event-rule does not exist on EventBus default.. You should address this error to ensure your controls are behaving as expected.

  ×  aws-event-rule: Ensure AWS Event Rule has the correct properties.
     ×  Rule Name: sample-event-rule is expected to exist
     expected Rule Name: sample-event-rule

Possible Solution