AWS DataSync Task Operator
What this skill does
Executes AWS DataSync operations correctly and safely across the full
source/destination matrix. Runs deterministic pre-checks before any
state-changing CLI — agent activation key validity and reachability,
source location readability, destination location writeability, IAM
task role trust + permissions chain (including the KMS encrypt path
for SSE-KMS destinations, the cross-account bucket policy for
destinations in another account, and the EFS/FSx file system policy
allowing the DataSync service principal), task Options consistency
(e.g. PosixPermissions PRESERVE requires a destination that
preserves POSIX metadata; SMB sources need
SecurityDescriptorCopyFlags configured explicitly), schedule
expression validity (max 1-year horizon, required for
update-task-schedule), and bandwidth-throttle feasibility against
the agent's provisioned uplink. Executes the task change behind a
CONFIRM gate, then verifies the result by tailing
describe-task-execution until Status reaches SUCCESS (with
BytesTransferred, BytesWritten, EstimatedFilesToTransfer,
FilesTransferred, VerifiedFilesCount, TransferDurationBytesPerSecond
surfaced), and for VerifyMode != NONE confirming the verify pass
produced zero files failing the integrity check.
Quick navigation
| Section |
What it covers |
When to read it |
| § Quick reference |
Verdict thresholds (BLOCKED/READY/COMPLETED) + pre-check priority |
Before any operation |
| § Mindset |
Why DataSync is an agent-mediated async pipeline; the false-green-task trap; the verify-mode contract |
Understanding the safety model |
| § Pre-flight |
Source + destination metadata gate — agent reachability, location readability, IAM role chain |
Before executing any CLI |
| § Process |
Per-operation planning: create-task, deploy-agent, update-options, create-schedule, diagnose-failing-execution, run-discovery, transfer-to-fsx-ontap, configure-task-reports |
When choosing which operation to run |
| § Output format |
STRICT output contract — OPERATION/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY/NOTES template |
Formatting the response |
| § Anti-Patterns |
NEVER list — common mistakes that strand data or break transfers silently |
Review before risky operations |
| § Pre-flight safety |
Capture pre-state, IAM role policy, KMS key policy, destination bucket policy |
Defense-in-depth |
| § Expert heuristic |
DataSync is async + eventually-consistent — never assume success from the API alone |
Avoiding the false-green trap |
STRICT output contract
EVERY response MUST end with a single fenced text block in this exact
shape (the operator's downstream tooling greps for it). No deviations:
OPERATION: <create-task | deploy-agent | update-task-options | create-schedule | diagnose-failing-execution | run-discovery | transfer-to-fsx-ontap | configure-task-reports>
VERDICT: READY | BLOCKED | COMPLETED
TARGET: <source-location-uri> -> <destination-location-uri> (task: <id-or-"new">)
PRE_CHECKS:
- [PASS] <check description>
- [FAIL] <check description> — <reason>
STEPS:
1. <CLI command with flags populated, or "(none — pre-checks failed)">
2. <wait / monitoring command>
POST_VERIFY:
- [PASS] <verification description> | (pending execution)
- [FAIL] <verification description> — <reason>
NOTES: <schedule, monitoring, caveats>
Rules of the contract:
- VERDICT is exactly one of
READY, BLOCKED, COMPLETED. No other
values. READY means pre-checks passed and a CONFIRM gate is
pending; BLOCKED means at least one pre-check failed — do NOT
emit STEPS that mutate state; COMPLETED means post-verification
passed after execution.
- If PRE_CHECKS has any
[FAIL], VERDICT MUST be BLOCKED and STEPS
MUST be (none — pre-checks failed).
- If VERDICT is
READY, STEPS[1] MUST be the CONFIRM prompt and
STEPS[2] MUST be the actual CLI.
- If VERDICT is
COMPLETED, POST_VERIFY MUST contain at least one
[PASS] and no [FAIL].
- Never wrap the block in JSON, never abbreviate the field names,
never omit a section. If a section is empty, write
(none).
Quick reference — verdict thresholds
| Verdict |
Trigger condition |
Action |
BLOCKED |
One or more pre-checks failed (agent activation key missing/failed, source unreachable from agent, destination write-denied, IAM task role missing source-read or destination-write, KMS encrypt gap on SSE-KMS destination, cross-account destination bucket policy missing DataSync principal, Options mismatch like PosixPermissions PRESERVE on SMB destination, ScheduleExpression past 1-year horizon, bandwidth-throttle value exceeds agent uplink, destination EFS/FSx in WRONG AZ vs agent subnet) |
List failures, do NOT execute |
READY |
All pre-checks passed; awaiting CONFIRM gate |
Emit exact CLI sequence, wait for operator yes |
COMPLETED |
Task execution reached Status: SUCCESS AND post-verification passed (FilesTransferred == EstimatedFilesToTransfer, VerificationFilesFailed == 0 when VerifyMode != NONE, destination spot-check object exists with expected size and mtime) |
Emit verification results, monitoring plan |
Priority order for pre-checks (apply in this sequence, all must pass
for READY):
- Agent activation + reachability. Agent ARN exists,
LastConnectionTime recent (< 5 min), Status: ONLINE.
- Source location readable by agent. Self-managed sources
(NFS/SMB/HDFS/Object Storage): agent subnet/SG can reach source
server's IP/FQDN on the right port (2049 NFS, 445 SMB, 8020/50070
HDFS NameNode, 443/80 object storage). AWS sources (S3): IAM role
has
s3:GetObject + s3:ListBucket.
- Destination location writable. S3: IAM role has
s3:PutObject, s3:ListBucketMultipartUploads,
s3:AbortMultipartUpload, s3:GetObject (for verify). EFS/FSx:
file-system-specific write permissions and file system policy
allows DataSync service principal.
- IAM task role trust + permissions. Role trusts
datasync.amazonaws.com and has the read-on-source +
write-on-destination chain. Cross-account destinations need the
destination bucket policy to allow the source account's role.
- KMS encrypt path on destination. SSE-KMS destinations require
kms:Encrypt + kms:GenerateDataKey on the destination key AND
the destination key policy must grant the role.
- Options consistency.
PosixPermissions: PRESERVE requires a
POSIX-preserving destination (EFS, FSx for OpenZFS, FSx for
Lustre, S3 with bucket-owner-enforced). SMB sources need
SecurityDescriptorCopyFlags set. SMB destinations cannot
preserve POSIX.
- Schedule expression validity.
ScheduleExpression is a valid
at(...) or rate(...) within the 1-year task-schedule horizon.
ScheduleStatus: ENABLED requires the expression be set.
- Bandwidth-throttle feasibility.
BandwidthLimitInMb does not
exceed the agent's provisioned uplink (typical VM agent ~10 Gbps;
EC2 agents bounded by instance-type network caps).
- Destination file system state. EFS:
available, not
updating. FSx: AVAILABLE, agent subnet has a mount target or
reachable route.
- Task Reports configuration. If reports requested,
S3BucketArn for reports exists and task role has
s3:PutObject on the report bucket.
Cost/time baselines (per-agent throughput ~10 Gbps, verify-pass overhead 5-15%, $0.0125/GB pricing, 14/28-day discovery windows) moved verbatim to references/advanced-patterns.md.
Load on demand when estimating transfer duration and cost.
Mindset
Mindset framing (agent-mediated async pipeline, VerifyMode as a separate pass, destination must be writable AS the DataSync service) moved verbatim to references/advanced-patterns.md.
Load on demand to internalize why execution status — not task status — proves delivery.
Pre-flight: source + destination metadata gate
Run before classification. Misclassifying these produces wrong plans.
Pagination: list-locations paginates at 100.
list-task-executions paginates at 100 by default, sorted descending
by StartTime. describe-task-execution returns the full execution
detail.
Live-account pre-flight listing (list-agents, list-locations, S3/EFS/FSx describes, IAM policy checks, KMS describe-key, describe-task, describe-task-execution, list-discovery-jobs) moved verbatim to references/diagnostic-commands.md.
Load on demand before planning against a live account.
Malformed input: if the input JSON is invalid or missing required
fields, emit VERDICT: ERROR with REASON: Task/location configuration is not valid JSON or is missing required fields — cannot plan. and
REMEDIATION: Re-fetch with aws datasync describe-task --task-arn <task> --output json and re-plan.
| Location attribute |
Effect on operation |
Agent Status: OFFLINE |
create-task BLOCKED. Existing tasks fail execution. |
Agent LastConnectionTime > 5 min ago |
Activation may have expired or network is broken. |
Source LocationType: NFS but server unreachable from agent subnet |
BLOCKED; verify security group + route table. |
SMB source missing SMBUser/SMBPassword secret ARN |
BLOCKED; create AWS Secrets Manager secret and re-create location. |
HDFS source missing NameNodes list |
BLOCKED; re-create create-location-hdfs with valid NameNodes. |
Object Storage missing ServerHostname/BucketName/AccessKey/SecretKey |
BLOCKED; re-create with valid endpoint. |
S3 destination SSE-KMS but role missing kms:GenerateDataKey |
BLOCKED; attach KMS permissions to task role. |
Destination EFS LifeCycle: DELETING |
BLOCKED; pick a new destination. |
Destination FSx Lifecycle: MISCONFIGURED |
BLOCKED; resolve FSx config first. |
| Destination FSx for NetApp ONTAP SVM not reachable via agent subnet |
BLOCKED; verify mount target or VPC peering. |
Destination S3 ObjectOwnership: ObjectWriter (legacy) with cross-account task |
Replicas owned by source account; update to BucketOwnerEnforced. |
Options.PosixPermissions: PRESERVE on SMB destination |
BLOCKED; SMB does not preserve POSIX. Use BEST_EFFORT or NONE. |
Options.Atime: BEST_EFFORT on S3 destination |
S3 does not track atime; field silently ignored. |
at(...) past 1 year |
BLOCKED; schedule horizon is 1 year. |
BandwidthLimitInMb: 50000 exceeds agent uplink |
BLOCKED; throttle must be <= agent uplink capacity. |
Task Status: RUNNING with new start-task-execution |
BLOCKED; only one execution per task concurrently. Queue or wait. |
VerifyMode: NONE on compliance migration |
Surface as a WARNING; never silently allow. |
TransferMode: ALL on a delta sync task |
Forces re-copy of all matching objects; cost/time impact. |
Process — operation planning (apply in order)
Step 0: Expert knowledge — non-obvious DataSync behaviors
Step 0 expert knowledge (agent mandatory for self-managed sources, VerifyMode re-read semantics, TransferMode delta behavior, OverwriteMode interplay, PosixPermissions per destination, SMB Secrets Manager requirement, per-agent bandwidth, 1-year schedule auto-disable, EFS same-AZ, FSx ONTAP SVM, read-only Discovery, Task Reports, single in-flight execution, DeleteOnDelete, non-persistent start overrides) moved verbatim to references/advanced-patterns.md.
Load on demand — each behavior changes a plan if ignored.
Step 1: Pre-check gate — BLOCKED if any check fails
Run ALL pre-checks for the chosen operation. If ANY fails, the verdict
is BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.
For ALL operations:
- Task ARN exists (or operator is creating new) in the expected
account/Region.
- Agent ARN exists,
Status: ONLINE, LastConnectionTime < 5 min
ago (skip for S3-to-S3 in same Region without agent).
- Source and destination locations exist and match the operator's
intended URIs.
- Task IAM role trusts
datasync.amazonaws.com and has the
read-on-source + write-on-destination permission chain.
For create-task (new create-task):
5. Source location LocationArn exists, LocationType matches
operator's claim.
6. Destination location LocationArn exists, LocationType matches.
7. IAM task role has source-side read (e.g., s3:GetObject for S3
source, agent-credential-derived access for self-managed).
8. IAM task role has destination-side write (e.g., s3:PutObject
for S3, elasticfilesystem:ClientWrite for EFS).
9. (SSE-KMS destination) IAM role has kms:Encrypt,
kms:GenerateDataKey; destination key policy grants the role.
10. (Cross-account S3 destination) Destination bucket policy allows
the source account's task role.
11. Options consistency: PosixPermissions: PRESERVE only on POSIX
destinations; SecurityDescriptorCopyFlags set for SMB;
VerifyMode != NONE for compliance migrations.
12. (Task Reports) Report bucket exists and the task role has
s3:PutObject on it.
For deploy-agent: activation key non-empty and < 24h old; agent
VM/EC2 has outbound HTTPS (443) to DataSync endpoints; agent
subnet/SG can reach source location or destination VPC; (cross-Region
or cross-account) VPC peering/TGW/PrivateLink to destination subnet;
IAM role for the agent has datasync:* and source-reading
permissions.
For update-task-options: task Status: AVAILABLE (not RUNNING);
new Options block is internally consistent (see Step 0); pre-state
captured (full prior Options).
For create-schedule: task ARN exists; ScheduleExpression is
valid EventBridge rate/at syntax within 1-year horizon;
(bandwidth throttle) BandwidthLimitInMb <= agent uplink.
For diagnose-failing-execution (read-only, no BLOCKED gate): read
the failure-mode table to identify the root cause from ErrorCode +
ErrorDetail.
For run-discovery: on-prem storage reachable from the discovery
agent; no in-flight discovery job covers the same storage system;
collection window (14 or 28 days) set explicitly.
For transfer-to-fsx-ontap: FSx for NetApp ONTAP file system
AVAILABLE; SVM exists and inter-cluster endpoint reachable from
agent; agent subnet has route to SVM endpoint; task role has
fsx:CreateMountTarget, fsx:DescribeFileSystems, plus the
ONTAP-specific permissions.
For configure-task-reports: reports S3 bucket exists in same
Region; task role has s3:PutObject on the reports bucket;
ReportLevel is one of ERRORS_ONLY, SUCCESSES_AND_ERRORS.
Failure-mode table (agent offline, s3:PutObject denied, mount target AZ mismatch, SMB login failed, KMS key policy, VerificationFilesFailed, flat BytesTransferred, skipped files, LAUNCHING > 30 min) moved verbatim to references/error-handling.md.
Load on demand when diagnosing a failing execution from ErrorCode + ErrorDetail.
Step 2: READY — emit operation plan
If all pre-checks pass, emit VERDICT: READY with the exact CLI
sequence and the CONFIRM gate. The plan includes:
- The exact AWS CLI command with all flags populated from the source
- destination configuration. For
create-task this includes the
full --options JSON and the --cloud-watch-log-group-arn if
specified.
- Expected throughput (10 Gbps ceiling for a single VM agent;
c5.2xlarge ~2 Gbps typical).
- Expected verify-mode overhead (5-15% extra wall time for
POINT_IN_TIME_CONSISTENT).
- The CONFIRM gate prompt.
- The monitoring step (describe-task-execution poll until Status
reaches SUCCESS or ERROR).
Step 3: Execute behind CONFIRM gate
- MANDATORY CONFIRMATION GATE. Before any state-changing CLI
(
create-task, update-task, start-task-execution,
update-task-schedule, create-agent, delete-task), emit:
CONFIRM: About to <operation> on task <task> in account <account> region <region>. This will <consequence>. Proceed? (yes/no). Do
NOT execute until the operator confirms.
- Capture pre-state for rollback:
aws datasync describe-task --task-arn <task> --output json > /tmp/<task>-pre-$(date +%s).json.
- Execute the CLI. For
start-task-execution, the API returns a
TaskExecutionArn immediately; the transfer runs asynchronously
on the agent.
- Poll the execution:
aws datasync describe-task-execution --task-execution-arn <arn>
every 60 seconds (or longer for big transfers). Surface
BytesTransferred, BytesWritten, EstimatedFilesToTransfer,
FilesTransferred, VerificationFilesFailed.
Step 4: Post-verification — COMPLETED
After execution reaches Status: SUCCESS, run post-verification. ALL
checks must pass for COMPLETED.
- Confirm
FilesTransferred == EstimatedFilesToTransfer (unless
Includes/Excludes filters intentionally subset the scope).
- For
VerifyMode != NONE: confirm VerificationFilesFailed == 0
and VerificationFilesTransferred == FilesTransferred.
- Spot-check 3 random files on the destination via
head-object /
ls on the file system. Compare size and mtime to source.
- For S3 destination: confirm
ETag matches (or differs only by
multipart-ETag format).
- For EFS/FSx destination: confirm POSIX permissions preserved when
PosixPermissions: PRESERVE was set.
- For scheduled tasks: confirm next-run
NextRunTime is set under
Schedule.
- For Task Reports: confirm the report object exists at
<report-bucket>/<task-id>/<execution-id>/reports/.
If ANY verification fails, emit VERDICT: ERROR with the failure
details — do not claim COMPLETED. Route the failure back to
diagnose-failing-execution.
Output format (per operation)
See § STRICT output contract above. The block MUST appear exactly in
that shape.
Worked example — create-task (NFS -> S3, VERIFY + schedule)
OPERATION: create-task
VERDICT: READY
TARGET: nfs://10.0.10.20/vol/data -> s3://prod-migration-archive-2026
(task: new — "nfs-to-s3-archive")
PRE_CHECKS:
- [PASS] Agent arn:aws:datasync:us-east-1:111111111111:agent/agent-001
Status: ONLINE, LastConnectionTime: 2026-08-10T22:00:00Z
- [PASS] Source location LocationType: NFS, URI: nfs://10.0.10.20/vol/data
- [PASS] Destination location LocationType: S3, URI: s3://prod-migration-archive-2026
- [PASS] IAM role arn:aws:iam::111111111111:role/datasync-task-role
trusts datasync.amazonaws.com
- [PASS] Task role has s3:PutObject, s3:GetObject, s3:ListBucket,
s3:AbortMultipartUpload on prod-migration-archive-2026
- [PASS] Task role has kms:Encrypt, kms:GenerateDataKey on
arn:aws:kms:us-east-1:111111111111:key/dest-cmk
- [PASS] Destination key policy grants role
- [PASS] Options.VerifyMode: POINT_IN_TIME_CONSISTENT
Options.PosixPermissions: PRESERVE (S3 destination stores POSIX
metadata in object metadata)
- [PASS] ScheduleExpression: rate(1 day) within 1-year horizon
- [PASS] BandwidthLimitInMb: 1000 <= agent uplink (10 Gbps)
STEPS:
1. CONFIRM: About to create DataSync task "nfs-to-s3-archive"
in account 111111111111 region us-east-1. Source:
nfs://10.0.10.20/vol/data. Destination:
s3://prod-migration-archive-2026 (SSE-KMS, key dest-cmk).
VerifyMode: POINT_IN_TIME_CONSISTENT. Schedule: daily.
Bandwidth throttle: 1000 Mb/s. First execution transfers
~12 TB. Proceed? (yes/no)
2. aws datasync create-task \
--source-location-arn arn:aws:datasync:us-east-1:111111111111:location/loc-001 \
--destination-location-arn arn:aws:datasync:us-east-1:111111111111:location/loc-042 \
--name nfs-to-s3-archive \
--cloud-watch-log-group-arn arn:aws:logs:us-east-1:111111111111:log-group:/aws/datasync/nfs-to-s3 \
--options file:///tmp/datasync-options.json \
--schedule-expression "rate(1 day)" \
--tags Key=env,Value=prod Key=pipeline,Value=migration
3. aws datasync start-task-execution --task-arn <new-task-arn>
4. aws datasync describe-task-execution --task-execution-arn <exec-arn>
POST_VERIFY: (pending execution)
NOTES:
- First execution performs a FULL transfer (TransferMode: CHANGED
with no prior baseline). Subsequent executions on the daily
schedule are delta-only.
- VerifyMode POINT_IN_TIME_CONSISTENT adds 5-15% wall time after
the transfer phase. For 12 TB expect ~24-36h on a 1 Gbps throttle.
- Task Reports NOT configured — recommend update-task with reports
bucket for compliance evidence.
- Destination KMS key policy MUST list the task role; verify with
aws kms get-key-policy --key-id dest-cmk --policy-name default
before the first execution.
Worked example — diagnose-failing-execution (BLOCKED with fix)
Worked example (diagnose-failing-execution: AccessDenied on s3:PutObject, partial 2.1TB transfer, IAM attach + TransferMode CHANGED re-run) moved verbatim to references/worked-examples.md.
Load on demand for the shape of a BLOCKED diagnosis with fix.
Worked example — transfer-to-fsx-ontap (COMPLETED)
Worked example (transfer-to-fsx-ontap COMPLETED: SMB → FSx ONTAP, OWNER_DACL, 48,231 files, zero verify failures) moved verbatim to references/worked-examples.md.
Load on demand for the shape of a COMPLETED FSx ONTAP transfer.
Anti-Patterns — NEVER
NEVER assume Status: AVAILABLE on a DataSync task means data is
transferred. The task only declares it is ready to execute; the
only proof of transfer is a describe-task-execution returning
Status: SUCCESS and FilesTransferred == EstimatedFilesToTransfer.
Always verify with an explicit execution result check.
NEVER use VerifyMode: NONE for compliance-driven migrations. The
speed gain is not worth the loss of integrity verification.
Compliance audits require POINT_IN_TIME_CONSISTENT or
ONLY_FILES_TRANSFERRED.
NEVER set PosixPermissions: PRESERVE on an SMB destination. SMB
does not preserve POSIX metadata; the execution will fail or
silently drop the metadata. Use BEST_EFFORT or NONE, or pick
a POSIX-preserving destination (EFS, FSx for OpenZFS).
NEVER share an agent across more tasks than its throughput can
sustain. Bandwidth throttle is per-agent, not per-task; scheduling
three concurrent 1 Gbps tasks on a 1 Gbps-throttled agent starves
them all.
NEVER assume a rate(2 days) schedule survives forever. DataSync
schedules auto-disable after 1 year. Re-arm annually or move the
trigger to EventBridge calling start-task-execution.
NEVER set BandwidthLimitInMb higher than the agent's provisioned
uplink. The cap is enforced on the agent; setting it higher does
not buy throughput, it just removes the throttle.
NEVER call start-task-execution on a task that is already
Status: RUNNING. The API errors with a "task already running"
condition. Use Includes/Excludes filters on multiple tasks to
parallelize instead.
NEVER assume TransferMode: CHANGED does a full copy on every
run. It copies everything on the first run (no baseline) but
subsequent runs only copy new/modified files. For a forced re-copy,
use TransferMode: ALL.
NEVER use a single cross-account destination S3 bucket without a
bucket policy explicitly granting the source account's task role.
IAM identity-based policy on the task role is necessary but not
sufficient.
NEVER forget the SMB secret. create-location-smb requires an
AWS Secrets Manager secret ARN for the SMB password. Hard-coded
passwords are not supported.
NEVER re-create a discovery job for the same on-prem storage
system while one is in flight. The two jobs will compete for
metrics collection and produce inconsistent recommendations.
NEVER auto-execute a state-changing DataSync CLI without the
CONFIRM gate. delete-task, update-task, and
start-task-execution all have irreversible side effects.
NEVER skip capturing pre-state before update-task or
update-task-schedule. The prior Options and Schedule are
overwritten with no undo.
NEVER assume destination EFS is in the same AZ as the agent.
Cross-AZ EFS access works but incurs cross-AZ charges; Single-AZ
EFS requires same-AZ mount target.
NEVER rely solely on the task's Status field for migration
completeness. Read describe-task-execution for every execution.
NEVER deploy an on-prem agent without verifying outbound HTTPS
(443) to DataSync endpoints. The activation key fetch succeeds
locally but the agent will not be able to register with DataSync
control plane.
Pre-flight safety checks (run before any remediation CLI)
Pre-flight safety checks (CONFIRM gate, pre-state capture, agent health, KMS key policies, cross-account bucket policy, additive-over-destructive, Includes/Excludes scope validation) moved verbatim to references/diagnostic-commands.md.
Load on demand before executing any remediation CLI.
Expert heuristic: the false-green task
False-green-task heuristic (registration vs delivery claim, verification-techniques table, three-point verification protocol, DELIVERY_STATUS surfacing, post-deploy silent-failure detection) moved verbatim to references/advanced-patterns.md.
Load on demand before trusting a task's AVAILABLE status.
Recent AWS features (2024-2026)
Recent AWS features (FSx ONTAP destinations, Discovery, Task Reports, DeleteOnDelete, Object Storage locations, per-task bandwidth override, HDFS Kerberos, Snowball Edge, multi-agent tasks, CloudWatch metrics) moved verbatim to references/advanced-patterns.md.
Load on demand before recommending 2024-2026 capabilities.
References (load on demand)
- references/advanced-patterns.md — Mindset, cost/time baselines, Step 0 non-obvious behaviors, false-green heuristic, and Recent AWS features moved from SKILL.md
- references/diagnostic-commands.md — live-account pre-flight listing and pre-flight safety checks moved from SKILL.md
- references/error-handling.md — DataSync failure-mode table moved from SKILL.md
- references/worked-examples.md — secondary worked examples moved from SKILL.md
- references/agent-deployment-and-discovery.md and references/task-options-and-failure-modes.md — agent lifecycle, full Options reference, per-source-type setup, and pre-operation checklists (pre-existing)
Domain
AWS CloudOps / DataSync, on-prem-to-AWS migration, AWS-to-AWS
large-scale transfer, and FSx family destination support.
AWS documentation
1---2name: datasync-task-operator3description: Operates AWS DataSync task end-to-end — agent deployment (on-prem VM, EC2), location configuration for every supported source (NFS, SMB, S3, HDFS, Object Storage) and destination (S3, EFS, FSx for Windows, FSx for Lustre, FSx for OpenZFS, FSx for NetApp ONTAP, Snowball Edge), task creation with the full Options surface (VerifyMode POINT_IN_TIME_CONSISTENT | ONLY_FILES_TRANSFERRED | NONE, OverwriteMode ALWAYS | NEVER, PosixPermissions PRESERVE | PRESERVE_TRY | BEST_EFFORT | NONE, Acl PRESERVE | NONE, TransferMode CHANGED | ALL, Gid PRESERVE | NONE, Uid PRESERVE | NONE, Mtime PRESERVE | NONE, SecurityDescriptorCopyFlags OWNER_DACL_SACL | OWNER_DACL | NONE, TaskQueueing ENABLED | DISABLED), scheduling (cron-like ScheduleExpression with up to 1-year horizon), bandwidth throttling (BandwidthLimitInMb), Task Reports with report-level and report-code filters, DataSync Discovery for on-prem capacity assessment, and FSx for NetApp ONTAP destination support. Runs deterministic pre-checks behind a CONFIRM gate and.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws datasync create-agent, create-location-nfs | create-location-smb | create-location-s3 | create-location-hdfs | create-location-object-storage | create-location-efs | create-location-fsx-windows | create-location-fsx-lustre | create-location-fsx-openzfs | create-location-fsx-ontap, create-task, update-task, start-task-execution...6metadata:7 source: https://skillmd.com/skills/jhkchan/datasync-task-operator8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '4'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Storage15 task_type: operate16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY | BLOCKED | COMPLETED19 when_to_use: Creating or modifying a DataSync task, deploying or activating a DataSync agent (on-prem VM or EC2), configuring source/destination locations for NFS, SMB, S3, HDFS, Object Storage, EFS, or FSx family destinations, setting task Options (VerifyMode, OverwriteMode, TransferMode, PosixPermissions, ACLs), creating a task Schedule with bandwidth throttling, diagnosing a failed or partial task execution, configuring Task Reports, planning an on-prem assessment with DataSync Discovery, or transferring to FSx for NetApp ONTAP.20 activation_triggers: create DataSync task, deploy DataSync agent, activate DataSync agent, DataSync NFS to S3, DataSync SMB to FSx, DataSync HDFS migration, DataSync schedule, DataSync bandwidth throttle, verify data integrity DataSync, POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, DataSync task failing, DataSync task execution error, DataSync Discovery, DataSync FSx for NetApp ONTAP, DataSync Task Reports, DataSync Snowball Edge, DataSync overwrite mode21 invocation_schema: 'Input: either (a) a DataSync task configuration (describe-task, describe-task-execution, describe-agent, list-locations) plus the intended operation (create-task, deploy-agent, update-task-options, create-schedule, diagnose-failing-execution, run-discovery, transfer-to-fsx-ontap, configure-task-reports), OR (b) a source + destination location pair for live-account execution. Output: deterministic OPERATION / VERDICT / PRE_CHECKS / STEPS / POST_VERIFY / NOTES block per operation, where VERDICT is one of READY, BLOCKED, COMPLETED.'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: AWS DataSync, DataSync task, DataSync agent, DataSync Discovery, NFS migration, SMB migration, HDFS migration, Object Storage migration, S3 transfer, EFS transfer, FSx transfer, FSx for NetApp ONTAP, verify data integrity, POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, bandwidth throttling, BandwidthLimitInMb, task schedule, Task Reports, overwrite mode, PosixPermissions preserve, on-prem to AWS migration, Snowball Edge, activation key25 tags: aws, datasync, storage, migration, nfs, smb, hdfs, s3, efs, fsx, operate26---2728# AWS DataSync Task Operator2930## What this skill does3132Executes AWS DataSync operations correctly and safely across the full33source/destination matrix. Runs deterministic pre-checks before any34state-changing CLI — agent activation key validity and reachability,35source location readability, destination location writeability, IAM36task role trust + permissions chain (including the KMS encrypt path37for SSE-KMS destinations, the cross-account bucket policy for38destinations in another account, and the EFS/FSx file system policy39allowing the DataSync service principal), task Options consistency40(e.g. `PosixPermissions PRESERVE` requires a destination that41preserves POSIX metadata; SMB sources need42`SecurityDescriptorCopyFlags` configured explicitly), schedule43expression validity (max 1-year horizon, required for44`update-task-schedule`), and bandwidth-throttle feasibility against45the agent's provisioned uplink. Executes the task change behind a46CONFIRM gate, then verifies the result by tailing47`describe-task-execution` until `Status` reaches `SUCCESS` (with48`BytesTransferred`, `BytesWritten`, `EstimatedFilesToTransfer`,49`FilesTransferred`, `VerifiedFilesCount`, `TransferDurationBytesPerSecond`50surfaced), and for `VerifyMode != NONE` confirming the verify pass51produced zero files failing the integrity check.5253## Quick navigation5455| Section | What it covers | When to read it |56|---|---|---|57| **§ Quick reference** | Verdict thresholds (BLOCKED/READY/COMPLETED) + pre-check priority | Before any operation |58| **§ Mindset** | Why DataSync is an agent-mediated async pipeline; the false-green-task trap; the verify-mode contract | Understanding the safety model |59| **§ Pre-flight** | Source + destination metadata gate — agent reachability, location readability, IAM role chain | Before executing any CLI |60| **§ Process** | Per-operation planning: create-task, deploy-agent, update-options, create-schedule, diagnose-failing-execution, run-discovery, transfer-to-fsx-ontap, configure-task-reports | When choosing which operation to run |61| **§ Output format** | STRICT output contract — OPERATION/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY/NOTES template | Formatting the response |62| **§ Anti-Patterns** | NEVER list — common mistakes that strand data or break transfers silently | Review before risky operations |63| **§ Pre-flight safety** | Capture pre-state, IAM role policy, KMS key policy, destination bucket policy | Defense-in-depth |64| **§ Expert heuristic** | DataSync is async + eventually-consistent — never assume success from the API alone | Avoiding the false-green trap |6566## STRICT output contract6768EVERY response MUST end with a single fenced text block in this exact69shape (the operator's downstream tooling greps for it). No deviations:7071```text72OPERATION: <create-task | deploy-agent | update-task-options | create-schedule | diagnose-failing-execution | run-discovery | transfer-to-fsx-ontap | configure-task-reports>73VERDICT: READY | BLOCKED | COMPLETED74TARGET: <source-location-uri> -> <destination-location-uri> (task: <id-or-"new">)75PRE_CHECKS:76 - [PASS] <check description>77 - [FAIL] <check description> — <reason>78STEPS:79 1. <CLI command with flags populated, or "(none — pre-checks failed)">80 2. <wait / monitoring command>81POST_VERIFY:82 - [PASS] <verification description> | (pending execution)83 - [FAIL] <verification description> — <reason>84NOTES: <schedule, monitoring, caveats>85```8687Rules of the contract:8889- VERDICT is exactly one of `READY`, `BLOCKED`, `COMPLETED`. No other90 values. `READY` means pre-checks passed and a CONFIRM gate is91 pending; `BLOCKED` means at least one pre-check failed — do NOT92 emit STEPS that mutate state; `COMPLETED` means post-verification93 passed after execution.94- If PRE_CHECKS has any `[FAIL]`, VERDICT MUST be `BLOCKED` and STEPS95 MUST be `(none — pre-checks failed)`.96- If VERDICT is `READY`, STEPS[1] MUST be the CONFIRM prompt and97 STEPS[2] MUST be the actual CLI.98- If VERDICT is `COMPLETED`, POST_VERIFY MUST contain at least one99 `[PASS]` and no `[FAIL]`.100- Never wrap the block in JSON, never abbreviate the field names,101 never omit a section. If a section is empty, write `(none)`.102103## Quick reference — verdict thresholds104105| Verdict | Trigger condition | Action |106|---|---|---|107| `BLOCKED` | One or more pre-checks failed (agent activation key missing/failed, source unreachable from agent, destination write-denied, IAM task role missing source-read or destination-write, KMS encrypt gap on SSE-KMS destination, cross-account destination bucket policy missing DataSync principal, Options mismatch like `PosixPermissions PRESERVE` on SMB destination, `ScheduleExpression` past 1-year horizon, bandwidth-throttle value exceeds agent uplink, destination EFS/FSx in WRONG AZ vs agent subnet) | List failures, do NOT execute |108| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence, wait for operator yes |109| `COMPLETED` | Task execution reached `Status: SUCCESS` AND post-verification passed (`FilesTransferred == EstimatedFilesToTransfer`, `VerificationFilesFailed == 0` when `VerifyMode != NONE`, destination spot-check object exists with expected size and mtime) | Emit verification results, monitoring plan |110111**Priority order for pre-checks (apply in this sequence, all must pass112for READY):**1131141. **Agent activation + reachability.** Agent ARN exists,115 `LastConnectionTime` recent (< 5 min), `Status: ONLINE`.1162. **Source location readable by agent.** Self-managed sources117 (NFS/SMB/HDFS/Object Storage): agent subnet/SG can reach source118 server's IP/FQDN on the right port (2049 NFS, 445 SMB, 8020/50070119 HDFS NameNode, 443/80 object storage). AWS sources (S3): IAM role120 has `s3:GetObject` + `s3:ListBucket`.1213. **Destination location writable.** S3: IAM role has122 `s3:PutObject`, `s3:ListBucketMultipartUploads`,123 `s3:AbortMultipartUpload`, `s3:GetObject` (for verify). EFS/FSx:124 file-system-specific write permissions and file system policy125 allows DataSync service principal.1264. **IAM task role trust + permissions.** Role trusts127 `datasync.amazonaws.com` and has the read-on-source +128 write-on-destination chain. Cross-account destinations need the129 destination bucket policy to allow the source account's role.1305. **KMS encrypt path on destination.** SSE-KMS destinations require131 `kms:Encrypt` + `kms:GenerateDataKey` on the destination key AND132 the destination key policy must grant the role.1336. **Options consistency.** `PosixPermissions: PRESERVE` requires a134 POSIX-preserving destination (EFS, FSx for OpenZFS, FSx for135 Lustre, S3 with bucket-owner-enforced). SMB sources need136 `SecurityDescriptorCopyFlags` set. SMB destinations cannot137 preserve POSIX.1387. **Schedule expression validity.** `ScheduleExpression` is a valid139 `at(...)` or `rate(...)` within the 1-year task-schedule horizon.140 `ScheduleStatus: ENABLED` requires the expression be set.1418. **Bandwidth-throttle feasibility.** `BandwidthLimitInMb` does not142 exceed the agent's provisioned uplink (typical VM agent ~10 Gbps;143 EC2 agents bounded by instance-type network caps).1449. **Destination file system state.** EFS: `available`, not145 `updating`. FSx: `AVAILABLE`, agent subnet has a mount target or146 reachable route.14710. **Task Reports configuration.** If reports requested,148 `S3BucketArn` for reports exists and task role has149 `s3:PutObject` on the report bucket.150151Cost/time baselines (per-agent throughput ~10 Gbps, verify-pass overhead 5-15%, $0.0125/GB pricing, 14/28-day discovery windows) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).152Load on demand when estimating transfer duration and cost.153154## Mindset155156Mindset framing (agent-mediated async pipeline, VerifyMode as a separate pass, destination must be writable AS the DataSync service) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).157Load on demand to internalize why execution status — not task status — proves delivery.158159## Pre-flight: source + destination metadata gate160161Run before classification. Misclassifying these produces wrong plans.162163**Pagination:** `list-locations` paginates at 100.164`list-task-executions` paginates at 100 by default, sorted descending165by `StartTime`. `describe-task-execution` returns the full execution166detail.167168Live-account pre-flight listing (list-agents, list-locations, S3/EFS/FSx describes, IAM policy checks, KMS describe-key, describe-task, describe-task-execution, list-discovery-jobs) moved verbatim to [references/diagnostic-commands.md](references/diagnostic-commands.md).169Load on demand before planning against a live account.170171**Malformed input:** if the input JSON is invalid or missing required172fields, emit `VERDICT: ERROR` with `REASON: Task/location configuration173is not valid JSON or is missing required fields — cannot plan.` and174`REMEDIATION: Re-fetch with aws datasync describe-task --task-arn175<task> --output json and re-plan.`176177| Location attribute | Effect on operation |178|---|---|179| Agent `Status: OFFLINE` | create-task BLOCKED. Existing tasks fail execution. |180| Agent `LastConnectionTime` > 5 min ago | Activation may have expired or network is broken. |181| Source `LocationType: NFS` but server unreachable from agent subnet | BLOCKED; verify security group + route table. |182| SMB source missing `SMBUser`/`SMBPassword` secret ARN | BLOCKED; create AWS Secrets Manager secret and re-create location. |183| HDFS source missing `NameNodes` list | BLOCKED; re-create `create-location-hdfs` with valid NameNodes. |184| Object Storage missing `ServerHostname`/`BucketName`/`AccessKey`/`SecretKey` | BLOCKED; re-create with valid endpoint. |185| S3 destination SSE-KMS but role missing `kms:GenerateDataKey` | BLOCKED; attach KMS permissions to task role. |186| Destination EFS `LifeCycle: DELETING` | BLOCKED; pick a new destination. |187| Destination FSx `Lifecycle: MISCONFIGURED` | BLOCKED; resolve FSx config first. |188| Destination FSx for NetApp ONTAP SVM not reachable via agent subnet | BLOCKED; verify mount target or VPC peering. |189| Destination S3 `ObjectOwnership: ObjectWriter` (legacy) with cross-account task | Replicas owned by source account; update to `BucketOwnerEnforced`. |190| `Options.PosixPermissions: PRESERVE` on SMB destination | BLOCKED; SMB does not preserve POSIX. Use `BEST_EFFORT` or `NONE`. |191| `Options.Atime: BEST_EFFORT` on S3 destination | S3 does not track atime; field silently ignored. |192| `at(...)` past 1 year | BLOCKED; schedule horizon is 1 year. |193| `BandwidthLimitInMb: 50000` exceeds agent uplink | BLOCKED; throttle must be <= agent uplink capacity. |194| Task `Status: RUNNING` with new `start-task-execution` | BLOCKED; only one execution per task concurrently. Queue or wait. |195| `VerifyMode: NONE` on compliance migration | Surface as a WARNING; never silently allow. |196| `TransferMode: ALL` on a delta sync task | Forces re-copy of all matching objects; cost/time impact. |197198## Process — operation planning (apply in order)199200### Step 0: Expert knowledge — non-obvious DataSync behaviors201202Step 0 expert knowledge (agent mandatory for self-managed sources, VerifyMode re-read semantics, TransferMode delta behavior, OverwriteMode interplay, PosixPermissions per destination, SMB Secrets Manager requirement, per-agent bandwidth, 1-year schedule auto-disable, EFS same-AZ, FSx ONTAP SVM, read-only Discovery, Task Reports, single in-flight execution, DeleteOnDelete, non-persistent start overrides) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).203Load on demand — each behavior changes a plan if ignored.204205### Step 1: Pre-check gate — BLOCKED if any check fails206207Run ALL pre-checks for the chosen operation. If ANY fails, the verdict208is BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.209210**For ALL operations:**2111. Task ARN exists (or operator is creating new) in the expected212 account/Region.2132. Agent ARN exists, `Status: ONLINE`, `LastConnectionTime` < 5 min214 ago (skip for S3-to-S3 in same Region without agent).2153. Source and destination locations exist and match the operator's216 intended URIs.2174. Task IAM role trusts `datasync.amazonaws.com` and has the218 read-on-source + write-on-destination permission chain.219220**For create-task (new `create-task`):**2215. Source location `LocationArn` exists, `LocationType` matches222 operator's claim.2236. Destination location `LocationArn` exists, `LocationType` matches.2247. IAM task role has source-side read (e.g., `s3:GetObject` for S3225 source, agent-credential-derived access for self-managed).2268. IAM task role has destination-side write (e.g., `s3:PutObject`227 for S3, `elasticfilesystem:ClientWrite` for EFS).2289. (SSE-KMS destination) IAM role has `kms:Encrypt`,229 `kms:GenerateDataKey`; destination key policy grants the role.23010. (Cross-account S3 destination) Destination bucket policy allows231 the source account's task role.23211. Options consistency: `PosixPermissions: PRESERVE` only on POSIX233 destinations; `SecurityDescriptorCopyFlags` set for SMB;234 `VerifyMode != NONE` for compliance migrations.23512. (Task Reports) Report bucket exists and the task role has236 `s3:PutObject` on it.237238**For deploy-agent:** activation key non-empty and < 24h old; agent239VM/EC2 has outbound HTTPS (443) to DataSync endpoints; agent240subnet/SG can reach source location or destination VPC; (cross-Region241or cross-account) VPC peering/TGW/PrivateLink to destination subnet;242IAM role for the agent has `datasync:*` and source-reading243permissions.244245**For update-task-options:** task `Status: AVAILABLE` (not RUNNING);246new `Options` block is internally consistent (see Step 0); pre-state247captured (full prior `Options`).248249**For create-schedule:** task ARN exists; `ScheduleExpression` is250valid EventBridge `rate`/`at` syntax within 1-year horizon;251(bandwidth throttle) `BandwidthLimitInMb` <= agent uplink.252253**For diagnose-failing-execution (read-only, no BLOCKED gate):** read254the failure-mode table to identify the root cause from `ErrorCode` +255`ErrorDetail`.256257**For run-discovery:** on-prem storage reachable from the discovery258agent; no in-flight discovery job covers the same storage system;259collection window (14 or 28 days) set explicitly.260261**For transfer-to-fsx-ontap:** FSx for NetApp ONTAP file system262`AVAILABLE`; SVM exists and inter-cluster endpoint reachable from263agent; agent subnet has route to SVM endpoint; task role has264`fsx:CreateMountTarget`, `fsx:DescribeFileSystems`, plus the265ONTAP-specific permissions.266267**For configure-task-reports:** reports S3 bucket exists in same268Region; task role has `s3:PutObject` on the reports bucket;269`ReportLevel` is one of `ERRORS_ONLY`, `SUCCESSES_AND_ERRORS`.270271Failure-mode table (agent offline, s3:PutObject denied, mount target AZ mismatch, SMB login failed, KMS key policy, VerificationFilesFailed, flat BytesTransferred, skipped files, LAUNCHING > 30 min) moved verbatim to [references/error-handling.md](references/error-handling.md).272Load on demand when diagnosing a failing execution from ErrorCode + ErrorDetail.273274### Step 2: READY — emit operation plan275276If all pre-checks pass, emit `VERDICT: READY` with the exact CLI277sequence and the CONFIRM gate. The plan includes:278279- The exact AWS CLI command with all flags populated from the source280 + destination configuration. For `create-task` this includes the281 full `--options` JSON and the `--cloud-watch-log-group-arn` if282 specified.283- Expected throughput (10 Gbps ceiling for a single VM agent;284 c5.2xlarge ~2 Gbps typical).285- Expected verify-mode overhead (5-15% extra wall time for286 POINT_IN_TIME_CONSISTENT).287- The CONFIRM gate prompt.288- The monitoring step (describe-task-execution poll until Status289 reaches SUCCESS or ERROR).290291### Step 3: Execute behind CONFIRM gate292293- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI294 (`create-task`, `update-task`, `start-task-execution`,295 `update-task-schedule`, `create-agent`, `delete-task`), emit:296 `CONFIRM: About to <operation> on task <task> in account <account>297 region <region>. This will <consequence>. Proceed? (yes/no)`. Do298 NOT execute until the operator confirms.299- Capture pre-state for rollback: `aws datasync describe-task300 --task-arn <task> --output json > /tmp/<task>-pre-$(date +%s).json`.301- Execute the CLI. For `start-task-execution`, the API returns a302 `TaskExecutionArn` immediately; the transfer runs asynchronously303 on the agent.304- Poll the execution:305 `aws datasync describe-task-execution --task-execution-arn <arn>`306 every 60 seconds (or longer for big transfers). Surface307 `BytesTransferred`, `BytesWritten`, `EstimatedFilesToTransfer`,308 `FilesTransferred`, `VerificationFilesFailed`.309310### Step 4: Post-verification — COMPLETED311312After execution reaches `Status: SUCCESS`, run post-verification. ALL313checks must pass for `COMPLETED`.3143151. Confirm `FilesTransferred == EstimatedFilesToTransfer` (unless316 `Includes`/`Excludes` filters intentionally subset the scope).3172. For `VerifyMode != NONE`: confirm `VerificationFilesFailed == 0`318 and `VerificationFilesTransferred == FilesTransferred`.3193. Spot-check 3 random files on the destination via `head-object` /320 `ls` on the file system. Compare size and mtime to source.3214. For S3 destination: confirm `ETag` matches (or differs only by322 multipart-ETag format).3235. For EFS/FSx destination: confirm POSIX permissions preserved when324 `PosixPermissions: PRESERVE` was set.3256. For scheduled tasks: confirm next-run `NextRunTime` is set under326 `Schedule`.3277. For Task Reports: confirm the report object exists at328 `<report-bucket>/<task-id>/<execution-id>/reports/`.329330If ANY verification fails, emit `VERDICT: ERROR` with the failure331details — do not claim COMPLETED. Route the failure back to332diagnose-failing-execution.333334## Output format (per operation)335336See § STRICT output contract above. The block MUST appear exactly in337that shape.338339### Worked example — create-task (NFS -> S3, VERIFY + schedule)340341```text342OPERATION: create-task343VERDICT: READY344TARGET: nfs://10.0.10.20/vol/data -> s3://prod-migration-archive-2026345 (task: new — "nfs-to-s3-archive")346PRE_CHECKS:347 - [PASS] Agent arn:aws:datasync:us-east-1:111111111111:agent/agent-001348 Status: ONLINE, LastConnectionTime: 2026-08-10T22:00:00Z349 - [PASS] Source location LocationType: NFS, URI: nfs://10.0.10.20/vol/data350 - [PASS] Destination location LocationType: S3, URI: s3://prod-migration-archive-2026351 - [PASS] IAM role arn:aws:iam::111111111111:role/datasync-task-role352 trusts datasync.amazonaws.com353 - [PASS] Task role has s3:PutObject, s3:GetObject, s3:ListBucket,354 s3:AbortMultipartUpload on prod-migration-archive-2026355 - [PASS] Task role has kms:Encrypt, kms:GenerateDataKey on356 arn:aws:kms:us-east-1:111111111111:key/dest-cmk357 - [PASS] Destination key policy grants role358 - [PASS] Options.VerifyMode: POINT_IN_TIME_CONSISTENT359 Options.PosixPermissions: PRESERVE (S3 destination stores POSIX360 metadata in object metadata)361 - [PASS] ScheduleExpression: rate(1 day) within 1-year horizon362 - [PASS] BandwidthLimitInMb: 1000 <= agent uplink (10 Gbps)363STEPS:364 1. CONFIRM: About to create DataSync task "nfs-to-s3-archive"365 in account 111111111111 region us-east-1. Source:366 nfs://10.0.10.20/vol/data. Destination:367 s3://prod-migration-archive-2026 (SSE-KMS, key dest-cmk).368 VerifyMode: POINT_IN_TIME_CONSISTENT. Schedule: daily.369 Bandwidth throttle: 1000 Mb/s. First execution transfers370 ~12 TB. Proceed? (yes/no)371 2. aws datasync create-task \372 --source-location-arn arn:aws:datasync:us-east-1:111111111111:location/loc-001 \373 --destination-location-arn arn:aws:datasync:us-east-1:111111111111:location/loc-042 \374 --name nfs-to-s3-archive \375 --cloud-watch-log-group-arn arn:aws:logs:us-east-1:111111111111:log-group:/aws/datasync/nfs-to-s3 \376 --options file:///tmp/datasync-options.json \377 --schedule-expression "rate(1 day)" \378 --tags Key=env,Value=prod Key=pipeline,Value=migration379 3. aws datasync start-task-execution --task-arn <new-task-arn>380 4. aws datasync describe-task-execution --task-execution-arn <exec-arn>381POST_VERIFY: (pending execution)382NOTES:383 - First execution performs a FULL transfer (TransferMode: CHANGED384 with no prior baseline). Subsequent executions on the daily385 schedule are delta-only.386 - VerifyMode POINT_IN_TIME_CONSISTENT adds 5-15% wall time after387 the transfer phase. For 12 TB expect ~24-36h on a 1 Gbps throttle.388 - Task Reports NOT configured — recommend update-task with reports389 bucket for compliance evidence.390 - Destination KMS key policy MUST list the task role; verify with391 aws kms get-key-policy --key-id dest-cmk --policy-name default392 before the first execution.393```394395### Worked example — diagnose-failing-execution (BLOCKED with fix)396397Worked example (diagnose-failing-execution: AccessDenied on s3:PutObject, partial 2.1TB transfer, IAM attach + TransferMode CHANGED re-run) moved verbatim to [references/worked-examples.md](references/worked-examples.md).398Load on demand for the shape of a BLOCKED diagnosis with fix.399400### Worked example — transfer-to-fsx-ontap (COMPLETED)401402Worked example (transfer-to-fsx-ontap COMPLETED: SMB → FSx ONTAP, OWNER_DACL, 48,231 files, zero verify failures) moved verbatim to [references/worked-examples.md](references/worked-examples.md).403Load on demand for the shape of a COMPLETED FSx ONTAP transfer.404405## Anti-Patterns — NEVER406407- NEVER assume `Status: AVAILABLE` on a DataSync task means data is408 transferred. The task only declares it is ready to execute; the409 only proof of transfer is a `describe-task-execution` returning410 `Status: SUCCESS` and `FilesTransferred == EstimatedFilesToTransfer`.411 Always verify with an explicit execution result check.412413- NEVER use `VerifyMode: NONE` for compliance-driven migrations. The414 speed gain is not worth the loss of integrity verification.415 Compliance audits require `POINT_IN_TIME_CONSISTENT` or416 `ONLY_FILES_TRANSFERRED`.417418- NEVER set `PosixPermissions: PRESERVE` on an SMB destination. SMB419 does not preserve POSIX metadata; the execution will fail or420 silently drop the metadata. Use `BEST_EFFORT` or `NONE`, or pick421 a POSIX-preserving destination (EFS, FSx for OpenZFS).422423- NEVER share an agent across more tasks than its throughput can424 sustain. Bandwidth throttle is per-agent, not per-task; scheduling425 three concurrent 1 Gbps tasks on a 1 Gbps-throttled agent starves426 them all.427428- NEVER assume a `rate(2 days)` schedule survives forever. DataSync429 schedules auto-disable after 1 year. Re-arm annually or move the430 trigger to EventBridge calling `start-task-execution`.431432- NEVER set `BandwidthLimitInMb` higher than the agent's provisioned433 uplink. The cap is enforced on the agent; setting it higher does434 not buy throughput, it just removes the throttle.435436- NEVER call `start-task-execution` on a task that is already437 `Status: RUNNING`. The API errors with a "task already running"438 condition. Use `Includes`/`Excludes` filters on multiple tasks to439 parallelize instead.440441- NEVER assume `TransferMode: CHANGED` does a full copy on every442 run. It copies everything on the first run (no baseline) but443 subsequent runs only copy new/modified files. For a forced re-copy,444 use `TransferMode: ALL`.445446- NEVER use a single cross-account destination S3 bucket without a447 bucket policy explicitly granting the source account's task role.448 IAM identity-based policy on the task role is necessary but not449 sufficient.450451- NEVER forget the SMB secret. `create-location-smb` requires an452 AWS Secrets Manager secret ARN for the SMB password. Hard-coded453 passwords are not supported.454455- NEVER re-create a discovery job for the same on-prem storage456 system while one is in flight. The two jobs will compete for457 metrics collection and produce inconsistent recommendations.458459- NEVER auto-execute a state-changing DataSync CLI without the460 CONFIRM gate. `delete-task`, `update-task`, and461 `start-task-execution` all have irreversible side effects.462463- NEVER skip capturing pre-state before `update-task` or464 `update-task-schedule`. The prior Options and Schedule are465 overwritten with no undo.466467- NEVER assume destination EFS is in the same AZ as the agent.468 Cross-AZ EFS access works but incurs cross-AZ charges; Single-AZ469 EFS requires same-AZ mount target.470471- NEVER rely solely on the task's `Status` field for migration472 completeness. Read `describe-task-execution` for every execution.473474- NEVER deploy an on-prem agent without verifying outbound HTTPS475 (443) to DataSync endpoints. The activation key fetch succeeds476 locally but the agent will not be able to register with DataSync477 control plane.478479## Pre-flight safety checks (run before any remediation CLI)480481Pre-flight safety checks (CONFIRM gate, pre-state capture, agent health, KMS key policies, cross-account bucket policy, additive-over-destructive, Includes/Excludes scope validation) moved verbatim to [references/diagnostic-commands.md](references/diagnostic-commands.md).482Load on demand before executing any remediation CLI.483484## Expert heuristic: the false-green task485486False-green-task heuristic (registration vs delivery claim, verification-techniques table, three-point verification protocol, DELIVERY_STATUS surfacing, post-deploy silent-failure detection) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).487Load on demand before trusting a task's AVAILABLE status.488489## Recent AWS features (2024-2026)490491Recent AWS features (FSx ONTAP destinations, Discovery, Task Reports, DeleteOnDelete, Object Storage locations, per-task bandwidth override, HDFS Kerberos, Snowball Edge, multi-agent tasks, CloudWatch metrics) moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).492Load on demand before recommending 2024-2026 capabilities.493494## References (load on demand)495496- [references/advanced-patterns.md](references/advanced-patterns.md) — Mindset, cost/time baselines, Step 0 non-obvious behaviors, false-green heuristic, and Recent AWS features moved from SKILL.md497- [references/diagnostic-commands.md](references/diagnostic-commands.md) — live-account pre-flight listing and pre-flight safety checks moved from SKILL.md498- [references/error-handling.md](references/error-handling.md) — DataSync failure-mode table moved from SKILL.md499- [references/worked-examples.md](references/worked-examples.md) — secondary worked examples moved from SKILL.md500- [references/agent-deployment-and-discovery.md](references/agent-deployment-and-discovery.md) and [references/task-options-and-failure-modes.md](references/task-options-and-failure-modes.md) — agent lifecycle, full Options reference, per-source-type setup, and pre-operation checklists (pre-existing)501502## Domain503504AWS CloudOps / DataSync, on-prem-to-AWS migration, AWS-to-AWS505large-scale transfer, and FSx family destination support.506507## AWS documentation508509- **DataSync User Guide** — https://docs.aws.amazon.com/datasync/latest/userguide/what-is-datasync.html510- **Working with AWS DataSync agents** — https://docs.aws.amazon.com/datasync/latest/userguide/working-with-agents.html511- **Creating a DataSync task** — https://docs.aws.amazon.com/datasync/latest/userguide/create-task.html512- **Task options** — https://docs.aws.amazon.com/datasync/latest/userguide/api-reference.html#API_TaskOptions513- **Scheduling a task** — https://docs.aws.amazon.com/datasync/latest/userguide/configure-task-schedule.html514- **DataSync Task Reports** — https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html515- **DataSync Discovery** — https://docs.aws.amazon.com/datasync/latest/userguide/discovering-your-storage.html516- **FSx for NetApp ONTAP as a destination** — https://docs.aws.amazon.com/datasync/latest/userguide/destination-fsx-ontap.html517- **DataSync on Snowball Edge** — https://docs.aws.amazon.com/datasync/latest/userguide/snowball-edge.html518- **DataSync CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/datasync/519- **DataSync API Reference** — https://docs.aws.amazon.com/datasync/latest/userguide/API_Reference.html