我正在尝试通过 Cloudformation 模板启动 RDS 堆栈。我想在我的数据库实例上启用增强监控。为了做到这一点,MonitoringRoleArn
必须在资源上指定属性。
据我了解,这个 ARN 应该指向一个 IAM 服务角色,该角色已被赋予AmazonRDSEnhancedMonitoringRole
政策,如下所述:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html
理想情况下,我还想通过 Cloudformation 创建该角色。然而,在我的一生中,我找不到如何在 Cloudformation 模板中执行此操作的示例。事实证明,Cloudformer 工具不分析 IAM 资源。
有人这样做过吗?你能分享一个例子吗?
in YAML:
Role:
Type: 'AWS::IAM::Role'
Properties:
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole'
AssumeRolePolicyDocument:
Version: '2008-10-17'
Statement:
- Effect: Allow
Principal:
Service: 'monitoring.rds.amazonaws.com'
Action: 'sts:AssumeRole'
然后,您需要在 RDS 实例的 MonitoringRoleArn 属性中引用该角色,如下所示:
!GetAtt ["Role", "Arn"]
如果您需要 JSON 格式的示例,请告诉我。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)