Cloud-Custodian resource:ec2 发送邮件区域和帐户名变量问题
Cloud-Custodian resource:ec2 send mail region and account-name variable problem
我准备了一个 Cloud-CustodianPolicy,它可以检测新创建的 EC2 并发送电子邮件。该结构有效,但我无法将帐户名和地区信息写入邮件主题或正文。虽然yaml在role部分可以理解为{account_id},但是在mail相关部分里面是无法理解的。有没有办法在策略中使用这些参数变量?
yaml 文件;
...
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}"
发送邮件中的邮件主题;
subject: Huge Sized Type EC2 has been PoweredON accountID:{account_id}
{account_name}-{region}
我通过添加双花括号解决了问题并使用了 account
。下面的格式在我的 subject
.
配置中有效
subject: Huge Sized Type EC2 has been PoweredON in {{account}} on {{region}}
我准备了一个 Cloud-CustodianPolicy,它可以检测新创建的 EC2 并发送电子邮件。该结构有效,但我无法将帐户名和地区信息写入邮件主题或正文。虽然yaml在role部分可以理解为{account_id},但是在mail相关部分里面是无法理解的。有没有办法在策略中使用这些参数变量?
yaml 文件;
...
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}"
发送邮件中的邮件主题;
subject: Huge Sized Type EC2 has been PoweredON accountID:{account_id} {account_name}-{region}
我通过添加双花括号解决了问题并使用了 account
。下面的格式在我的 subject
.
subject: Huge Sized Type EC2 has been PoweredON in {{account}} on {{region}}