{
  "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" ],
  "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"
          }
        }
      },
      "required" : [ "BackupPlanName", "BackupPlanRule" ]
    },
    "BackupRuleResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RuleName" : {
          "type" : "string"
        },
        "TargetBackupVault" : {
          "type" : "string"
        },
        "StartWindowMinutes" : {
          "type" : "number"
        },
        "CompletionWindowMinutes" : {
          "type" : "number"
        },
        "ScheduleExpression" : {
          "type" : "string"
        },
        "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" ]
    },
    "LifecycleResourceType" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "MoveToColdStorageAfterDays" : {
          "type" : "number"
        },
        "DeleteAfterDays" : {
          "type" : "number"
        }
      }
    }
  },
  "handlers" : {
    "read" : {
      "permissions" : [ "backup:GetBackupPlan", "backup:ListTags" ]
    },
    "create" : {
      "permissions" : [ "backup:CreateBackupPlan" ]
    },
    "delete" : {
      "permissions" : [ "backup:GetBackupPlan", "backup:DeleteBackupPlan" ]
    },
    "update" : {
      "permissions" : [ "backup:UpdateBackupPlan", "backup:ListTags", "backup:TagResource", "backup:UntagResource" ]
    },
    "list" : {
      "permissions" : [ "backup:ListBackupPlans" ]
    }
  }
}