Amazon Config 自定义规则 - Amazon Config
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

Amazon Config 自定义规则

Amazon Config 自定义规则是您从头开始创建的规则。有两种方法可以创建 Amazon Config 自定义规则:使用 Lambda 函数(Amazon Lambda 开发人员指南)和使用策略即代码语言 Guard(Guard GitHub 存储库)。

使用 Lambda 创建的 Amazon Config 自定义规则称为 Amazon Config 自定义 Lambda 规则,使用 Guard 创建的 Amazon Config 自定义规则称为 Amazon Config 自定义策略规则

在使用自定义规则之前,请参阅 注意事项

Amazon Config 自定义策略规则

可以从 Amazon Config 控制台创建,也可以使用 Amazon Config 规则 API 创建使用 Guard 编写的规则。Amazon Config自定义策略规则允许您创建 Amazon Config 自定义规则,无需使用 Java 或 Python 开发 Lambda 函数来管理您的自定义规则。Amazon Config自定义策略规则由配置更改启动。有关 Guard 的更多信息,请参阅 Guard GitHub 存储库

Amazon Config 自定义 Lambda 规则

自定义 Lambda 规则为您提供了选项,可以使用 Java 或 Python 为 Amazon Config 自定义规则创建 Lambda 函数。Lambda 函数是您上传到 Amazon Lambda 的自定义代码,由事件源发布给它的事件调用。如果 Lambda 函数与 Amazon Config 规则关联,则在规则启动时 Amazon Config 会调用该函数。之后,Lambda 函数会评估由 Amazon Config 发送的配置信息并返回评估结果。有关 Lambda 函数的更多信息,请参阅《Amazon Lambda 开发人员指南》中的函数和事件源

Amazon Config 自定义规则的格式差异

下表显示了 ConfigurationItem 数据类型和 Amazon Config 自定义规则字段的格式差异。

ConfigurationItem Amazon Config 自定义规则
version configurationItemVersion
accountId awsAccountId
arn ARN
configurationItemMD5Hash configurationStateMd5Hash