to_from in c7n-mailer #9054
Unanswered
sasidharvelpula
asked this question in
AWS
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My EC2 instances have a tag named "service".
I have the following emails.json file in an S3 bucket:
{
"Services": [
{
"service_name": "ABC TOOLS",
"email": "abc@example.com"
},
{
"service_name": "DEF TOOLS",
"email": "def@example.com"
}
]
}
I have a policy for EC2 instances and I would like to send Cloud Custodian emails to the email address that corresponds to the service tag of the EC2 instances (according to the emails.json file). Is it possible?
I tried the following policy, with notify action using to_from, but the expression expr didn't work. It is taking the string "tag:Service" as value instead of the value of the Service tag in the EC2 instances.
policies:
resource: ec2
actions:
to_from:
url: s3://myfolder/emails.json
format: json
expr: Services[? service_name == "tag:service"].email
subject: "Resource with matching service name"
transport:
type: sqs
queue: my_sqs_queue
Any help would be appreciated. Thank you
Beta Was this translation helpful? Give feedback.
All reactions