{
  "typeName" : "AWS::GuardDuty::MalwareProtectionPlan",
  "description" : "Resource Type definition for AWS::GuardDuty::MalwareProtectionPlan",
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "guardduty:TagResource", "guardduty:UntagResource", "guardduty:ListTagsForResource" ]
  },
  "properties" : {
    "MalwareProtectionPlanId" : {
      "type" : "string",
      "description" : "A unique identifier associated with Malware Protection plan resource."
    },
    "Arn" : {
      "type" : "string",
      "description" : "Amazon Resource Name (ARN) of the protected resource."
    },
    "Role" : {
      "type" : "string",
      "description" : "IAM role that includes the permissions required to scan and (optionally) add tags to the associated protected resource."
    },
    "ProtectedResource" : {
      "$ref" : "#/definitions/CFNProtectedResource",
      "description" : "Information about the protected resource. Presently, S3Bucket is the only supported protected resource."
    },
    "Actions" : {
      "$ref" : "#/definitions/CFNActions",
      "description" : "Specifies the action that is to be applied to the Malware Protection plan resource."
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The timestamp when the Malware Protection plan resource was created."
    },
    "Status" : {
      "type" : "string",
      "description" : "Status of the Malware Protection plan resource."
    },
    "StatusReasons" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/CFNStatusReasons"
      },
      "description" : "Status details associated with the Malware Protection plan resource status."
    },
    "Tags" : {
      "type" : "array",
      "description" : "The tags to be added to the created Malware Protection plan resource. Each tag consists of a key and an optional value, both of which you need to specify.",
      "items" : {
        "$ref" : "#/definitions/TagItem"
      }
    }
  },
  "required" : [ "Role", "ProtectedResource" ],
  "definitions" : {
    "TagItem" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "CFNProtectedResource" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "S3Bucket" : {
          "type" : "object",
          "description" : "Information about the protected S3 bucket resource.",
          "additionalProperties" : false,
          "properties" : {
            "BucketName" : {
              "type" : "string",
              "description" : "Name of the S3 bucket."
            },
            "ObjectPrefixes" : {
              "type" : "array",
              "description" : "Information about the specified object prefixes. The S3 object will be scanned only if it belongs to any of the specified object prefixes.",
              "items" : {
                "type" : "string"
              }
            }
          }
        }
      },
      "required" : [ "S3Bucket" ]
    },
    "CFNActions" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Tagging" : {
          "$ref" : "#/definitions/CFNTagging",
          "description" : "Contains information about tagging status of the Malware Protection plan resource."
        }
      }
    },
    "CFNTagging" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Status" : {
          "type" : "string",
          "description" : "Indicates whether or not you chose GuardDuty to add a predefined tag to the scanned S3 object."
        }
      }
    },
    "CFNStatusReasons" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Code" : {
          "type" : "string",
          "description" : "The status code of the Malware Protection plan."
        },
        "Message" : {
          "type" : "string",
          "description" : "Issue message that specifies the reason."
        }
      }
    }
  },
  "primaryIdentifier" : [ "/properties/MalwareProtectionPlanId" ],
  "readOnlyProperties" : [ "/properties/MalwareProtectionPlanId", "/properties/Arn", "/properties/CreatedAt", "/properties/Status", "/properties/StatusReasons" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "guardduty:CreateMalwareProtectionPlan", "guardduty:GetMalwareProtectionPlan", "guardduty:TagResource", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "guardduty:GetMalwareProtectionPlan" ]
    },
    "delete" : {
      "permissions" : [ "guardduty:DeleteMalwareProtectionPlan", "guardduty:GetMalwareProtectionPlan" ]
    },
    "update" : {
      "permissions" : [ "guardduty:UpdateMalwareProtectionPlan", "guardduty:GetMalwareProtectionPlan", "guardduty:TagResource", "guardduty:UntagResource", "iam:PassRole" ]
    },
    "list" : {
      "permissions" : [ "guardduty:ListMalwareProtectionPlans" ]
    }
  }
}