amazon-web-services - 如何将现有资源的标签传递到AWS CFT中的云监视警报?

标签 amazon-web-services aws-cloudformation amazon-cloudwatch

我正在尝试根据实例标签为我的 AWS 账户中的多个实例添加 CloudWatch 警报。

例如,我有 4 个使用标签 Name=DEVAPP=WebServer 运行的实例。

我是 AWS CloudFormation 模板的新手,因此我不确定如何在 CloudWatch 警报的 dimensions 属性中添加标签。我可以在创建实例时通过标签引用多个实例来将单个警报附加到多个实例吗?

这是我的模板的片段。

CPUAlarm:
  Type: AWS::CloudWatch::Alarm
  Properties:
    AlarmDescription: CPUtilization
    AlarmActions: "SNS TOPIC ARN"
    MetricName: CPUUtilization
    Namespace: AWS/EC2
    Statistic: Average
    Period: '60'
    EvaluationPeriods: '2'
    Threshold: '80'
    ComparisonOperator: GreaterThanThreshold
    Dimensions:

最佳答案

如果您通过CFN模板创建实例,您可以参数化标签并在cloudwatch警报资源中使用相同的参数

关于amazon-web-services - 如何将现有资源的标签传递到AWS CFT中的云监视警报?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53310868/

相关文章:

amazon-web-services - 技能的应用程序 ID : Secure to include in public repository?

aws-cloudformation - aws-cdk aws-cli cloudformation 在 arn 中生成额外字符

amazon-web-services - 查看 AWS CloudWatch 中的实例数量/正确配置实例扩展

amazon-web-services - AWS s3 - 触发对象创建,函数被连续调用

amazon-web-services - 使用 cloudformation 模板将日志流式传输到弹性

amazon-web-services - 如何通过cloudformation将文本从s3导入到lambda?

amazon-web-services - 使用cloudformation部署ec2实例

amazon-web-services - 从 Lambda 函数安排的 CloudWatch 事件

amazon-web-services - 用于连接 AWS Cloudwatch 日志、Kinesis Firehose、S3 和 ElasticSearch 的 AWS IAM 策略

python - boto3 获取每项服务的可用操作