使用AWS-CDK将SourceAccountID添加到AWS Config Aggregator

问题描述

我目前正在尝试为我创建的所有配置规则创建一个聚合器,以使客户端可以集中查看所有区域的配置指标。

这是我创建configAggregator的代码

            //adding role for configAggregator
            const configAggregatorRole = new iam.Role(this,'configAggregatorRole',{
              assumedBy: new iam.ServicePrincipal('config.amazonaws.com')
            });

            configAggregatorRole.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSConfigRoleforOrganizations'));
            configAggregatorRole.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('ReadOnlyAccess'));


            //adding a content aggregator for managed config rules below
            const globalConfigAggregator = new config.CfnConfigurationAggregator(this,'globalConfigAggregator',{
              configurationAggregatorName: 'globalConfigAggregator',AccountAggregationSourceProperty: {
                  accountIds : this.account 
            }
          });

    }
  }
  

我目前正在试图弄清楚应该通过什么来指定我希望该帐户和x区域成为该帐户中所有区域中所有配置规则的汇总视图。我不确定该怎么做。谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)