1

I have prepared a Cloud-CustodianPolicy which detects new created EC2s and send emails. The structure works but I could not write account-name and region information into nor subject or body of mail. While yaml can understand in role part as {account_id}, it can not understand inside of mail related part. Is there a way to use these parametric variables inside policy?

yaml file;

 ...
  role: arn:aws:iam::{account_id}:role/administrator", 
 ...

  actions:
      - type: notify
        template: default
        priority_header: '2'
        subject: "Huge Sized Type EC2 has been PoweredON accountID:{account_id} {account_name}-{region}"

mail subject in the mail sent;

subject: Huge Sized Type EC2 has been PoweredON accountID:{account_id} {account_name}-{region}

4

1 回答 1

1

I have fixed problem by adding double curly braces and used account. The format below has worked in my config for the subject.

subject: Huge Sized Type EC2 has been PoweredON in {{account}} on {{region}}
于 2018-10-10T12:03:14.737 回答