- Newest
- Most votes
- Most comments
Hi,
I'd suggest to follow this detailled guidance for the cross-account aspects of DataSync: https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_s3-s3-cross-account-transfer.html
This blog post is a complete walk-through: https://aws.amazon.com/blogs/storage/transferring-data-between-aws-accounts-using-aws-datasync/
Finally, this KC article may also help: https://repost.aws/knowledge-center/datasync-transfer-cross-account-s3
Best,
Didier
1. Network Configuration:
VPC Configuration: Ensure that the DataSync task is configured to use the correct VPC, subnets, and security groups that allow outbound traffic to the S3 endpoint.
VPC Endpoints for S3: If your DataSync task is running within a VPC, ensure that there is a properly configured VPC endpoint for S3 in the same region as your DataSync task. This endpoint must be associated with the correct subnets and route tables.
Region-Specific Settings: Verify that the source and destination locations are set up in the correct regions and that your DataSync agent, if used, is also configured correctly.
2. IAM Role and Permissions:
Cross-Account Role Access: Ensure that the IAM role used by DataSync in Account A has the necessary permissions to access both the source and destination S3 buckets in Account B. The role should have s3:GetObject, s3:ListBucket, s3:PutObject, and other necessary S3 permissions.
**Bucket Policies: **Check that the bucket policies in Account B allow access from the IAM role in Account A. The policies should explicitly allow the required actions (s3:GetObject, s3:PutObject, etc.) for the role's ARN.
3. Endpoint Configuration: Correct Endpoint URLs: Double-check that the S3 endpoints used in the DataSync locations are correct. Since the buckets are in different regions, ensure that the DataSync source and destination locations point to the correct regional S3 endpoints.
**DNS Resolution: **If using private DNS or custom DNS settings within your VPC, ensure that the S3 endpoints can be resolved correctly.
4. Cross-Region Configuration:
Cross-Region Considerations: While DataSync supports cross-region transfers, ensure that the service is enabled and properly configured for both regions involved. Make sure that both regions support the configurations and operations you're attempting.
5. Security Group and Firewall Rules:
Security Group Rules: Verify that the security groups attached to your DataSync task allow outbound HTTPS traffic (port 443) to the S3 endpoint. Network ACLs and Firewalls: If you're using Network ACLs or other firewall rules, confirm that they aren't blocking traffic to the S3 endpoints.
6. DataSync Agent (if applicable): If you're using a DataSync agent, ensure it's online, correctly configured, and has network access to both the source and destination S3 buckets.
7. CloudWatch Logs and Metrics: Review the CloudWatch logs and metrics for your DataSync task. Look for more detailed error messages that might provide additional clues about what might be going wrong.
8. Cross-Account Setup Verification:
Make sure that DataSync has the appropriate cross-account access configured and that the S3 buckets in Account B trust the IAM role from Account A.
Thanks for your response. Regarding the comments around network and endpoint configuration, as this is an S3 - S3 copy the DataSync task is not attached to a VPC. Do we still need a VPC endpoint in this situation? We assumed DataSync would use the AWS service endpoints.
For an S3-to-S3 copy operation using AWS DataSync, you do not necessarily need a VPC endpoint. AWS DataSync is designed to access S3 buckets directly via IAM roles and permissions, without requiring the data transfer to go through a VPC endpoint. This is because DataSync operates at the service level, utilizing AWS's internal network infrastructure to facilitate data transfers between S3 buckets.
However, using VPC endpoints with AWS DataSync can enhance security by ensuring that data transferred between your AWS DataSync agent and AWS services does not traverse the public internet.
Temporarily attach the IAM role to an EC2 instance and try accessing the buckets manually using the AWS CLI. This can help verify if the issue lies with IAM permissions.
Hi Deekshitha, thanks for your response. Do we need a DataSync agent for an S3-to-S3 copy? The DataSync task and locations are in Account A and the buckets both reside in Account B, in different Regions. If we create a VPC endpoint, will DataSync use this without any additional configuration?
In the case of an S3-to-S3 DataSync task that is not attached to a VPC, you are correct that a VPC endpoint is not required. DataSync will use the AWS service endpoints directly. Here are some additional things to check:
Key Points to Consider:
AWS Service Endpoints: DataSync uses the AWS service endpoints to connect to S3. Since the task is not associated with a VPC, the traffic will route through the public internet, leveraging AWS's internal networking where possible.
Permissions and Access: Double-check the IAM roles and bucket policies to ensure there are no restrictions on the access permissions, especially with the cross-account and cross-region setup. Make sure both the source and destination buckets allow access from the DataSync task's IAM role.
S3 Bucket Configuration:
Ensure that the S3 buckets are configured to accept requests from DataSync. Check the bucket policy in Account B to verify that the required actions are allowed for the DataSync IAM role from Account A. S3 Regional Endpoint: Verify that the DataSync task correctly references the regional S3 endpoints. Sometimes, a mismatch in the region configuration can lead to connectivity issues.
CloudWatch Logs: Review any logs from CloudWatch associated with the DataSync task. They might contain more detailed error messages that can help pinpoint the issue.
Possible Issues:
**Cross-Region Latency: **Although not directly related to connectivity issues, cross-region data transfers can sometimes introduce latency or connectivity challenges that might affect task performance.
**Service Quotas or Throttling: **Ensure that you are not hitting any service quotas or throttling limits that might be impacting the DataSync task's ability to connect to the S3 endpoints.
Given that you've ruled out the need for a VPC endpoint, focus on the permissions and bucket policies, and confirm that the task is correctly configured to use the appropriate S3 service endpoints for the regions involved. If these steps don't resolve the issue, AWS support may provide additional insights based on the specific configurations and error logs.
Relevant content
- asked 3 years ago

Hi Damon,
Please validate that you are running your DataSync task in the same region as the destination bucket [1].
Connection errors When transferring between S3 buckets in different AWS accounts and Regions, you might get a network connection error when starting your DataSync task. To resolve this, create a task in the same Region as your destination location and try running that task.
[1] https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_s3-s3-cross-account-transfer.html#s3-s3-cross-account-troubleshooting