Amazon cloudformation 在aws配置模板的云形成中将修正操作作为参数传递

Amazon cloudformation 在aws配置模板的云形成中将修正操作作为参数传递,amazon-cloudformation,amazon-systems-manager,Amazon Cloudformation,Amazon Systems Manager,我目前正在使用cloudformation模板自动创建aws配置规则。我需要在脚本中添加修正操作,以自动化非Compliant资源。 我不知道如何添加补救措施作为云形成模板的参数。 有人能帮我解决这个问题吗?下面是我的代码。但我无法创建堆栈 { "Resources": { "AWSConfigRule": { "Type": "AWS::Config::ConfigRule", "Properties": { "ConfigRuleName": { "Ref": "

我目前正在使用cloudformation模板自动创建aws配置规则。我需要在脚本中添加修正操作,以自动化非Compliant资源。 我不知道如何添加补救措施作为云形成模板的参数。 有人能帮我解决这个问题吗?下面是我的代码。但我无法创建堆栈

{
"Resources": {
"AWSConfigRule": {
  "Type": "AWS::Config::ConfigRule",
  "Properties": {
    "ConfigRuleName": {
      "Ref": "ConfigRuleName"
    },
    "Description": "Checks whether Amazon Virtual Private Cloud flow logs 
are found and enabled for Amazon VPC.",
    "InputParameters": {
      "trafficType": {
        "Fn::If": [
          "trafficType",
          {
            "Ref": "trafficType"
          },
          {
            "Ref": "AWS::NoValue"
          }
        ]
      }
    },
    "Scope": {},
    "Source": {
      "Owner": "AWS",
      "SourceIdentifier": "VPC_FLOW_LOGS_ENABLED"
    },
    "MaximumExecutionFrequency": {
      "Ref": "MaximumExecutionFrequency"
    },
    "RemediationConfigurations": {
        "Ref": "RemediationConfigurations"
    },        
  }
}
  },
 "Parameters": {
"ConfigRuleName": {
  "Type": "String",
  "Default": "vpc-flow-logs-enabled",
  "Description": "The name that you assign to the AWS Config rule.",
  "MinLength": "1",
  "ConstraintDescription": "This parameter is required."
},
"MaximumExecutionFrequency": {
  "Type": "String",
  "Default": "TwentyFour_Hours",
  "Description": "The frequency that you want AWS Config to run evaluations for the rule.",
  "MinLength": "1",
  "ConstraintDescription": "This parameter is required.",
  "AllowedValues": [
    "One_Hour",
    "Three_Hours",
    "Six_Hours",
    "Twelve_Hours",
    "TwentyFour_Hours"
  ]
},
"trafficType": {
  "Type": "String",
  "Default": "",
  "Description": "TrafficType of flow logs"
},
"RemediationConfigurations": [ 
  { 
     "TargetId": "AWS-PublishSNSNotification",
     "TargetType": "SSM_DOCUMENT"
  }
]
},

对于configrules,没有类似于“修正配置”的属性可供您直接使用。因此,您最好调用lambda函数,并使用函数putremediationconfigurations通过脚本传递它。

对于configrules,没有像“RemediationConfigurations”这样的属性可供您直接使用。因此,您最好调用lambda函数,并使用函数putremediationconfigurations通过脚本传递它