{
  "typeName" : "AWS::DataSync::Task",
  "description" : "Resource schema for AWS::DataSync::Task.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datasync.git",
  "definitions" : {
    "FilterRule" : {
      "additionalProperties" : false,
      "description" : "Specifies which files folders and objects to include or exclude when transferring files from source to destination.",
      "type" : "object",
      "properties" : {
        "FilterType" : {
          "description" : "The type of filter rule to apply. AWS DataSync only supports the SIMPLE_PATTERN rule type.",
          "type" : "string",
          "enum" : [ "SIMPLE_PATTERN" ],
          "pattern" : "^[A-Z0-9_]+$",
          "maxLength" : 128
        },
        "Value" : {
          "description" : "A single filter string that consists of the patterns to include or exclude. The patterns are delimited by \"|\".",
          "type" : "string",
          "pattern" : "^[^\\x00]+$",
          "maxLength" : 409600
        }
      }
    },
    "Tag" : {
      "additionalProperties" : false,
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key for an AWS resource tag.",
          "pattern" : "^[a-zA-Z0-9\\s+=._:/-]+$",
          "maxLength" : 256,
          "minLength" : 1
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for an AWS resource tag.",
          "pattern" : "^[a-zA-Z0-9\\s+=._:@/-]+$",
          "maxLength" : 256,
          "minLength" : 1
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "TaskReportConfig" : {
      "additionalProperties" : false,
      "description" : "Specifies how you want to configure a task report, which provides detailed information about for your Datasync transfer.",
      "type" : "object",
      "properties" : {
        "Destination" : {
          "additionalProperties" : false,
          "description" : "Specifies where DataSync uploads your task report.",
          "type" : "object",
          "properties" : {
            "S3" : {
              "$ref" : "#/definitions/TaskReportConfigDestinationS3"
            }
          }
        },
        "OutputType" : {
          "description" : "Specifies the type of task report that you want.",
          "type" : "string",
          "enum" : [ "SUMMARY_ONLY", "STANDARD" ]
        },
        "ReportLevel" : {
          "description" : "Specifies whether you want your task report to include only what went wrong with your transfer or a list of what succeeded and didn't.",
          "type" : "string",
          "enum" : [ "ERRORS_ONLY", "SUCCESSES_AND_ERRORS" ]
        },
        "ObjectVersionIds" : {
          "description" : "Specifies whether your task report includes the new version of each object transferred into an S3 bucket, this only applies if you enable versioning on your bucket.",
          "type" : "string",
          "enum" : [ "INCLUDE", "NONE" ]
        },
        "Overrides" : {
          "additionalProperties" : false,
          "description" : "Customizes the reporting level for aspects of your task report. For example, your report might generally only include errors, but you could specify that you want a list of successes and errors just for the files that Datasync attempted to delete in your destination location.",
          "type" : "object",
          "properties" : {
            "Transferred" : {
              "additionalProperties" : false,
              "description" : "Specifies the level of reporting for the files, objects, and directories that Datasync attempted to transfer.",
              "type" : "object",
              "properties" : {
                "ReportLevel" : {
                  "description" : "Specifies whether you want your task report to include only what went wrong with your transfer or a list of what succeeded and didn't.",
                  "type" : "string",
                  "enum" : [ "ERRORS_ONLY", "SUCCESSES_AND_ERRORS" ]
                }
              }
            },
            "Verified" : {
              "additionalProperties" : false,
              "description" : "Specifies the level of reporting for the files, objects, and directories that Datasync attempted to verify at the end of your transfer. This only applies if you configure your task to verify data during and after the transfer (which Datasync does by default)",
              "type" : "object",
              "properties" : {
                "ReportLevel" : {
                  "description" : "Specifies whether you want your task report to include only what went wrong with your transfer or a list of what succeeded and didn't.",
                  "type" : "string",
                  "enum" : [ "ERRORS_ONLY", "SUCCESSES_AND_ERRORS" ]
                }
              }
            },
            "Deleted" : {
              "additionalProperties" : false,
              "description" : "Specifies the level of reporting for the files, objects, and directories that Datasync attempted to delete in your destination location. This only applies if you configure your task to delete data in the destination that isn't in the source.",
              "type" : "object",
              "properties" : {
                "ReportLevel" : {
                  "description" : "Specifies whether you want your task report to include only what went wrong with your transfer or a list of what succeeded and didn't.",
                  "type" : "string",
                  "enum" : [ "ERRORS_ONLY", "SUCCESSES_AND_ERRORS" ]
                }
              }
            },
            "Skipped" : {
              "additionalProperties" : false,
              "description" : "Specifies the level of reporting for the files, objects, and directories that Datasync attempted to skip during your transfer.",
              "type" : "object",
              "properties" : {
                "ReportLevel" : {
                  "description" : "Specifies whether you want your task report to include only what went wrong with your transfer or a list of what succeeded and didn't.",
                  "type" : "string",
                  "enum" : [ "ERRORS_ONLY", "SUCCESSES_AND_ERRORS" ]
                }
              }
            }
          }
        }
      },
      "required" : [ "Destination", "OutputType" ]
    },
    "TaskReportConfigDestinationS3" : {
      "additionalProperties" : false,
      "description" : "Specifies the Amazon S3 bucket where DataSync uploads your task report.",
      "type" : "object",
      "properties" : {
        "Subdirectory" : {
          "description" : "Specifies a bucket prefix for your report.",
          "type" : "string",
          "maxLength" : 4096,
          "pattern" : "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$"
        },
        "BucketAccessRoleArn" : {
          "description" : "Specifies the Amazon Resource Name (ARN) of the IAM policy that allows Datasync to upload a task report to your S3 bucket.",
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*$"
        },
        "S3BucketArn" : {
          "description" : "Specifies the ARN of the S3 bucket where Datasync uploads your report.",
          "type" : "string",
          "maxLength" : 156,
          "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):(s3|s3-outposts):[a-z\\-0-9]*:[0-9]*:.*$"
        }
      }
    },
    "ManifestConfig" : {
      "additionalProperties" : false,
      "description" : "Configures a manifest, which is a list of files or objects that you want DataSync to transfer.",
      "type" : "object",
      "properties" : {
        "Action" : {
          "description" : "Specifies what DataSync uses the manifest for.",
          "type" : "string",
          "enum" : [ "TRANSFER" ]
        },
        "Format" : {
          "description" : "Specifies the file format of your manifest.",
          "type" : "string",
          "enum" : [ "CSV" ]
        },
        "Source" : {
          "additionalProperties" : false,
          "description" : "Specifies the manifest that you want DataSync to use and where it's hosted.",
          "type" : "object",
          "properties" : {
            "S3" : {
              "$ref" : "#/definitions/ManifestConfigSourceS3"
            }
          }
        }
      },
      "required" : [ "Source" ]
    },
    "ManifestConfigSourceS3" : {
      "additionalProperties" : false,
      "description" : "Specifies the S3 bucket where you're hosting the manifest that you want AWS DataSync to use.",
      "type" : "object",
      "properties" : {
        "ManifestObjectPath" : {
          "description" : "Specifies the Amazon S3 object key of your manifest.",
          "type" : "string",
          "maxLength" : 1024,
          "pattern" : "^[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}\\p{C}]*$"
        },
        "BucketAccessRoleArn" : {
          "description" : "Specifies the AWS Identity and Access Management (IAM) role that allows DataSync to access your manifest.",
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*$"
        },
        "S3BucketArn" : {
          "description" : "Specifies the Amazon Resource Name (ARN) of the S3 bucket where you're hosting your manifest.",
          "type" : "string",
          "maxLength" : 156,
          "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):(s3|s3-outposts):[a-z\\-0-9]*:[0-9]*:.*$"
        },
        "ManifestObjectVersionId" : {
          "description" : "Specifies the object version ID of the manifest that you want DataSync to use.",
          "type" : "string",
          "maxLength" : 100,
          "pattern" : "^.+$"
        }
      }
    },
    "TaskSchedule" : {
      "additionalProperties" : false,
      "description" : "Specifies the schedule you want your task to use for repeated executions.",
      "type" : "object",
      "properties" : {
        "ScheduleExpression" : {
          "description" : "A cron expression that specifies when AWS DataSync initiates a scheduled transfer from a source to a destination location",
          "type" : "string",
          "maxLength" : 256,
          "pattern" : "^[a-zA-Z0-9\\ \\_\\*\\?\\,\\|\\^\\-\\/\\#\\s\\(\\)\\+]*$"
        },
        "Status" : {
          "description" : "Specifies status of a schedule.",
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        }
      }
    },
    "Options" : {
      "additionalProperties" : false,
      "description" : "Represents the options that are available to control the behavior of a StartTaskExecution operation.",
      "type" : "object",
      "properties" : {
        "Atime" : {
          "description" : "A file metadata value that shows the last time a file was accessed (that is, when the file was read or written to).",
          "type" : "string",
          "enum" : [ "NONE", "BEST_EFFORT" ]
        },
        "BytesPerSecond" : {
          "description" : "A value that limits the bandwidth used by AWS DataSync.",
          "type" : "integer",
          "format" : "int64",
          "minimum" : -1
        },
        "Gid" : {
          "description" : "The group ID (GID) of the file's owners.",
          "type" : "string",
          "enum" : [ "NONE", "INT_VALUE", "NAME", "BOTH" ]
        },
        "LogLevel" : {
          "description" : "A value that determines the types of logs that DataSync publishes to a log stream in the Amazon CloudWatch log group that you provide.",
          "type" : "string",
          "enum" : [ "OFF", "BASIC", "TRANSFER" ]
        },
        "Mtime" : {
          "description" : "A value that indicates the last time that a file was modified (that is, a file was written to) before the PREPARING phase.",
          "type" : "string",
          "enum" : [ "NONE", "PRESERVE" ]
        },
        "OverwriteMode" : {
          "description" : "A value that determines whether files at the destination should be overwritten or preserved when copying files.",
          "type" : "string",
          "enum" : [ "ALWAYS", "NEVER" ]
        },
        "PosixPermissions" : {
          "description" : "A value that determines which users or groups can access a file for a specific purpose such as reading, writing, or execution of the file.",
          "type" : "string",
          "enum" : [ "NONE", "PRESERVE" ]
        },
        "PreserveDeletedFiles" : {
          "description" : "A value that specifies whether files in the destination that don't exist in the source file system should be preserved.",
          "type" : "string",
          "enum" : [ "PRESERVE", "REMOVE" ]
        },
        "PreserveDevices" : {
          "description" : "A value that determines whether AWS DataSync should preserve the metadata of block and character devices in the source file system, and recreate the files with that device name and metadata on the destination.",
          "type" : "string",
          "enum" : [ "NONE", "PRESERVE" ]
        },
        "SecurityDescriptorCopyFlags" : {
          "description" : "A value that determines which components of the SMB security descriptor are copied during transfer.",
          "type" : "string",
          "enum" : [ "NONE", "OWNER_DACL", "OWNER_DACL_SACL" ]
        },
        "TaskQueueing" : {
          "description" : "A value that determines whether tasks should be queued before executing the tasks.",
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "TransferMode" : {
          "description" : "A value that determines whether DataSync transfers only the data and metadata that differ between the source and the destination location, or whether DataSync transfers all the content from the source, without comparing to the destination location.",
          "type" : "string",
          "enum" : [ "CHANGED", "ALL" ]
        },
        "Uid" : {
          "description" : "The user ID (UID) of the file's owner.",
          "type" : "string",
          "enum" : [ "NONE", "INT_VALUE", "NAME", "BOTH" ]
        },
        "VerifyMode" : {
          "description" : "A value that determines whether a data integrity verification should be performed at the end of a task execution after all data and metadata have been transferred.",
          "type" : "string",
          "enum" : [ "POINT_IN_TIME_CONSISTENT", "ONLY_FILES_TRANSFERRED", "NONE" ]
        },
        "ObjectTags" : {
          "description" : "A value that determines whether object tags should be read from the source object store and written to the destination object store.",
          "type" : "string",
          "enum" : [ "PRESERVE", "NONE" ]
        }
      }
    },
    "SourceNetworkInterfaceArns" : {
      "description" : "The Amazon Resource Names (ARNs) of the source ENIs (Elastic Network Interfaces) that were created for your subnet.",
      "type" : "array",
      "items" : {
        "type" : "string",
        "pattern" : "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$"
      },
      "maxItems" : 128,
      "insertionOrder" : false
    },
    "DestinationNetworkInterfaceArns" : {
      "description" : "The Amazon Resource Names (ARNs) of the destination ENIs (Elastic Network Interfaces) that were created for your subnet.",
      "type" : "array",
      "items" : {
        "type" : "string",
        "pattern" : "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$"
      },
      "maxItems" : 128,
      "insertionOrder" : false
    }
  },
  "properties" : {
    "Excludes" : {
      "type" : "array",
      "minItems" : 0,
      "maxItems" : 1,
      "items" : {
        "$ref" : "#/definitions/FilterRule"
      },
      "insertionOrder" : false
    },
    "Includes" : {
      "type" : "array",
      "minItems" : 0,
      "maxItems" : 1,
      "items" : {
        "$ref" : "#/definitions/FilterRule"
      },
      "insertionOrder" : false
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "CloudWatchLogGroupArn" : {
      "description" : "The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.",
      "type" : "string",
      "maxLength" : 562,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):logs:[a-z\\-0-9]*:[0-9]{12}:log-group:([^:\\*]*)(:\\*)?$"
    },
    "DestinationLocationArn" : {
      "description" : "The ARN of an AWS storage resource's location.",
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$"
    },
    "Name" : {
      "description" : "The name of a task. This value is a text reference that is used to identify the task in the console.",
      "type" : "string",
      "maxLength" : 256,
      "minLength" : 1,
      "pattern" : "^[a-zA-Z0-9\\s+=._:@/-]+$"
    },
    "Options" : {
      "$ref" : "#/definitions/Options"
    },
    "TaskReportConfig" : {
      "$ref" : "#/definitions/TaskReportConfig"
    },
    "ManifestConfig" : {
      "$ref" : "#/definitions/ManifestConfig"
    },
    "Schedule" : {
      "$ref" : "#/definitions/TaskSchedule"
    },
    "SourceLocationArn" : {
      "description" : "The ARN of the source location for the task.",
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$"
    },
    "TaskArn" : {
      "description" : "The ARN of the task.",
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]*:[0-9]{12}:task/task-[0-9a-f]{17}$"
    },
    "TaskMode" : {
      "description" : "Specifies the task mode for the task.",
      "type" : "string",
      "enum" : [ "BASIC", "ENHANCED" ]
    },
    "Status" : {
      "description" : "The status of the task that was described.",
      "type" : "string",
      "enum" : [ "AVAILABLE", "CREATING", "QUEUED", "RUNNING", "UNAVAILABLE" ]
    },
    "SourceNetworkInterfaceArns" : {
      "$ref" : "#/definitions/SourceNetworkInterfaceArns"
    },
    "DestinationNetworkInterfaceArns" : {
      "$ref" : "#/definitions/DestinationNetworkInterfaceArns"
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "datasync:TagResource", "datasync:UntagResource", "datasync:ListTagsForResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "DestinationLocationArn", "SourceLocationArn" ],
  "readOnlyProperties" : [ "/properties/TaskArn", "/properties/Status", "/properties/SourceNetworkInterfaceArns", "/properties/DestinationNetworkInterfaceArns" ],
  "primaryIdentifier" : [ "/properties/TaskArn" ],
  "createOnlyProperties" : [ "/properties/DestinationLocationArn", "/properties/SourceLocationArn", "/properties/TaskMode" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "datasync:CreateTask", "datasync:DescribeTask", "datasync:ListTagsForResource", "datasync:TagResource", "s3:ListAllMyBuckets", "s3:ListBucket", "s3:GetObject", "s3:GetObjectVersion", "ec2:DescribeNetworkInterfaces", "ec2:CreateNetworkInterface", "ec2:DeleteNetworkInterface", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:CreateNetworkInterfacePermission", "fsx:DescribeFileSystems", "elasticfilesystem:DescribeFileSystems", "elasticfilesystem:DescribeMountTargets", "logs:DescribeLogGroups", "iam:GetRole", "iam:PassRole", "iam:AssumeRole" ]
    },
    "read" : {
      "permissions" : [ "datasync:DescribeTask", "datasync:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "datasync:UpdateTask", "datasync:DescribeTask", "datasync:ListTagsForResource", "datasync:TagResource", "datasync:UntagResource", "logs:DescribeLogGroups", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "datasync:DeleteTask", "ec2:DescribeNetworkInterfaces", "ec2:DeleteNetworkInterface", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "fsx:DescribeFileSystems", "elasticfilesystem:DescribeFileSystems", "elasticfilesystem:DescribeMountTargets", "iam:GetRole" ]
    },
    "list" : {
      "permissions" : [ "datasync:ListTasks" ]
    }
  }
}