StartTaskExecutionCommand

Starts an DataSync transfer task. For each task, you can only run one task execution at a time.

There are several steps to a task execution. For more information, see Task execution statuses .

If you're planning to transfer data to or from an Amazon S3 location, review how DataSync can affect your S3 request charges  and the DataSync pricing page  before you begin.

Example Syntax

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

import { DataSyncClient, StartTaskExecutionCommand } from "@aws-sdk/client-datasync"; // ES Modules import
// const { DataSyncClient, StartTaskExecutionCommand } = require("@aws-sdk/client-datasync"); // CommonJS import
const client = new DataSyncClient(config);
const input = { // StartTaskExecutionRequest
  TaskArn: "STRING_VALUE", // required
  OverrideOptions: { // 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",
  },
  Includes: [ // FilterList
    { // FilterRule
      FilterType: "SIMPLE_PATTERN",
      Value: "STRING_VALUE",
    },
  ],
  Excludes: [
    {
      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",
      },
    },
  },
  Tags: [ // InputTagList
    { // TagListEntry
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE",
    },
  ],
};
const command = new StartTaskExecutionCommand(input);
const response = await client.send(command);
// { // StartTaskExecutionResponse
//   TaskExecutionArn: "STRING_VALUE",
// };

StartTaskExecutionCommand Input

See StartTaskExecutionCommandInput for more details

Parameter
Type
Description
TaskArn
Required
string | undefined

Specifies the Amazon Resource Name (ARN) of the task that you want to start.

Excludes
FilterRule[] | undefined

Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2".

Includes
FilterRule[] | undefined

Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2".

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 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 with an empty value.

OverrideOptions
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.

Tags
TagListEntry[] | undefined

Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.

Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.

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 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.

StartTaskExecutionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
TaskExecutionArn
string | undefined

The ARN of the running task execution.

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.