{
  "typeName" : "AWS::Backup::BackupPlan",
  "description" : "Resource Type definition for AWS::Backup::BackupPlan",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "properties" : {
    "BackupPlan" : {
      "$ref" : "#/definitions/BackupPlanResourceType"
    },
    "BackupPlanTags" : {
      "type" : "object",
      "additionalProperties" : false,
      "patternProperties" : {
        "^.{1,128}$" : {
          "type" : "string"
        }
      }
    },
    "BackupPlanArn" : {
      "type" : "string"
    },
    "BackupPlanId" : {
      "type" : "string"
    },
    "VersionId" : {
      "type" : "string"
    }
  },
  "additionalProperties" : false,
  "required" : [ "BackupPlan" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/BackupPlanTags",
    "permissions" : [ "backup:TagResource", "backup:UntagResource", "backup:ListTags" ]
  },
  "readOnlyProperties" : [ "/properties/BackupPlanId", "/properties/VersionId", "/properties/BackupPlanArn" ],
  "primaryIdentifier" : [ "/properties/BackupPlanId" ],
  "definitions" : {
    "BackupPlanResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "BackupPlanName" : {
          "type" : "string"
        },
        "AdvancedBackupSettings" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/AdvancedBackupSettingResourceType"
          }
        },
        "BackupPlanRule" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/BackupRuleResourceType"
          }
        },
        "ScanSettings" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/ScanSettingResourceType"
          }
        }
      },
      "required" : [ "BackupPlanName", "BackupPlanRule" ]
    },
    "BackupRuleResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RuleName" : {
          "type" : "string"
        },
        "TargetBackupVault" : {
          "type" : "string"
        },
        "TargetLogicallyAirGappedBackupVaultArn" : {
          "type" : "string"
        },
        "StartWindowMinutes" : {
          "type" : "number"
        },
        "CompletionWindowMinutes" : {
          "type" : "number"
        },
        "ScheduleExpression" : {
          "type" : "string"
        },
        "ScheduleExpressionTimezone" : {
          "type" : "string"
        },
        "IndexActions" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/IndexActionsResourceType"
          }
        },
        "ScanActions" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/ScanActionResourceType"
          }
        },
        "RecoveryPointTags" : {
          "type" : "object",
          "additionalProperties" : false,
          "patternProperties" : {
            "^.{1,128}$" : {
              "type" : "string"
            }
          }
        },
        "CopyActions" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : false,
          "items" : {
            "$ref" : "#/definitions/CopyActionResourceType"
          }
        },
        "Lifecycle" : {
          "$ref" : "#/definitions/LifecycleResourceType"
        },
        "EnableContinuousBackup" : {
          "type" : "boolean"
        }
      },
      "required" : [ "TargetBackupVault", "RuleName" ]
    },
    "AdvancedBackupSettingResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "BackupOptions" : {
          "type" : "object"
        },
        "ResourceType" : {
          "type" : "string"
        }
      },
      "required" : [ "BackupOptions", "ResourceType" ]
    },
    "CopyActionResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Lifecycle" : {
          "$ref" : "#/definitions/LifecycleResourceType"
        },
        "DestinationBackupVaultArn" : {
          "type" : "string"
        }
      },
      "required" : [ "DestinationBackupVaultArn" ]
    },
    "IndexActionsResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ResourceTypes" : {
          "$ref" : "#/definitions/ResourceTypes"
        }
      }
    },
    "ScanSettingResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "MalwareScanner" : {
          "$ref" : "#/definitions/MalwareScanner"
        },
        "ResourceTypes" : {
          "$ref" : "#/definitions/ResourceTypes"
        },
        "ScannerRoleArn" : {
          "type" : "string"
        }
      }
    },
    "ScanActionResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "MalwareScanner" : {
          "$ref" : "#/definitions/MalwareScanner"
        },
        "ScanMode" : {
          "$ref" : "#/definitions/ScanMode"
        }
      }
    },
    "ScanMode" : {
      "type" : "string",
      "enum" : [ "FULL_SCAN", "INCREMENTAL_SCAN" ]
    },
    "MalwareScanner" : {
      "type" : "string",
      "enum" : [ "GUARDDUTY" ]
    },
    "ResourceTypes" : {
      "type" : "array",
      "insertionOrder" : true,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/ResourceType"
      }
    },
    "ResourceType" : {
      "type" : "string"
    },
    "LifecycleResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "MoveToColdStorageAfterDays" : {
          "type" : "number"
        },
        "DeleteAfterDays" : {
          "type" : "number"
        },
        "OptInToArchiveForSupportedResources" : {
          "type" : "boolean"
        }
      }
    }
  },
  "handlers" : {
    "read" : {
      "permissions" : [ "backup:GetBackupPlan", "backup:ListTags" ]
    },
    "create" : {
      "permissions" : [ "backup:GetBackupPlan", "backup:TagResource", "backup:CreateBackupPlan", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "backup:GetBackupPlan", "backup:DeleteBackupPlan" ]
    },
    "update" : {
      "permissions" : [ "backup:UpdateBackupPlan", "backup:ListTags", "backup:TagResource", "backup:UntagResource", "iam:PassRole" ]
    },
    "list" : {
      "permissions" : [ "backup:ListBackupPlans" ]
    }
  }
}