{
  "typeName" : "AWS::GuardDuty::Detector",
  "description" : "Resource Type definition for AWS::GuardDuty::Detector",
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "properties" : {
    "FindingPublishingFrequency" : {
      "type" : "string"
    },
    "Enable" : {
      "type" : "boolean"
    },
    "DataSources" : {
      "$ref" : "#/definitions/CFNDataSourceConfigurations"
    },
    "Features" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/CFNFeatureConfiguration"
      }
    },
    "Id" : {
      "type" : "string"
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/TagItem"
      }
    }
  },
  "definitions" : {
    "TagItem" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "CFNS3LogsConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Enable" : {
          "type" : "boolean"
        }
      },
      "required" : [ "Enable" ]
    },
    "CFNKubernetesAuditLogsConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Enable" : {
          "type" : "boolean"
        }
      },
      "required" : [ "Enable" ]
    },
    "CFNKubernetesConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AuditLogs" : {
          "$ref" : "#/definitions/CFNKubernetesAuditLogsConfiguration"
        }
      },
      "required" : [ "AuditLogs" ]
    },
    "CFNDataSourceConfigurations" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "S3Logs" : {
          "$ref" : "#/definitions/CFNS3LogsConfiguration"
        },
        "Kubernetes" : {
          "$ref" : "#/definitions/CFNKubernetesConfiguration"
        },
        "MalwareProtection" : {
          "$ref" : "#/definitions/CFNMalwareProtectionConfiguration"
        }
      }
    },
    "CFNMalwareProtectionConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ScanEc2InstanceWithFindings" : {
          "$ref" : "#/definitions/CFNScanEc2InstanceWithFindingsConfiguration"
        }
      }
    },
    "CFNScanEc2InstanceWithFindingsConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "EbsVolumes" : {
          "type" : "boolean"
        }
      }
    },
    "CFNFeatureConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "type" : "string",
          "maxLength" : 128
        },
        "Status" : {
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "AdditionalConfiguration" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/CFNFeatureAdditionalConfiguration"
          }
        }
      },
      "required" : [ "Name", "Status" ]
    },
    "CFNFeatureAdditionalConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Name" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 256
        },
        "Status" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        }
      }
    }
  },
  "required" : [ "Enable" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "guardduty:CreateDetector", "guardduty:GetDetector", "guardduty:TagResource", "iam:CreateServiceLinkedRole", "iam:GetRole" ]
    },
    "read" : {
      "permissions" : [ "guardduty:GetDetector", "guardduty:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "guardduty:ListDetectors", "guardduty:DeleteDetector", "guardduty:GetDetector" ]
    },
    "update" : {
      "permissions" : [ "guardduty:UpdateDetector", "guardduty:GetDetector", "guardduty:ListDetectors", "iam:CreateServiceLinkedRole", "iam:GetRole", "guardduty:TagResource", "guardduty:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "guardduty:ListDetectors" ]
    }
  },
  "primaryIdentifier" : [ "/properties/Id" ],
  "readOnlyProperties" : [ "/properties/Id" ]
}