You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过CloudFormation使用CloudWatch查看EC2实例的详细监控?

Enable Detailed CloudWatch Monitoring for EC2 via CloudFormation

If you want to set up detailed CloudWatch monitoring for EC2 instances during creation (instead of relying on the post-launch aws ec2 monitor-instances command), you can directly configure this in your CloudFormation template using the EC2 Instance resource's Monitoring property.

Key Configuration Step

In your CloudFormation template, add the Monitoring attribute to your AWS::EC2::Instance resource and set its value to true. This switches the instance from default basic monitoring (5-minute metric intervals) to detailed monitoring (1-minute intervals).

Example CloudFormation Snippet

Resources:
  MyMonitoredEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-1234567890abcdef0 # Replace with your target AMI ID
      InstanceType: t2.micro
      Monitoring: true # Enables detailed CloudWatch monitoring
      # Include other required properties like SubnetId, SecurityGroupIds, etc.

Important Notes

  • Cost Reminder: Detailed CloudWatch monitoring comes with additional charges compared to basic monitoring. Be sure to account for this if enabling it across multiple instances.
  • No Post-Deployment Steps: Unlike the monitor-instances CLI/console action that targets existing instances, this setting takes effect as soon as the EC2 instance is provisioned via CloudFormation—no extra work needed after deployment.
  • Enhanced Metrics Access: With detailed monitoring enabled, you’ll get access to the full suite of EC2 metrics (CPU utilization, disk I/O, network throughput, etc.) at 1-minute granularity in the CloudWatch console.

内容的提问来源于stack exchange,提问作者Jack

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:56:15