UpdateTaskCommand

Updates the configuration of a task, which defines where and how DataSync transfers your data.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DataSyncClient, UpdateTaskCommand } from "@aws-sdk/client-datasync"; // ES Modules import
// const { DataSyncClient, UpdateTaskCommand } = require("@aws-sdk/client-datasync"); // CommonJS import
const client = new DataSyncClient(config);
const input = { // UpdateTaskRequest
  TaskArn: "STRING_VALUE", // required
  Options: { // Options
    VerifyMode: "POINT_IN_TIME_CONSISTENT" || "ONLY_FILES_TRANSFERRED" || "NONE",
    OverwriteMode: "ALWAYS" || "NEVER",
    Atime: "NONE" || "BEST_EFFORT",
    Mtime: "NONE" || "PRESERVE",
    Uid: "NONE" || "INT_VALUE" || "NAME" || "BOTH",
    Gid: "NONE" || "INT_VALUE" || "NAME" || "BOTH",
    PreserveDeletedFiles: "PRESERVE" || "REMOVE",
    PreserveDevices: "NONE" || "PRESERVE",
    PosixPermissions: "NONE" || "PRESERVE",
    BytesPerSecond: Number("long"),
    TaskQueueing: "ENABLED" || "DISABLED",
    LogLevel: "OFF" || "BASIC" || "TRANSFER",
    TransferMode: "CHANGED" || "ALL",
    SecurityDescriptorCopyFlags: "NONE" || "OWNER_DACL" || "OWNER_DACL_SACL",
    ObjectTags: "PRESERVE" || "NONE",
  },
  Excludes: [ // FilterList
    { // FilterRule
      FilterType: "SIMPLE_PATTERN",
      Value: "STRING_VALUE",
    },
  ],
  Schedule: { // TaskSchedule
    ScheduleExpression: "STRING_VALUE", // required
    Status: "ENABLED" || "DISABLED",
  },
  Name: "STRING_VALUE",
  CloudWatchLogGroupArn: "STRING_VALUE",
  Includes: [
    {
      FilterType: "SIMPLE_PATTERN",
      Value: "STRING_VALUE",
    },
  ],
  ManifestConfig: { // ManifestConfig
    Action: "TRANSFER",
    Format: "CSV",
    Source: { // SourceManifestConfig
      S3: { // S3ManifestConfig
        ManifestObjectPath: "STRING_VALUE", // required
        BucketAccessRoleArn: "STRING_VALUE", // required
        S3BucketArn: "STRING_VALUE", // required
        ManifestObjectVersionId: "STRING_VALUE",
      },
    },
  },
  TaskReportConfig: { // TaskReportConfig
    Destination: { // ReportDestination
      S3: { // ReportDestinationS3
        Subdirectory: "STRING_VALUE",
        S3BucketArn: "STRING_VALUE", // required
        BucketAccessRoleArn: "STRING_VALUE", // required
      },
    },
    OutputType: "SUMMARY_ONLY" || "STANDARD",
    ReportLevel: "ERRORS_ONLY" || "SUCCESSES_AND_ERRORS",
    ObjectVersionIds: "INCLUDE" || "NONE",
    Overrides: { // ReportOverrides
      Transferred: { // ReportOverride
        ReportLevel: "ERRORS_ONLY" || "SUCCESSES_AND_ERRORS",
      },
      Verified: {
        ReportLevel: "ERRORS_ONLY" || "SUCCESSES_AND_ERRORS",
      },
      Deleted: {
        ReportLevel: "ERRORS_ONLY" || "SUCCESSES_AND_ERRORS",
      },
      Skipped: {
        ReportLevel: "ERRORS_ONLY" || "SUCCESSES_AND_ERRORS",
      },
    },
  },
};
const command = new UpdateTaskCommand(input);
const response = await client.send(command);
// {};

UpdateTaskCommand Input

See UpdateTaskCommandInput for more details

Parameter
Type
Description
TaskArn
Required
string | undefined

Specifies the ARN of the task that you want to update.

CloudWatchLogGroupArn
string | undefined

Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.

For Enhanced mode tasks, you must use /aws/datasync as your log group name. For example:

arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*

Excludes
FilterRule[] | undefined

Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters .

Includes
FilterRule[] | undefined

Specifies include filters define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters .

ManifestConfig
ManifestConfig | undefined

Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see Specifying what DataSync transfers by using a manifest .

When using this parameter, your caller identity (the IAM role that you're using DataSync with) must have the iam:PassRole permission. The AWSDataSyncFullAccess  policy includes this permission.

To remove a manifest configuration, specify this parameter as empty.

Name
string | undefined

Specifies the name of your task.

Options
Options | undefined

Indicates how your transfer task is configured. These options include how DataSync handles files, objects, and their associated metadata during your transfer. You also can specify how to verify data integrity, set bandwidth limits for your task, among other options.

Each option has a default value. Unless you need to, you don't have to configure any option before calling StartTaskExecution .

You also can override your task options for each task execution. For example, you might want to adjust the LogLevel for an individual execution.

Schedule
TaskSchedule | undefined

Specifies a schedule for when you want your task to run. For more information, see Scheduling your task .

TaskReportConfig
TaskReportConfig | undefined

Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see Monitoring your DataSync transfers with task reports .

When using this parameter, your caller identity (the IAM role that you're using DataSync with) must have the iam:PassRole permission. The AWSDataSyncFullAccess  policy includes this permission.

To remove a task report configuration, specify this parameter as empty.

UpdateTaskCommand Output

See UpdateTaskCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalException
server

This exception is thrown when an error occurs in the DataSync service.

InvalidRequestException
client

This exception is thrown when the client submits a malformed request.

DataSyncServiceException
Base exception class for all service exceptions from DataSync service.