Terraform版本:11.11
我正在使用以下代码创建自定义配置规则资源,
但是compliance_resource_types设置为
[“ AWS :: EC2 :: Instance”] 代替 [“ AWS :: EC2 :: SecurityGroup”] 。
感谢是否有人可以指导我进行操作。
`resource "aws_config_config_rule" "remove_sg_open_to_world" {
name = "security_group_not_open_to_world"
description = "Rule to remove SG ports if open to public"
source {
owner = "CUSTOM_LAMBDA"
source_identifier = "arn:aws:lambda:${var.current_region}:xxxxxxxxx:function:remove_sg_open_to_world"
source_detail {
message_type = "ConfigurationItemChangeNotification"
}
}
scope {
compliance_resource_types = ["AWS::EC2::SecurityGroup"]
}
depends_on = ["aws_config_configuration_recorder.config"]