在 RDS 中禁用增强监控

问题描述

我使用 cloudformation 模板启用了对 RDS 实例的增强监控。

现在,当我尝试禁用增强监控时,它不起作用。

根据文档,我已将监控间隔设置为 0,并且我已验证了 cloudformation 的最新参数。但仍然没有禁用增强监控。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html

Cloudformation 没有抛出任何错误并且正在更新。

解决方法

您可以先使用 CLI 进行验证(然后应用到您的 CloudFormation 模板)。

要使用 AWS CLI 禁用增强监控,请将这些命令中的 --monitoring-interval 选项设置为 0

对于 Linux、macOS 或 Unix:

aws rds modify-db-instance \
    --db-instance-identifier mydbinstance \
    --monitoring-interval 30 \
    --monitoring-role-arn arn:aws:iam::123456789012:role/emaccess

对于 Windows:

aws rds modify-db-instance ^
    --db-instance-identifier mydbinstance ^
    --monitoring-interval 30 ^
    --monitoring-role-arn arn:aws:iam::123456789012:role/emaccess

有关更多信息,您可以查看this documentation