inspec/test/integration/default/verify/controls/aws_cloudwatch_alarm.rb
Clinton Wolfe c75252ae1c
Rework Integration Testing to Support Multiple Accounts (#128)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-12-15 01:37:36 -05:00

29 lines
No EOL
660 B
Ruby

fixtures = {}
[
'cloudwatch_alarm_1_name',
'cloudwatch_alarm_1_metric_name',
'cloudwatch_alarm_1_namespace',
].each do |fixture_name|
fixtures[fixture_name] = attribute(
fixture_name,
default: "default.#{fixture_name}",
description: 'See ../build/cloudwatch.tf',
)
end
control 'aws_cloudwatch_alarm recall' do
describe aws_cloudwatch_alarm(
metric_name: fixtures['cloudwatch_alarm_1_metric_name'],
metric_namespace: fixtures['cloudwatch_alarm_1_namespace'],
) do
it { should exist }
end
describe aws_cloudwatch_alarm(
metric_name: 'NopeNope',
metric_namespace: 'Nope',
) do
it { should_not exist }
end
end