You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a policy to send notifications to a channel pulled from a resource tag, there are several resources and all messages are being sent to one channel or not sent at all.
The notify action is set to send a slack message to a resource tag - slack://tag/resource_tag. When there are several resources, it only pulls the slack channel tag from one resource (last in the resource list), so if there is no channel tag on that resource, no message gets sent. If there are several resources with different channel tags, all the slack messages get sent to one channel.
Describe the bug
I wrote a policy to send notifications to a channel pulled from a resource tag, there are several resources and all messages are being sent to one channel or not sent at all.
The notify action is set to send a slack message to a resource tag
- slack://tag/resource_tag
. When there are several resources, it only pulls the slack channel tag from one resource (last in the resource list), so if there is no channel tag on that resource, no message gets sent. If there are several resources with different channel tags, all the slack messages get sent to one channel.On this line:
https://github.com/cloud-custodian/cloud-custodian/blob/master/tools/c7n_mailer/c7n_mailer/slack_delivery.py#L81
resource is not a variable that is explicitly set, but is seem to be the last iterable from a previous for loop
https://github.com/cloud-custodian/cloud-custodian/blob/master/tools/c7n_mailer/c7n_mailer/slack_delivery.py#L27-L31
What did you expect to happen?
I expected each slack channel that had a noncompliant resource to receive a message.
Cloud Provider
Amazon Web Services (AWS)
Cloud Custodian version and dependency information
Policy
Relevant log/traceback output
No response
Extra information or context
No response
The text was updated successfully, but these errors were encountered: