Make cloudwatch log metric filter test fixtures more unique (#201)

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2018-01-23 22:16:00 -05:00 committed by GitHub
parent 0af7105eba
commit 2d6bb1b84a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -40,7 +40,7 @@ output "log_metric_filter_1_metric_name" {
resource "aws_cloudwatch_log_metric_filter" "lmf_2" {
name = "${terraform.env}_lmf"
pattern = "testpattern02"
pattern = "${terraform.env}testpattern02"
log_group_name = "${aws_cloudwatch_log_group.lmf_lg_2.name}"
metric_transformation {
@ -62,6 +62,9 @@ output "log_metric_filter_2_log_group_name" {
value = "${aws_cloudwatch_log_group.lmf_lg_2.name}"
}
output "log_metric_filter_2_pattern" {
value = "${terraform.env}testpattern02"
}
#======================================================#
# Cloudwatch Alarms
#======================================================#

View file

@ -5,6 +5,7 @@ fixtures = {}
'log_metric_filter_1_metric_name',
'log_metric_filter_2_name',
'log_metric_filter_2_log_group_name',
'log_metric_filter_2_pattern',
].each do |fixture_name|
fixtures[fixture_name] = attribute(
fixture_name,
@ -25,7 +26,7 @@ control "aws_cloudwatch_log_metric_filter recall" do
end
describe aws_cloudwatch_log_metric_filter(
pattern: 'testpattern02',
pattern: fixtures['log_metric_filter_2_pattern'],
) do
it { should exist }
end