From 63b63bd9911f36471b0f6ae02e4cb176bee25953 Mon Sep 17 00:00:00 2001 From: Tarun Menon Date: Thu, 17 Aug 2023 11:44:30 +1000 Subject: [PATCH] Fix tagging for multiple alarm actions --- lib/cfnguardian/tagger.rb | 6 +++++- lib/cfnguardian/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cfnguardian/tagger.rb b/lib/cfnguardian/tagger.rb index 5d5024f..fa66c9f 100644 --- a/lib/cfnguardian/tagger.rb +++ b/lib/cfnguardian/tagger.rb @@ -29,7 +29,11 @@ def tag_alarm(alarm, global_tags={}) logger.debug "Updating tags on alarm #{alarm_arn}" new_tags.delete_if {|key, value| value.include?('?')} begin - @client.tag_resource({ + alarm_severity = new_tags["guardian:alarm:severity"] + if alarm_severity.is_a?(Array) + new_tags["guardian:alarm:severity"] = new_tags["guardian:alarm:severity"].join("/") + end + @client.tag_resource({ resource_arn: alarm_arn, tags: new_tags.map {|key,value| {key: key, value: value}} }) diff --git a/lib/cfnguardian/version.rb b/lib/cfnguardian/version.rb index c68dcc7..ed7bbab 100644 --- a/lib/cfnguardian/version.rb +++ b/lib/cfnguardian/version.rb @@ -1,4 +1,4 @@ module CfnGuardian - VERSION = "0.11.4" + VERSION = "0.11.5" CHANGE_SET_VERSION = VERSION.gsub('.', '-').freeze end